Environment Setup

Last modified on November 24, 2021

Prerequisites

  • You must have Ruby installed.

    To verify your installation, run ruby -v in a command line. The output should be ruby 2.0.0 or higher.

    We recommend that you use a managed version of Ruby like rbenv or rvm.

    If you are using Windows, you can get Ruby at RubyInstaller.org.

  • You must have the Java Development Kit (JDK) installed and available. Calabash will attempt to automatically find it from registry keys on Windows or MonoDroid configurations elsewhere. You can also specify JDK explicitly by setting the JAVA_HOME environment variable to its location (for example, C:\Program Files\Java\jdk1.8.0_20) or having the JDK binaries themselves in your path (for example, C:\Program Files\Java\jdk1.8.0_20\bin).

  • You must have the Android SDK installed. Create an environment variable with the ANDROID_HOME name and its value pointing to the location of the unzipped downloaded SDK.

  • To compile Calabash-Android from source code, you will also need to have Ant installed and added to your path. It can be downloaded from here:

    https://ant.apache.org/bindownload.cgi

Setup

We recommend that you always use Bundler to manage your Calabash version.

  • To install Bundler, run:

    gem install bundler

  • Create the Gemfile file in the working directory. Gemfile will contain all your Ruby dependencies. For example:

    # Contents of Gemfile
    source "https://rubygems.org"

    gem 'calabash-android'
    gem 'cucumber'

  • Install Bundler by running bundle install.

    Note: Make sure to regularly update your Calabash or Cucumber dependencies by running bundle update.
  • Run all commands by prefixing bundler exec, for example, bundle exec calabash-android run ... or bundle exec calabash-android console....

Never install gems with sudo. If you have issues installing Bundler, we recommend that you use the Calabash Sandbox or a managed version of Ruby, such as rbenv or rvm.

See Also

Calabash Support

Highlight search results