Setup android automation with calabash-android

Install calabash-android

gem install calabash-android

Install Android studio if you don’t have it.

https://developer.android.com/studio/index.html

Add env variable for Android_HOME

export ANDROID_HOME="/Users/jason_chang/Library/Android/sdk"

Check android_home

echo $ANDROID_HOME

If you don’t have any keystore, use following command

keytool -genkey -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android -keyalg RSA -keysize 2048 -validity 10000 -dname "CN=Android Debug,O=Android,C=US"

Setup calabash-android

calabash-android setup

It needs your keystore location, password and alias

If you never use it, use default

Keystore name: “debug.keystore"

Keystore password: “android"

Key alias: “androiddebugkey"

Key password: “android"

CN: “CN=Android Debug,O=Android,C=US"

 

Now you can start running your calabash-android

If you are going to create a new folder, use following command

calabash-android gen

Basic run all calabash-android features

calabash-android run "apk_name"

Run specific tags

calabash-android run "apk_name" --tags @ex1,@ex2

Run specific feature

calabash-android run "apk_name" ./features/xx.feature

Reset apk between every scenarios

calabash-android run "apk_name" RESET_BETWEEN_SCENARIOS=1
廣告

發表迴響

在下方填入你的資料或按右方圖示以社群網站登入:

WordPress.com Logo

您的留言將使用 WordPress.com 帳號。 登出 / 變更 )

Twitter picture

您的留言將使用 Twitter 帳號。 登出 / 變更 )

Facebook照片

您的留言將使用 Facebook 帳號。 登出 / 變更 )

Google+ photo

您的留言將使用 Google+ 帳號。 登出 / 變更 )

連結到 %s