Google+ Followers

Monday, 24 March 2014

Setting iphone 4 inch simulator as default simulator for calabash tests

  • Open terminal and put the below line - 
defaults write com.apple.iphonesimulator "SimulateDevice" '"iPhone (Retina)"'Open terminal and put the below line - 
  • now open simulator and check 4inch simulator is launched

To launch tests on ios7 simulator in calabash.
add below line to support/env.rb

`defaults write com.apple.iphonesimulator "SimulateDevice" '"iPhone (Retina)"'`

Monday, 10 March 2014

launch and close genymotion emulator from command line (shell script)

  • Create a android emulator with some name ex: Nexus_5
  • launch emulator 
  • wait for device to be recognised
  • if device launch failed try again
#!/bin/bash
c=1
while [ $c -le 5 ]
do
    ps | grep "player" | awk '{print $1}' | xargs kill
    adb kill-server
    player --vm-name Nexus_5 &
    sleep 2
    adb start-server
    sleep 30
    res=`adb get-state`;echo $res
    if [ $res = "device" ]
    then
        break
    else
        echo "repeat simulator launch"
    fi
    c=$(($c+1))
done


To install genymotion check herehttp://www.mobiletestworld.com/2014/02/install-genymotion-fastest-android-emulator-on-mac.html


Thursday, 6 March 2014

Calabash: Building ios app from command line

Go to project folder (from terminal) or specify the project folder (where xcodeproj file is present) using PROJ_LOC


  • update the below commands with appropriate values for your application 
  • paste them into as shell script
  • run the shell script


SCHEME_XC="app-cal" #name of calabash scheme
BUILD_CONFIG="Debug" # build config (usually its debug)
FEATURES_PATH="features"
ARCHITECTURE_SELECTED=i386
PROJ_LOC="../${PROJ_NAME/app.xcodeproj"

xcodebuild  -scheme "${SCHEME_XC}" -project "${PROJ_LOC}" -configuration Debug ONLY_ACTIVE_ARCH=NO -sdk iphonesimulator build

Saturday, 1 March 2014

calabash:initial-commit of your code to github


Open the folder where repository was downloaded previously (check here http://www.mobiletestworld.com/2014/03/download-calabash-ios-android-code-github.html for instruction on how to  download code)

Add/edit  files required to be uploaded to repository 





  • you will the see added files as uncommited changes in source 
  • drag the files to saved on repository
  • drop the files into the window show below
  • press commit button (these files be commited but not pushed on remote repository yet.
  • Enter commit message and submit

  • Push changes to remote location so changes are saved permanently on remote server

  • Select branch on master to push
Check that changes are now shown in github or where repository is hosted 

calabash-how to download source code from github

    Create a new repository
          incase you just want to download code skip to next section 

  • Create GIT hub account at https://github.com/ its free 
Create GIT hub account
  • Click on top right corner and create a repository if you need a new one or incase you just want to download code (clone) then 
  • Enter you git hub account name and description and submit, your repository will be created
    Download source code

  • To download the repository, copy the link of the repo as indicated below 
download the repository
  • Open git client ex: source tree and paste the link and choose folder where repository has to be downloaded.
download source code
Add caption

  •  Once downloading is complete you will see the files in chosen directory and in source as below

To add existing code to repository click here - http://www.mobiletestworld.com/2014/03/how-to-do-first-commit-calabash-code.html