selendroid / selendroid

"Selenium for Android" (Test automate native or hybrid Android apps and the mobile web with Selendroid.) Join us on IRC #selendroid on freenode. Also confirm you have signed the CLA http://goo.gl/pAvxEI when making a Pull Request.
http://selendroid.io
Apache License 2.0
889 stars 435 forks source link

I got "Failed to start instrumentation" message. #235

Closed ez2sugul closed 9 years ago

ez2sugul commented 10 years ago

when selendroid server executes command shell am instrument, aut will be started on device. it usually worked well but some auts not be started on device. I found when starting aut failed selendroid server keep trying start and stop using shell am instrument and shell am force-stop commands.

I wonder what problem is that and how to solve it.

here is error message

INFO: executing command: /Users/skplanet/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb -s 42f7ecb874668f6f shell am instrument -e main_activity com.skp.styletag.activity.SplashActivity -e server_port 8080 io.selendroid.com.skp.styletag/io.selendroid.ServerInstrumentation 1? 22, 2014 10:56:40 ?? io.selendroid.server.model.SelendroidStandaloneDriver createNewTestSession INFO: error while starting selendroid: Failed to start instrumentation 1? 22, 2014 10:56:40 ?? io.selendroid.io.ShellCommand exec INFO: executing command: /Users/skplanet/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb -s 42f7ecb874668f6f shell am force-stop com.skp.styletag 1? 22, 2014 10:56:41 ?? io.selendroid.io.ShellCommand exec INFO: executing command: /Users/skplanet/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb -s 42f7ecb874668f6f shell am force-stop com.skp.styletag 1? 22, 2014 10:56:42 ?? io.selendroid.android.impl.AbstractDevice kill INFO: logcatWatchdog logcatWatchdog = io.selendroid.android.impl.DefaultHardwareDevice@125b267f null

ez2sugul commented 10 years ago

selendroid server is using dab install command for installing aut on device. so I directly executed that command in command line. error is like that..

[Command Line] /Users/skplanet/adt-bundle-mac-x86_64-20131030/sdk/platform-tools/adb -s 42f7ecb874668f6f install /Users/skplanet/Documents/Projects/robotium/resigned-kr.co.ulike.tesports-1.apk 3765 KB/s (21893366 bytes in 5.678s) pkg: /data/local/tmp/resigned-kr.co.ulike.tesports-1.apk Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES]

lukeis commented 10 years ago

means your apk didn't get adequately resigned with your debug certificate. Can you confirm that ~/.android/debug.keystore exists?

Matthalp-zz commented 10 years ago

I get the same error trying to use Selendroid with latest version of the Mozilla Firefox apk. The ~/.android/debug.keystore does exist and has not expired on my system.

ez2sugul commented 10 years ago

I already have debug.keystore file and I can find out selendroid server log that signs the apk using jarsigner. actually, I solved this problem using re-sign.jar that robotium supports. the only different thing between signing of selendroid and signing of re-sign.jar is zipalign. here is re-sign.jar log.

Running jarsigner Command line: /Library/Java/JavaVirtualMachines/jdk1.7.0_21.jdk/Contents/Home/bin/jarsigner -sigalg MD5withRSA -digestalg SHA1 -keystore /Users/skplanet/.android/debug.keystore -storepass android -keypass android /var/folders/6f/ygl_qxd91dq0rwccy4z78_sr0000gn/T/resigner2980356901975576025.apk androiddebugkey jarsigner finished with following output: Running zipalign Command line: /Users/skplanet/adt-bundle-mac-x86_64-20131030/sdk/tools/zipalign -f 4 /var/folders/6f/ygl_qxd91dq0rwccy4z78_sr0000gn/T/resigner2980356901975576025.apk /Users/skplanet/Documents/Projects/robotium/com.skt.tmaphot-1_debug.apk

asm89 commented 9 years ago

I'm closing this issue due to inactivity.

If is a question rather than an issue, please send questions to the selendroid user group.

If you think it's an actual problem with selendroid and still experience the issue described on the latest release of selendroid feel free to file a new issue. If you do please provide a concise reproducible test case and describe what results you are seeing and what results you expect.