Google+ Followers

Thursday, 23 January 2014

Calabash android installation with screen shots ( Step by step guide)

Install Ruby 

Mac

1) \curl -sSL https://get.rvm.io | bash










2) Install specific ruby version using

rvm install 1.9.3

for installing latest stable ruby version

\curl -sSL https://get.rvm.io | bash -s stable --ruby
3) check list of rubies installed 'rvm list

check these links for more help
https://coderwall.com/p/tptocq
http://rvm.io/rubies/installing


Windows 


Android SDK :

Download & install SDK

follow steps from here
https://developer.android.com/sdk/installing/index.html

Install android libraries

Launch installed sdk and choose one of the latest android api to install (if you know minSdkVersion for you app install that also)

minSdkVersion is present in androidmanifest.xml file as this this minimal SDK level required to run this particular application(http://developer.android.com/guide/topics/manifest/uses-sdk-element.html)

pic: Find out Android Api version required




pic: Installing required version from SDK manager



Enviroment Variables

MAC 

In terminal type 'open ~/.bash_profile' (create this file if its not present already) or 'open ~/.profile' (if it exists) 
  • export ANDROID_HOME=/Users/tejasvi/Documents/proj/android/adt/sdk
  • export PATH=$PATH:$ANDROID_HOME/platform-tools
  • export PATH=$PATH:$ANDROID_HOME/tools
  • JAVA_HOME=/System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home

WINDOWS

If you have no idea to set environment variables check here
 
Set 
JAVA_HOME

Android tools / Android platform-tools folder into path variable





And set ANDROID_HOME=<path to android sdk>

 

BOTH WINDOWS & MAC

First connect your device
Relaunch terminal  and run below command

~ $: adb devices
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached 
479005cda7cxxx device

windows: if devices are not listed its mostly problem with drivers ( install HTC sync for HTC devices / samsung kies for samsung devices)

Calabash Installation

Open terminal and 
type these commands  on mac



windows - do not use sudo 


Wait until they are installed

Then do 'gem list' , this will display all gems installed 

To find current gem enviroment use 'gem env' command

5 comments:

  1. Great post. What is your experience setting up your environment to be able to run both iOS and Android tests on the same machine? A mac to be specific.

    ReplyDelete
  2. How do I do the last step on windows?

    ReplyDelete
    Replies
    1. Nevermind, I just needed a reboot on windows

      Delete
  3. Temporarily enhancing PATH to include DevKit...
    Building native extensions. This could take a while...
    ERROR: Error installing calabash-android:
    ERROR: Failed to build gem native extension.

    C:/Ruby200-x64/bin/ruby.exe extconf.rb
    checking for main() in -lc... no
    creating Makefile

    make "DESTDIR="
    'make' is not recognized as an internal or external command,
    operable program or batch file.

    not working gem install calabash-android

    how to solve
    any idea

    ReplyDelete
  4. pls use this cmd
    gem install --version '= 0.5.0' calabash-android
    working fine

    ReplyDelete