Coder Social home page Coder Social logo

install's Introduction

Calabash Sandbox

The calabash-sandbox tool is no longer maintained. You can still use the sandbox, but the ruby version and the base Gemfile will not be updated. To keep your gems up to date, use bundler and Gemfile.

We recommend that you use rbenv installed with homebrew.

https://github.com/calabash/calabash-ios/wiki/Ruby-on-MacOS

$ cd ~/my/project

# Update your Gemfile to point to the version of the gems you want.
# gem "calabash-cucumber", "0.20.5"
# gem "calabash-android", "0.9.1"

$ calabash-sandbox
[me@calabash-sandbox]$ bundle update

System Requirements

Calabash Sandbox requires one of the following operating systems:

  • macOS El Cap
  • macOS Sierra
  • Windows 10

The sandbox is not officially supported on other OS versions.

If you already have rbenv or rvm installed, then this repo is not for you.

Installation

See System Requirements above.

OSX
$ curl -sSL https://raw.githubusercontent.com/calabash/install/master/install-osx.sh | bash
Windows

In an administrator Powershell:

set-executionpolicy unrestricted

then

(New-Object System.Net.WebClient).DownloadString("https://raw.githubusercontent.com/calabash/install/master/install-windows.ps1") | iex

Post-installation, execute the following in an administrator Powershell:

set-executionpolicy restricted

When installation completes, you should see something like the following:

Done! Installed:
calabash-android:   0.8.2
xamarin-test-cloud: 2.0.2
Execute 'calabash-sandbox' to get started!

You can execute calabash-sandbox update at any time to fetch the latest gems.

Usage

When you execute calabash-sandbox, your Terminal window will open the sandbox environment. To leave the sandbox and return the terminal to its previous state, simply type exit.

While in the sandbox, you will have access to all of the gems you need to start writing tests and submitting to Test Cloud. To get started, you could run

$ calabash-ios gen #OSX only

or

$ calabash-android gen

For more information on Calabash, please see the Calabash documentation.

Configuring/Customizing the environment

By default, the sandbox will ignore any existing ruby setup you have on your machine, including installed gems. The sandbox shell is launched with a PATH, GEM_PATH, and GEM_HOME that reference the pre-configured sandbox environment (which is installed to $HOME/.calabash/sandbox).

Installing new gems

If you install new gems while running in the sandbox, they will be installed in the sandbox's GEM_HOME and thus not be available outside of the sandbox.

Building native extensions on Windows

When installing gems that build native extensions on Windows you may get the following error:

ERROR: Failed to build gem native extension.

To resolve this you must provide the Calabash sandbox installation of ruby with the RubyInstaller Development Kit:

  1. Download DevKit from http://rubyinstaller.org/downloads/ making sure you get the version for 32bit versions of Ruby 2.0 and above
  • Install DevKit into C:\DevKit
  • Launch the Calabash sandbox calabash-sandbox
  • Execute cd C:\DevKit\ && ruby dk.rb init
  • Add the following line (replacing <user> with your user directory) to C:\DevKit\config.yml if it doesn’t already exist:
    - C:\Users\<user>\.calabash\sandbox\Rubies\ruby-2.1.6-p336
    
  • Execute ruby dk.rb install

Restoring the sandbox

If you have altered your sandbox environment in a way you don't like and want to restore it to the original state, just run these commands:

OSX:
$ rm -r ${HOME}/.calabash/sandbox
$ curl -sSL https://raw.githubusercontent.com/calabash/install/master/install-osx.sh | bash
Windows:

In a powershell,

rm -r -fo "${env:USERPROFILE}\.calabash\sandbox"

In an administrator Powershell:

set-executionpolicy unrestricted

then

(New-Object System.Net.WebClient).DownloadString("https://raw.githubusercontent.com/calabash/install/master/install-windows.ps1") | iex

Post-installation, execute the following in an administrator Powershell:

set-executionpolicy restricted

Troubleshooting

"/usr/local/bin is not writeable"

This is a common error on a fresh install of OSX.

The script attempts to install the sandbox executable to /usr/local/bin so that it can be easily invoked from the command line. However, if you don't have write permissions in that dir, the install script will not be able to move the script there. You can still run it locally by executing

$ ./calabash-sandbox

from the same directory as you ran the install script.

If you'd like to install it globally, either have an administrator move the calabash-sandbox executable to somewhere in your PATH or modify your .bash_profile, .profile, .zsh etc. to find calabash-sandbox in your PATH. You should not run the install script with sudo.

I ran the install script with sudo

$ sudo rm -r ${HOME}/.calabash/sandbox
$ sudo rm -f /usr/local/bin/calabash-sandbox
$ sudo rm -f ./calabash-sandbox

Run the install script again, this time without sudo.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.