Skip to content

Instantly share code, notes, and snippets.

@DominikDary
Created October 19, 2012 04:18
Show Gist options
  • Save DominikDary/3916202 to your computer and use it in GitHub Desktop.
Save DominikDary/3916202 to your computer and use it in GitHub Desktop.
Calabash-Android IRB configuration for version >= 0.3
require 'rubygems'
require 'irb/completion'
require 'irb/ext/save-history'
ARGV.concat [ "--readline",
"--prompt-mode",
"simple" ]
# 25 entries in the list
IRB.conf[:SAVE_HISTORY] = 50
# Store results in home directory with specified file name
IRB.conf[:HISTORY_FILE] = ".irb-history"
require 'calabash-android/operations'
include Calabash::Android::Operations
start_test_server_in_background
#!/bin/bash
TEST_SERVER_PORT=34777
PACKAGE_NAME=$1
MAIN_ACTIVITY=$2
if [ -z "$PACKAGE_NAME" ]; then
echo 'The parameter about your mobile app package is missing: e.g. com.springsource.greenhouse.test'
exit 1
fi
if [ -z "$MAIN_ACTIVITY" ]; then
echo 'The parameter about your mobile app main activity is missing: e.g. com.springsource.greenhouse.MainActivity'
exit 1
fi
# use this line for calabash version 0.1
# adb shell am instrument -e class sh.calaba.instrumentationbackend.InstrumentationBackend -w $PACKAGE_NAME/android.test.InstrumentationTestRunner &
# use this for calabash-version 0.2
# adb shell am instrument -e class sh.calaba.instrumentationbackend.InstrumentationBackend -w $PACKAGE_NAME/sh.calaba.instrumentationbackend.CalabashInstrumentationTestRunner &
#use this for calabash version 0.3
#adb shell am instrument -e target_package $PACKAGE_NAME -e main_activity $MAIN_ACTIVITY -e class sh.calaba.instrumentationbackend.InstrumentationBackend sh.calaba.android.test/sh.calaba.instrumentationbackend.CalabashInstrumentationTestRunner
#sleep 7
IRBRC=.irbrc TEST_SERVER_PORT=$TEST_SERVER_PORT PACKAGE_NAME=$PACKAGE_NAME MAIN_ACTIVITY=$MAIN_ACTIVITY irb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment