gpt4 book ai didi

java - 设置测试自动化框架 Selendroid 的问题

转载 作者:行者123 更新时间:2023-11-28 20:55:10 26 4
gpt4 key购买 nike

我在设置 Selendroid 服务器时遇到问题。当我运行命令时我收到以下错误:

C:\Users\mawal2\Downloads>java -jar selendroid-standalone-0.11.0-with-dependenci
es.jar -app selendroid-test-app-0.11.0.apk
################# Selendroid #################
################# Configuration in use #################
io.selendroid.SelendroidConfiguration@19469ea2[
port=4444
timeoutEmulatorStart=300000
supportedApps=[selendroid-test-app-0.11.0.apk]
verbose=false
emulatorPort=5560
deviceScreenshot=false
selendroidServerPort=8080
keystore=<null>
emulatorOptions=<null>
registrationUrl=<null>
proxy=<null>
serverHost=<null>
keepAdbAlive=false
noWebViewApp=false
noClearData=false
sessionTimeoutSeconds=1800
forceReinstall=false
logLevel=ERROR
]
Oct 16, 2014 7:57:24 AM io.selendroid.SelendroidLauncher launchServer
INFO: Starting selendroid-server port 4444
Oct 16, 2014 7:57:24 AM io.selendroid.io.ShellCommand exec
INFO: executing command: C:\Users\mawal2\Documents\android\adt-bundle-windows-x8
6_64-20140702\sdk\build-tools\android-4.4W\aapt.exe remove C:\Users\mawal2\Downl
oads\selendroid-test-app-0.11.0.apk META-INF/MANIFEST.MF
Oct 16, 2014 7:57:24 AM io.selendroid.io.ShellCommand exec
INFO: executing command: C:\Users\mawal2\Documents\android\adt-bundle-windows-x8
6_64-20140702\sdk\build-tools\android-4.4W\aapt.exe remove C:\Users\mawal2\Downl
oads\selendroid-test-app-0.11.0.apk META-INF/CERT.RSA
Oct 16, 2014 7:57:24 AM io.selendroid.io.ShellCommand exec
INFO: executing command: C:\Users\mawal2\Documents\android\adt-bundle-windows-x8
6_64-20140702\sdk\build-tools\android-4.4W\aapt.exe remove C:\Users\mawal2\Downl
oads\selendroid-test-app-0.11.0.apk META-INF/CERT.SF
Oct 16, 2014 7:57:24 AM io.selendroid.io.ShellCommand exec
INFO: executing command: C:\Users\mawal2\Documents\android\adt-bundle-windows-x8
6_64-20140702\sdk\build-tools\android-4.4W\aapt.exe remove C:\Users\mawal2\Downl
oads\selendroid-test-app-0.11.0.apk META-INF/ANDROIDD.SF
Oct 16, 2014 7:57:24 AM io.selendroid.io.ShellCommand exec
INFO: executing command: C:\Users\mawal2\Documents\android\adt-bundle-windows-x8
6_64-20140702\sdk\build-tools\android-4.4W\aapt.exe remove C:\Users\mawal2\Downl
oads\selendroid-test-app-0.11.0.apk META-INF/ANDROIDD.RSA
Oct 16, 2014 7:57:24 AM io.selendroid.io.ShellCommand exec
INFO: executing command: C:\Users\mawal2\Documents\android\adt-bundle-windows-x8
6_64-20140702\sdk\build-tools\android-4.4W\aapt.exe remove C:\Users\mawal2\Downl
oads\selendroid-test-app-0.11.0.apk META-INF/NDKEYSTO.SF
Oct 16, 2014 7:57:24 AM io.selendroid.io.ShellCommand exec
INFO: executing command: C:\Users\mawal2\Documents\android\adt-bundle-windows-x8
6_64-20140702\sdk\build-tools\android-4.4W\aapt.exe remove C:\Users\mawal2\Downl
oads\selendroid-test-app-0.11.0.apk META-INF/NDKEYSTO.RSA
Oct 16, 2014 7:57:24 AM io.selendroid.io.ShellCommand exec
INFO: executing command: C:\Program Files\Java\jdk1.8.0_20\bin\bin\jarsigner.exe
-sigalg MD5withRSA -digestalg SHA1 -signedjar C:\Users\mawal2\Downloads\resigne
d-selendroid-test-app-0.11.0.apk -storepass android -keystore C:\Users\mawal2\.a
ndroid\debug.keystore C:\Users\mawal2\Downloads\selendroid-test-app-0.11.0.apk a
ndroiddebugkey
Oct 16, 2014 7:57:24 AM io.selendroid.SelendroidLauncher launchServer
SEVERE: Error occurred while building server: An error occurred while resigning
the app 'selendroid-test-app-0.11.0.apk'.
io.selendroid.exceptions.SessionNotCreatedException: An error occurred while res
igning the app 'selendroid-test-app-0.11.0.apk'.
at io.selendroid.server.model.SelendroidStandaloneDriver.initApplication
sUnderTest(SelendroidStandaloneDriver.java:114)
at io.selendroid.server.model.SelendroidStandaloneDriver.<init>(Selendro
idStandaloneDriver.java:82)
at io.selendroid.server.SelendroidStandaloneServer.initializeSelendroidS
erver(SelendroidStandaloneServer.java:61)
at io.selendroid.server.SelendroidStandaloneServer.<init>(SelendroidStan
daloneServer.java:50)
at io.selendroid.SelendroidLauncher.launchServer(SelendroidLauncher.java
:49)
at io.selendroid.SelendroidLauncher.main(SelendroidLauncher.java:105)
Caused by: io.selendroid.exceptions.ShellCommandException: An error occured whil
e executing shell command: C:\Program Files\Java\jdk1.8.0_20\bin\bin\jarsigner.e
xe -sigalg MD5withRSA -digestalg SHA1 -signedjar C:\Users\mawal2\Downloads\resig
ned-selendroid-test-app-0.11.0.apk -storepass android -keystore C:\Users\mawal2\
.android\debug.keystore C:\Users\mawal2\Downloads\selendroid-test-app-0.11.0.apk
androiddebugkey
at io.selendroid.io.ShellCommand.exec(ShellCommand.java:49)
at io.selendroid.builder.SelendroidServerBuilder.signTestServer(Selendro
idServerBuilder.java:274)
at io.selendroid.builder.SelendroidServerBuilder.resignApp(SelendroidSer
verBuilder.java:134)
at io.selendroid.server.model.SelendroidStandaloneDriver.initApplication
sUnderTest(SelendroidStandaloneDriver.java:112)
... 5 more
Caused by: io.selendroid.exceptions.ShellCommandException:
... 9 more
Exception in thread "main" io.selendroid.exceptions.SessionNotCreatedException:
An error occurred while resigning the app 'selendroid-test-app-0.11.0.apk'.
at io.selendroid.server.model.SelendroidStandaloneDriver.initApplication
sUnderTest(SelendroidStandaloneDriver.java:114)
at io.selendroid.server.model.SelendroidStandaloneDriver.<init>(Selendro
idStandaloneDriver.java:82)
at io.selendroid.server.SelendroidStandaloneServer.initializeSelendroidS
erver(SelendroidStandaloneServer.java:61)
at io.selendroid.server.SelendroidStandaloneServer.<init>(SelendroidStan
daloneServer.java:50)
at io.selendroid.SelendroidLauncher.launchServer(SelendroidLauncher.java
:49)
at io.selendroid.SelendroidLauncher.main(SelendroidLauncher.java:105)
Caused by: io.selendroid.exceptions.ShellCommandException: An error occured whil
e executing shell command: C:\Program Files\Java\jdk1.8.0_20\bin\bin\jarsigner.e
xe -sigalg MD5withRSA -digestalg SHA1 -signedjar C:\Users\mawal2\Downloads\resig
ned-selendroid-test-app-0.11.0.apk -storepass android -keystore C:\Users\mawal2\
.android\debug.keystore C:\Users\mawal2\Downloads\selendroid-test-app-0.11.0.apk
androiddebugkey
at io.selendroid.io.ShellCommand.exec(ShellCommand.java:49)
at io.selendroid.builder.SelendroidServerBuilder.signTestServer(Selendro
idServerBuilder.java:274)
at io.selendroid.builder.SelendroidServerBuilder.resignApp(SelendroidSer
verBuilder.java:134)
at io.selendroid.server.model.SelendroidStandaloneDriver.initApplication
sUnderTest(SelendroidStandaloneDriver.java:112)
... 5 more
Caused by: io.selendroid.exceptions.ShellCommandException:
... 9 more

C:\Users\mawal2\Downloads>

我认为问题与 java 或 android 环境变量有关。我已经阅读了很多指南和论坛帖子并尝试了不同的方法,但我总是得到相同的结果。环境变量目前通过以下方式设置:在“用户变量”下:

  • ANDROID_HOME: C:\Users\mawal2\Documents\android\adt-bundle-windows-x86_64-20140702\sdk

  • JAVA_HOME: C:\Program Files\Java\jdk1.8.0_20\bin

在“系统变量”下:

  • 路径:%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Windows\CCM;C:\Program Files\OpenVPN\bin;C:\Users\mawal2\Documents\android\adt-bundle-windows-x86_64-20140702\sdk\tools\;C:\Users\mawal2\Documents\android\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\;C:\Program Files\Java\jdk1.8.0_20\bin\;

我的操作系统是 Windows 8.1 Enterprise

非常感谢我能得到的所有帮助!

最好的问候马格纳斯

最佳答案

发生错误时,我解决了这个问题
e 执行shell命令:C:\Program Files\Java\jdk1.8.0_20\bin\bin\jarsigner.e
xe

有 bin\bin 一个接一个,这是不正确的。通过将 Java home 变量更改为:JAVA_HOME: C:\Program Files\Java\jdk1.8.0_20\

我还注意到,对我来说,变量更改只有在重新启动计算机后才能完成,这可能是之前未能解决的原因。

关于java - 设置测试自动化框架 Selendroid 的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26398086/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com