看着使用Selendroid自動化我們的Android設備測試。由於我只是在研究階段,我正在使用從他們的網站下載的selendroid-test-app。Selendroid服務器無法啓動設備:權限拒絕:啓動儀器
我最近買了一臺新機器。我的代碼和安裝在前一個上工作得很好。
我JAVA_HOME設置爲:C:\Program Files\Java\jdk1.8.0_45
我ANDROID_HOME是C:\Program Files (x86)\Android\android-sdk
我在本地目錄在控制檯中運行以下命令來啓動selendroid獨立:
java -jar selendroid-standalone-0.15.0-with-dependencies.jar -app selendroid-test-app-0.15.0.apk
這簽署APK罰款:
INFO: Executing shell command: C:\Program Files\Java\jdk1.8.0_45\bin\jarsigner.exe -sigalg MD5withRSA -digestalg SHA1 -signedjar c:\SeleniumDrivers\resigned-selendroid-test-app-0.15.0.apk -storepass android -keystore C:\Users\rekab\.android\debug.keystore c:\SeleniumDrivers\selendroid-test-app-0.15.0.apk androiddebugkey
Jun 12, 2015 8:16:14 AM io.selendroid.standalone.io.ShellCommand exec
INFO: Shell command output
-->
jar signed.
然後,我開始從Visual Studio測試(C#):
DesiredCapabilities caps = DesiredCapabilities.Android();
caps.SetCapability("browserName", "selendroid");
caps.SetCapability("aut", "io.selendroid.testapp:0.15.0");
TouchCapableRemoteWebDriver driver = new TouchCapableRemoteWebDriver(new Uri("http://localhost:4444/wd/hub"), caps);
TouchCapableRemoteWebDriver是圍繞RemoteWebDriver的包裝實施IHasTouchScreen。
當越來越創建的驅動程序,selendroid試驗應用程序被安裝在手機罰款:
INFO: Executing shell command: C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe -s FA34HW903620 install -r c:\SeleniumDrivers\resigned-selendroid-test-app-0.15.0.apk
Jun 12, 2015 8:17:52 AM io.selendroid.standalone.io.ShellCommand exec
INFO: Shell command output
-->
pkg: /data/local/tmp/resigned-selendroid-test-app-0.15.0.apk
Success
rm failed for -f, No such file or directory
3560 KB/s (511417 bytes in 0.140s)
<--
Jun 12, 2015 8:17:53 AM io.selendroid.standalone.io.ShellCommand exec
INFO: Executing shell command: C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe -s FA34HW903620 shell pm list packages io.selendroid.io.selendroid.testapp
Jun 12, 2015 8:17:54 AM io.selendroid.standalone.io.ShellCommand exec
INFO: Shell command output
-->
package:io.selendroid.io.selendroid.testapp
<--
然而,當它到達啓動儀器我得到一個異常:
INFO: Executing shell command: C:\Program Files (x86)\Android\android-sdk\platform-tools\adb.exe -s FA34HW903620 shell am instrument -e main_activity io.selendroid.testapp.HomeScreenActivity -e server_port 8080 io.selendroid.io.selendroid.testapp/io.selendroid.server.ServerInstrumentation
Jun 12, 2015 8:17:55 AM io.selendroid.standalone.io.ShellCommand exec
INFO: Shell command output
-->
java.lang.SecurityException: Permission Denial: starting instrumentation ComponentInfo{io.selendroid.io.selendroid.testapp/io.selendroid.server.ServerInstrumentation} from pid=26099, uid=26099 not allowed because package io.selendroid.io.selendroid.testapp does not have a signature matching the target io.selendroid.testapp
at android.os.Parcel.readException(Parcel.java:1430)
at android.os.Parcel.readException(Parcel.java:1384)
at android.app.ActivityManagerProxy.startInstrumentation(ActivityManagerNative.java:2839)
at com.android.commands.am.Am.runInstrument(Am.java:615)
at com.android.commands.am.Am.run(Am.java:118)
at com.android.commands.am.Am.main(Am.java:81)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:257)
at dalvik.system.NativeStart.main(Native Method)
<--
顯然,測試無法啓動。出了什麼問題?即使使用新機器,這個問題也一直在進行,直到我從手機中卸載應用並再次運行測試。它現在被重新安裝,但手機上的服務器無法啓動?
感謝您的幫助!