When you set-up a new android devices or update your .apk file, you may possible get INSTRUMENTATION_FAILED exception:
android.util.AndroidException: INSTRUMENTATION_FAILED: com.package.name/sh.calaba.instrumentationbackend.CalabashInstrumentationTestRunner at com.android.commands.am.Am.runInstrument(Am.java:1093) at com.android.commands.am.Am.onRun(Am.java:371) at com.android.internal.os.BaseCommand.run(BaseCommand.java:47) at com.android.commands.am.Am.main(Am.java:100) at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method) at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:251)
To fix this issue you can follow the instruction below:
- Create new folder
- Copy your .apk file into the newly created folder
- go to your newly created folder and run this command to create calabash-android project
calabash-android gen
- run calabash-android via your new devices
calabash-android run latest.apk features ADB_DEVICE_ARG=192.168.56.101:5555
- resign .apk if you need
calabash-android resign latest.apk
- return to your main project folder and run your test cases as usual:
calabash-android run latest.apk features ADB_DEVICE_ARG=192.168.56.101:5555
- You can delete your newly your created folder