selendroid: Error occurred while starting selendroid-server on the device
Afternoon,
I have been attempting to get Selendroid to work with our own APK after successfully getting it to work with the selendroid-test-app through Eclipse.
At one point today I managed to get it to actually install the app onto the phone but then it would error. Since that point I have experimented some more and cannot seem to even get it that far.
The log from the selendroid server after the server has started is as follows:
May 28, 2014 3:06:18 PM io.selendroid.server.handler.CreateSessionHandler handle
INFO: new session command with capabilities: {"desiredCapabilities": {
"aut": "com.qtx.mtk:1.1",
"emulator": false
}}
May 28, 2014 3:06:18 PM io.selendroid.server.model.DeviceStore findAndroidDevice
INFO: Evaluating if this device is a match for this session: HardwareDevice [serial=04dbf5f15bdc44e7, model=Nexus 4, targetVersion=ANDROID19]
May 28, 2014 3:06:18 PM io.selendroid.io.ShellCommand exec
INFO: executing command: /Users/ak/Testing/adt-bundle-mac-x86_64-20140321/sdk/platform-tools/adb -s 04dbf5f15bdc44e7 shell pm list packages com.qtx.mtk
May 28, 2014 3:06:18 PM io.selendroid.io.ShellCommand exec
INFO: executing command: /Users/ak/Testing/adt-bundle-mac-x86_64-20140321/sdk/platform-tools/adb -s 04dbf5f15bdc44e7 install -r /Users/ak/Testing/Selendroid/resigned-qtx.apk
May 28, 2014 3:06:24 PM io.selendroid.io.ShellCommand exec
INFO: executing command: /Users/ak/Testing/adt-bundle-mac-x86_64-20140321/sdk/platform-tools/adb -s 04dbf5f15bdc44e7 shell pm list packages io.selendroid.com.qtx.mtk
May 28, 2014 3:06:25 PM io.selendroid.builder.SelendroidServerBuilder createSelendroidServer
INFO: create SelendroidServer for apk: /Users/ak/Testing/Selendroid/resigned-qtx.apk
May 28, 2014 3:06:25 PM io.selendroid.builder.SelendroidServerBuilder init
INFO: Creating customized Selendroid-server: /var/folders/ht/3rht99vn7bx7rbhqs0hnbrrw0000gn/T/selendroid-server5102260972452353625.apk
May 28, 2014 3:06:25 PM io.selendroid.io.ShellCommand exec
INFO: executing command: /Users/ak/Testing/adt-bundle-mac-x86_64-20140321/sdk/build-tools/android-4.4.2/aapt remove /var/folders/ht/3rht99vn7bx7rbhqs0hnbrrw0000gn/T/selendroid-server5102260972452353625.apk META-INF/CERT.RSA
May 28, 2014 3:06:25 PM io.selendroid.io.ShellCommand exec
INFO: executing command: /Users/ak/Testing/adt-bundle-mac-x86_64-20140321/sdk/build-tools/android-4.4.2/aapt remove /var/folders/ht/3rht99vn7bx7rbhqs0hnbrrw0000gn/T/selendroid-server5102260972452353625.apk META-INF/CERT.SF
May 28, 2014 3:06:25 PM io.selendroid.io.ShellCommand exec
INFO: executing command: /Users/ak/Testing/adt-bundle-mac-x86_64-20140321/sdk/build-tools/android-4.4.2/aapt remove /var/folders/ht/3rht99vn7bx7rbhqs0hnbrrw0000gn/T/selendroid-server5102260972452353625.apk AndroidManifest.xml
May 28, 2014 3:06:25 PM io.selendroid.builder.SelendroidServerBuilder createAndAddCustomizedAndroidManifestToSelendroidServer
INFO: Adding target package 'com.qtx.mtk' to /var/folders/ht/3rht99vn7bx7rbhqs0hnbrrw0000gn/T/com.qtx.mtk1401285985772/AndroidManifest.xml
May 28, 2014 3:06:25 PM io.selendroid.builder.SelendroidServerBuilder createAndAddCustomizedAndroidManifestToSelendroidServer
INFO: Final Manifest File:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="0.10.0" package="io.selendroid.com.qtx.mtk">
<uses-sdk android:minSdkVersion="10"/>
<instrumentation android:name="io.selendroid.ServerInstrumentation" android:targetPackage="io.selendroid.testapp"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.ACCESS_MOCK_LOCATION"/>
<uses-permission android:name="android.permission.INJECT_EVENTS"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<application android:debuggable="true" android:icon="@drawable/selenium_icon" android:label="Selendroid">
<uses-library android:name="android.test.runner"/>
</application>
</manifest>
May 28, 2014 3:06:25 PM io.selendroid.io.ShellCommand exec
INFO: executing command: /Users/ak/Testing/adt-bundle-mac-x86_64-20140321/sdk/build-tools/android-4.4.2/aapt package -M /var/folders/ht/3rht99vn7bx7rbhqs0hnbrrw0000gn/T/com.qtx.mtk1401285985772/AndroidManifest.xml -I /Users/ak/Testing/adt-bundle-mac-x86_64-20140321/sdk/platforms/android-19/android.jar -F /var/folders/ht/3rht99vn7bx7rbhqs0hnbrrw0000gn/T/com.qtx.mtk1401285985772/manifest.apk -f
May 28, 2014 3:06:25 PM io.selendroid.builder.SelendroidServerBuilder createAndAddCustomizedAndroidManifestToSelendroidServer
INFO:
May 28, 2014 3:06:26 PM io.selendroid.builder.SelendroidServerBuilder createAndAddCustomizedAndroidManifestToSelendroidServer
INFO: file: /var/folders/ht/3rht99vn7bx7rbhqs0hnbrrw0000gn/T/com.qtx.mtk1401285985772selendroid-server.apk
May 28, 2014 3:06:26 PM io.selendroid.io.ShellCommand exec
INFO: executing command: /Library/Java/JavaVirtualMachines/jdk1.7.0_55.jdk/Contents/Home/bin/jarsigner -sigalg MD5withRSA -digestalg SHA1 -signedjar /var/folders/ht/3rht99vn7bx7rbhqs0hnbrrw0000gn/T/selendroid-server-com.qtx.mtk-0.10.0.apk -storepass android -keystore /Users/ak/.android/debug.keystore /var/folders/ht/3rht99vn7bx7rbhqs0hnbrrw0000gn/T/com.qtx.mtk1401285985772selendroid-server.apk androiddebugkey
May 28, 2014 3:06:26 PM io.selendroid.builder.SelendroidServerBuilder signTestServer
INFO: App signing output: jar signed.
Warning:
No -tsa or -tsacert is provided and this jar is not timestamped. Without a timestamp, users may not be able to validate this jar after the signer certificate's expiration date (2041-08-22) or after any future revocation date.
May 28, 2014 3:06:26 PM io.selendroid.builder.SelendroidServerBuilder signTestServer
INFO: The app has been signed: /var/folders/ht/3rht99vn7bx7rbhqs0hnbrrw0000gn/T/selendroid-server-com.qtx.mtk-0.10.0.apk
May 28, 2014 3:06:26 PM io.selendroid.io.ShellCommand exec
INFO: executing command: /Users/ak/Testing/adt-bundle-mac-x86_64-20140321/sdk/platform-tools/adb -s 04dbf5f15bdc44e7 install -r /var/folders/ht/3rht99vn7bx7rbhqs0hnbrrw0000gn/T/selendroid-server-com.qtx.mtk-0.10.0.apk
running command: adb shell setprop log.tag.SELENDROID ERROR
May 28, 2014 3:06:30 PM io.selendroid.io.ShellCommand exec
INFO: executing command: /Users/ak/Testing/adt-bundle-mac-x86_64-20140321/sdk/platform-tools/adb -s 04dbf5f15bdc44e7 shell setprop log.tag.SELENDROID ERROR
May 28, 2014 3:06:30 PM io.selendroid.io.ShellCommand exec
INFO: executing command: /Users/ak/Testing/adt-bundle-mac-x86_64-20140321/sdk/platform-tools/adb -s 04dbf5f15bdc44e7 shell am instrument -e main_activity qtx.mtk.droid.SplashScreen -e server_port 8080 io.selendroid.com.qtx.mtk/io.selendroid.ServerInstrumentation
May 28, 2014 3:06:30 PM io.selendroid.io.ShellCommand exec
INFO: executing command: /Users/ak/Testing/adt-bundle-mac-x86_64-20140321/sdk/platform-tools/adb -s 04dbf5f15bdc44e7 shell am instrument -w -e main_activity qtx.mtk.droid.SplashScreen -e server_port 8080 io.selendroid.com.qtx.mtk/io.selendroid.ServerInstrumentation
May 28, 2014 3:06:31 PM io.selendroid.server.handler.CreateSessionHandler handle
SEVERE: Error while creating new session: Error occurred while starting selendroid-server on the device
io.selendroid.exceptions.SelendroidException: Error occurred while starting selendroid-server on the device
at io.selendroid.android.impl.AbstractDevice.startSelendroid(AbstractDevice.java:235)
at io.selendroid.server.model.SelendroidStandaloneDriver.createNewTestSession(SelendroidStandaloneDriver.java:290)
at io.selendroid.server.handler.CreateSessionHandler.handle(CreateSessionHandler.java:42)
at io.selendroid.server.SelendroidServlet.handleRequest(SelendroidServlet.java:142)
at io.selendroid.server.BaseServlet.handleHttpRequest(BaseServlet.java:70)
at org.webbitserver.netty.NettyHttpControl.nextHandler(NettyHttpControl.java:78)
at org.webbitserver.netty.NettyHttpControl.nextHandler(NettyHttpControl.java:62)
at org.webbitserver.handler.PathMatchHandler.handleHttpRequest(PathMatchHandler.java:33)
at org.webbitserver.netty.NettyHttpControl.nextHandler(NettyHttpControl.java:78)
at org.webbitserver.netty.NettyHttpControl.nextHandler(NettyHttpControl.java:62)
at org.webbitserver.handler.DateHeaderHandler.handleHttpRequest(DateHeaderHandler.java:21)
at org.webbitserver.netty.NettyHttpControl.nextHandler(NettyHttpControl.java:78)
at org.webbitserver.netty.NettyHttpControl.nextHandler(NettyHttpControl.java:62)
at org.webbitserver.handler.ServerHeaderHandler.handleHttpRequest(ServerHeaderHandler.java:25)
at org.webbitserver.netty.NettyHttpControl.nextHandler(NettyHttpControl.java:78)
at org.webbitserver.netty.NettyHttpControl.nextHandler(NettyHttpControl.java:67)
at org.webbitserver.netty.NettyHttpChannelHandler$2.run(NettyHttpChannelHandler.java:72)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.Throwable: android.util.AndroidException: INSTRUMENTATION_FAILED: io.selendroid.com.qtx.mtk/io.selendroid.ServerInstrumentation
at com.android.commands.am.Am.runInstrument(Am.java:865)
at com.android.commands.am.Am.onRun(Am.java:282)
at com.android.internal.os.BaseCommand.run(BaseCommand.java:47)
at com.android.commands.am.Am.main(Am.java:76)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:243)
at dalvik.system.NativeStart.main(Native Method)
Details:
INSTRUMENTATION_STATUS: id=ActivityManagerService
INSTRUMENTATION_STATUS: Error=Unable to find instrumentation target package: com.qtx.mtk
INSTRUMENTATION_STATUS_CODE: -1
android.util.AndroidException: INSTRUMENTATION_FAILED: io.selendroid.com.qtx.mtk/io.selendroid.ServerInstrumentation
at com.android.commands.am.Am.runInstrument(Am.java:865)
at com.android.commands.am.Am.onRun(Am.java:282)
at com.android.internal.os.BaseCommand.run(BaseCommand.java:47)
at com.android.commands.am.Am.main(Am.java:76)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:243)
at dalvik.system.NativeStart.main(Native Method)
... 20 more
At the same time I have been tailing the logcat output and the first sign of trouble appears to happen when I see:
W/ActivityManager( 638): No content provider found for permission revoke: file:///data/local/tmp/resigned-qtx.apk
Let me know what I could be missing here to get this moving forward.
Thanks!
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Comments: 22 (7 by maintainers)
The important thing about the app under test and the selendroid server is that both are signed with the same certificate. Our suggestion is to uninstall manually the app from the device/emulator and let selendroid-standalone resign and install the app.
This is needed because we are using the android instrumentation framework and therefore the app under test and the selendroid server must be signed with the same certificate (security reasons).
Please use this approach first to verify that selendroid is working fine in general with your app.
If that was successfull the suggestion is to start the selendroid-standalone with the flag
-keystoreand define the path to the keytore file that has been used to sign the app via your default build process. Afterwards install manually you app on the device and start the selendroid-standalone and a test session. What will happen is that a new selendroid-server will be created (it contains the target package of your app and is signed with the certificate you privided), it will be installed on the device and it will also be automatically identified that the app under test is already installed. Then the test session can start.But as I said, please verify first via the default mechanism that everything works fine. Currently it seems like we have e.g. issues starting Xamarin apps.
Please reopen if my explanation had not solved your issue.