ADB quit unexpectedly when running on Android device

662 views
Skip to first unread message

Ethan Close

unread,
Aug 4, 2013, 1:09:17 PM8/4/13
to appium-...@googlegroups.com
I'm trying to run a test on an Android device and am getting an error after starting Bootstrap. The error is about the socket then adb, but lsof shows it's being listened to by adb. See output/log below. Any thoughts on how to debug this?

Here's the device/build info:

OS: CM10.1, Android 4.2.2
Device: Nexus S 4G
Appium: master : commit f435049b [July 31st 2013]

Appium server log:

info: "/Users/ethan/adt/sdk/platform-tools/adb" -s 39329055894500EC shell uiautomator runtest AppiumBootstrap.jar -c io.appium.android.bootstrap.Bootstrap
info: [ADB STDOUT] INSTRUMENTATION_STATUS: current=1
info: [ADB STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
info: [ADB STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
info: [ADB STDOUT] INSTRUMENTATION_STATUS: stream=
info: [ADB STDOUT] io.appium.android.bootstrap.Bootstrap:
info: [ADB STDOUT] INSTRUMENTATION_STATUS: numtests=1
info: [ADB STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
info: [ADB STDOUT] INSTRUMENTATION_STATUS_CODE: 1
info: [ANDROID] [debug] Could not start socket server listening on 4724
error: ADB quit before it successfully launched
error: Failed to start an Appium session, err was: ADB quit unexpectedly before successfully launching
info: Responding to client with error: {"status":6,"value":{"message":"A session is either terminated or not started","origValue":"ADB quit unexpectedly before successfully launching"},"sessionId":"3f223a05-5be5-4a97-836d-7cbb941475af"}
POST /wd/hub/session 500 3516ms - 225

ADB and the socket inspection immediately after the failure:

$ sudo lsof -i | grep 4724
adb       47063          ethan   32u  IPv4 0xa6284eacbb255a53      0t0    TCP localhost:4724 (LISTEN)
$ ps -ef | grep adb
  501 47063     1   0 10:01AM ??         0:00.19 adb fork-server server

bootstrap online

unread,
Aug 4, 2013, 1:33:23 PM8/4/13
to Ethan Close, appium-...@googlegroups.com
Try running adb kill-server; adb devices
> --
> http://appium.io
> ---
> You received this message because you are subscribed to the Google Groups
> "Appium-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to appium-discus...@googlegroups.com.
> Visit this group at http://groups.google.com/group/appium-discuss.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>

Nimret Sandhu

unread,
Aug 5, 2013, 12:00:43 AM8/5/13
to appium-...@googlegroups.com, Ethan Close
you may also want to unplug the usb connector and reattach it. I've noticed that if I don't close the WebDriver session and a timeout occurs that I have to restart the adb server and then reattach my device.

Ethan Close

unread,
Aug 5, 2013, 11:48:07 AM8/5/13
to appium-...@googlegroups.com, Ethan Close
On a different machine with the same device I was able to get the test to run successfully. 

One difference was that I uninstalled the test apk before running the test. I did this because when I tried to push the test apk to the device from the command-line, I received an error Failure [INSTALL_FAILED_VERSION_DOWNGRADE]. So, I think I must have had a more recent version of my test app already on the phone and perhaps ADB was failing due to this and not reporting it back up to the server properly. I'm not sure about this, but will test this theory when I have a chance.

The other problem I encountered was this error and still am not sure why it occurs:

info: Running bootstrap
info: "/Users/ethanclose/adt-bundle-mac-x86_64-20130522/sdk/platform-tools/adb" -s 39329055894500EC shell uiautomator runtest AppiumBootstrap.jar -c io.appium.android.bootstrap.Bootstrap
info: [ADB STDOUT] INSTRUMENTATION_RESULT: shortMsg=java.lang.RuntimeException
info: [ADB STDOUT] INSTRUMENTATION_RESULT: longMsg=Didn't find class "io.appium.android.bootstrap.Bootstrap" on path: /system/framework/android.test.runner.jar:/system/framework/uiautomator.jar::/data/local/tmp/AppiumBootstrap.jar
info: [ADB STDOUT] INSTRUMENTATION_CODE: 0
error: ADB quit before it successfully launched

I fixed this by manually running this from inside the shell as superuser (I'm on a rooted phone). Then, when running the appium test I got a successful start of instrumentation:

info: [ADB STDOUT] INSTRUMENTATION_STATUS_CODE: 1

I have no idea why this worked. I had to run this from the command line again today. Any thoughts on this?

Again, thanks for your help.

Ethan.


On Sunday, August 4, 2013 10:33:23 AM UTC-7, bootstrap online wrote:

sai krishna

unread,
Oct 25, 2013, 2:04:14 PM10/25/13
to appium-...@googlegroups.com
Can you please tell me where and wat command you ran to solve this issue .. even i'm rooted device
Reply all
Reply to author
Forward
0 new messages