2015-01-14 237 views
0

我想在我的系統中安裝Selendroid。我設置了ANDROID_HOME,JAVA_HOME並安裝了android虛擬設備。SelendroidException:沒有找到android虛擬設備

C:\Users\sai>echo %ANDROID_HOME% 
C:\Android\android-sdk 

C:\Users\sai>echo %JAVA_HOME% 
C:\Java\jdk1.6.0_26 

C:\Android\android-sdk\tools>android.bat list avds 
Available Android Virtual Devices: 
    Name: SelendroidAVD 
    Device: Nexus S (Google) 
    Path: C:\Users\sai\.android\avd\SelendroidAVD.avd 
    Target: Android 2.3.3 (API level 10) 
Tag/ABI: default/armeabi 
    Skin: 480x800 

當我試圖用下面的命令啓動服務器時,我得到一個Selendroid異常。

java -jar selendroid-standalone-0.12.0-with-dependencies.jar -aut selendroid 
-test-app-0.12.0.apk 

該apk文件安裝成功,但Android AVD無法識別並且拋出以下異常。

io.selendroid.exceptions.SelendroidException: No android virtu 
al devices were found. Please start the android tool and create emulators and re 
start the selendroid-standalone or plugin an Android hardware device via USB. 
selendroid-standalone server has been started on port: 4444 

完整的logcat:

F:\>java -jar selendroid-standalone-0.12.0-with-dependencies.jar -aut selendroid 
-test-app-0.12.0.apk 
################# Selendroid ################# 
################# Configuration in use ################# 
[email protected][ 
    port=4444 
    timeoutEmulatorStart=300000 
    supportedApps=[selendroid-test-app-0.12.0.apk] 
    verbose=false 
    emulatorPort=5560 
    deviceScreenshot=false 
    selendroidServerPort=8080 
    keystore=<null> 
    keystorePassword=<null> 
    keystoreAlias=<null> 
    emulatorOptions=<null> 
    registrationUrl=<null> 
    proxy=<null> 
    serverHost=<null> 
    keepAdbAlive=false 
    noWebViewApp=false 
    noClearData=false 
    sessionTimeoutSeconds=1800 
    forceReinstall=false 
    logLevel=ERROR 
    deviceLog=true 
    serverStartTimeout=20000 
    printHelp=false 
] 
Jan 14, 2015 11:54:11 PM io.selendroid.SelendroidLauncher launchServer 
INFO: Starting selendroid-server port 4444 
Jan 14, 2015 11:54:11 PM io.selendroid.io.ShellCommand exec 
INFO: executing command: C:\Android\android-sdk\build-tools\21.1.2\aapt.exe remo 
ve F:\\selendroid-test-app-0.12.0.apk META-INF/MANIFEST.MF 
Jan 14, 2015 11:54:11 PM io.selendroid.io.ShellCommand exec 
INFO: executing command: C:\Android\android-sdk\build-tools\21.1.2\aapt.exe remo 
ve F:\\selendroid-test-app-0.12.0.apk META-INF/CERT.RSA 
Jan 14, 2015 11:54:11 PM io.selendroid.io.ShellCommand exec 
INFO: executing command: C:\Android\android-sdk\build-tools\21.1.2\aapt.exe remo 
ve F:\\selendroid-test-app-0.12.0.apk META-INF/CERT.SF 
Jan 14, 2015 11:54:11 PM io.selendroid.io.ShellCommand exec 
INFO: executing command: C:\Android\android-sdk\build-tools\21.1.2\aapt.exe remo 
ve F:\\selendroid-test-app-0.12.0.apk META-INF/ANDROIDD.SF 
Jan 14, 2015 11:54:11 PM io.selendroid.io.ShellCommand exec 
INFO: executing command: C:\Android\android-sdk\build-tools\21.1.2\aapt.exe remo 
ve F:\\selendroid-test-app-0.12.0.apk META-INF/ANDROIDD.RSA 
Jan 14, 2015 11:54:11 PM io.selendroid.io.ShellCommand exec 
INFO: executing command: C:\Android\android-sdk\build-tools\21.1.2\aapt.exe remo 
ve F:\\selendroid-test-app-0.12.0.apk META-INF/NDKEYSTO.SF 
Jan 14, 2015 11:54:11 PM io.selendroid.io.ShellCommand exec 
INFO: executing command: C:\Android\android-sdk\build-tools\21.1.2\aapt.exe remo 
ve F:\\selendroid-test-app-0.12.0.apk META-INF/NDKEYSTO.RSA 
Jan 14, 2015 11:54:11 PM io.selendroid.io.ShellCommand exec 
INFO: executing command: C:\Java\jdk1.6.0_26\bin\jarsigner.exe -sigalg MD5withRS 
A -digestalg SHA1 -signedjar F:\\resigned-selendroid-test-app-0.12.0.apk -storep 
ass android -keystore C:\Users\sai\.android\debug.keystore F:\\selendroid-test-a 
pp-0.12.0.apk androiddebugkey 
Jan 14, 2015 11:54:14 PM io.selendroid.builder.SelendroidServerBuilder signTestS 
erver 
INFO: App signing output: 
Jan 14, 2015 11:54:14 PM io.selendroid.builder.SelendroidServerBuilder signTestS 
erver 
INFO: The app has been signed: F:\\resigned-selendroid-test-app-0.12.0.apk 
Jan 14, 2015 11:54:14 PM io.selendroid.io.ShellCommand exec 
INFO: executing command: C:\Android\android-sdk\build-tools\21.1.2\aapt.exe dump 
badging F:\\resigned-selendroid-test-app-0.12.0.apk 
Jan 14, 2015 11:54:14 PM io.selendroid.io.ShellCommand exec 
INFO: executing command: C:\Android\android-sdk\build-tools\21.1.2\aapt.exe dump 
badging F:\\resigned-selendroid-test-app-0.12.0.apk 
Jan 14, 2015 11:54:14 PM io.selendroid.server.model.SelendroidStandaloneDriver i 
nitApplicationsUnderTest 
INFO: App io.selendroid.testapp:0.12.0 has been added to selendroid standalone s 
erver. 
Jan 14, 2015 11:54:14 PM io.selendroid.io.ShellCommand exec 
INFO: executing command: C:\Android\android-sdk\build-tools\21.1.2\aapt.exe remo 
ve C:\Users\sai\AppData\Local\Temp\android-driver8494728849163801343.apk META-IN 
F/MANIFEST.MF 
Jan 14, 2015 11:54:14 PM io.selendroid.io.ShellCommand exec 
INFO: executing command: C:\Android\android-sdk\build-tools\21.1.2\aapt.exe remo 
ve C:\Users\sai\AppData\Local\Temp\android-driver8494728849163801343.apk META-IN 
F/CERT.RSA 
Jan 14, 2015 11:54:14 PM io.selendroid.io.ShellCommand exec 
INFO: executing command: C:\Android\android-sdk\build-tools\21.1.2\aapt.exe remo 
ve C:\Users\sai\AppData\Local\Temp\android-driver8494728849163801343.apk META-IN 
F/CERT.SF 
Jan 14, 2015 11:54:14 PM io.selendroid.io.ShellCommand exec 
INFO: executing command: C:\Android\android-sdk\build-tools\21.1.2\aapt.exe remo 
ve C:\Users\sai\AppData\Local\Temp\android-driver8494728849163801343.apk META-IN 
F/ANDROIDD.SF 
Jan 14, 2015 11:54:14 PM io.selendroid.io.ShellCommand exec 
INFO: executing command: C:\Android\android-sdk\build-tools\21.1.2\aapt.exe remo 
ve C:\Users\sai\AppData\Local\Temp\android-driver8494728849163801343.apk META-IN 
F/ANDROIDD.RSA 
Jan 14, 2015 11:54:14 PM io.selendroid.io.ShellCommand exec 
INFO: executing command: C:\Android\android-sdk\build-tools\21.1.2\aapt.exe remo 
ve C:\Users\sai\AppData\Local\Temp\android-driver8494728849163801343.apk META-IN 
F/NDKEYSTO.SF 
Jan 14, 2015 11:54:14 PM io.selendroid.io.ShellCommand exec 
INFO: executing command: C:\Android\android-sdk\build-tools\21.1.2\aapt.exe remo 
ve C:\Users\sai\AppData\Local\Temp\android-driver8494728849163801343.apk META-IN 
F/NDKEYSTO.RSA 
Jan 14, 2015 11:54:14 PM io.selendroid.io.ShellCommand exec 
INFO: executing command: C:\Java\jdk1.6.0_26\bin\jarsigner.exe -sigalg MD5withRS 
A -digestalg SHA1 -signedjar C:\Users\sai\AppData\Local\Temp\resigned-android-dr 
iver8494728849163801343.apk -storepass android -keystore C:\Users\sai\.android\d 
ebug.keystore C:\Users\sai\AppData\Local\Temp\android-driver8494728849163801343. 
apk androiddebugkey 
Jan 14, 2015 11:54:15 PM io.selendroid.builder.SelendroidServerBuilder signTestS 
erver 
INFO: App signing output: 
Jan 14, 2015 11:54:15 PM io.selendroid.builder.SelendroidServerBuilder signTestS 
erver 
INFO: The app has been signed: C:\Users\sai\AppData\Local\Temp\resigned-android- 
driver8494728849163801343.apk 
Jan 14, 2015 11:54:17 PM io.selendroid.io.ShellCommand exec 
INFO: executing command: C:\Android\android-sdk\tools\android.bat list avds 
Jan 14, 2015 11:54:21 PM io.selendroid.io.ShellCommand exec 
INFO: executing command: C:\Android\android-sdk\platform-tools\adb.exe devices 
Jan 14, 2015 11:54:21 PM io.selendroid.server.model.DeviceStore addEmulators 
INFO: No emulators has been found. 
Jan 14, 2015 11:54:21 PM io.selendroid.server.model.DeviceStore initAndroidDevic 
es 
WARNING: Warning: io.selendroid.exceptions.SelendroidException: No android virtu 
al devices were found. Please start the android tool and create emulators and re 
start the selendroid-standalone or plugin an Android hardware device via USB. 
selendroid-standalone server has been started on port: 4444 












F:\>java -jar selendroid-standalone-0.12.0-with-dependencies.jar -aut selendroid 
-test-app-0.12.0.apk 
################# Selendroid ################# 
################# Configuration in use ################# 
[email protected][ 
    port=4444 
    timeoutEmulatorStart=300000 
    supportedApps=[selendroid-test-app-0.12.0.apk] 
    verbose=false 
    emulatorPort=5560 
    deviceScreenshot=false 
    selendroidServerPort=8080 
    keystore=<null> 
    keystorePassword=<null> 
    keystoreAlias=<null> 
    emulatorOptions=<null> 
    registrationUrl=<null> 
    proxy=<null> 
    serverHost=<null> 
    keepAdbAlive=false 
    noWebViewApp=false 
    noClearData=false 
    sessionTimeoutSeconds=1800 
    forceReinstall=false 
    logLevel=ERROR 
    deviceLog=true 
    serverStartTimeout=20000 
    printHelp=false 
] 
Jan 14, 2015 11:54:11 PM io.selendroid.SelendroidLauncher launchServer 
INFO: Starting selendroid-server port 4444 
Jan 14, 2015 11:54:11 PM io.selendroid.io.ShellCommand exec 
INFO: executing command: C:\Android\android-sdk\build-tools\21.1.2\aapt.exe remo 
ve F:\\selendroid-test-app-0.12.0.apk META-INF/MANIFEST.MF 
Jan 14, 2015 11:54:11 PM io.selendroid.io.ShellCommand exec 
INFO: executing command: C:\Android\android-sdk\build-tools\21.1.2\aapt.exe remo 
ve F:\\selendroid-test-app-0.12.0.apk META-INF/CERT.RSA 
Jan 14, 2015 11:54:11 PM io.selendroid.io.ShellCommand exec 
INFO: executing command: C:\Android\android-sdk\build-tools\21.1.2\aapt.exe remo 
ve F:\\selendroid-test-app-0.12.0.apk META-INF/CERT.SF 
Jan 14, 2015 11:54:11 PM io.selendroid.io.ShellCommand exec 
INFO: executing command: C:\Android\android-sdk\build-tools\21.1.2\aapt.exe remo 
ve F:\\selendroid-test-app-0.12.0.apk META-INF/ANDROIDD.SF 
Jan 14, 2015 11:54:11 PM io.selendroid.io.ShellCommand exec 
INFO: executing command: C:\Android\android-sdk\build-tools\21.1.2\aapt.exe remo 
ve F:\\selendroid-test-app-0.12.0.apk META-INF/ANDROIDD.RSA 
Jan 14, 2015 11:54:11 PM io.selendroid.io.ShellCommand exec 
INFO: executing command: C:\Android\android-sdk\build-tools\21.1.2\aapt.exe remo 
ve F:\\selendroid-test-app-0.12.0.apk META-INF/NDKEYSTO.SF 
Jan 14, 2015 11:54:11 PM io.selendroid.io.ShellCommand exec 
INFO: executing command: C:\Android\android-sdk\build-tools\21.1.2\aapt.exe remo 
ve F:\\selendroid-test-app-0.12.0.apk META-INF/NDKEYSTO.RSA 
Jan 14, 2015 11:54:11 PM io.selendroid.io.ShellCommand exec 
INFO: executing command: C:\Java\jdk1.6.0_26\bin\jarsigner.exe -sigalg MD5withRS 
A -digestalg SHA1 -signedjar F:\\resigned-selendroid-test-app-0.12.0.apk -storep 
ass android -keystore C:\Users\sai\.android\debug.keystore F:\\selendroid-test-a 
pp-0.12.0.apk androiddebugkey 
Jan 14, 2015 11:54:14 PM io.selendroid.builder.SelendroidServerBuilder signTestS 
erver 
INFO: App signing output: 
Jan 14, 2015 11:54:14 PM io.selendroid.builder.SelendroidServerBuilder signTestS 
erver 
INFO: The app has been signed: F:\\resigned-selendroid-test-app-0.12.0.apk 
Jan 14, 2015 11:54:14 PM io.selendroid.io.ShellCommand exec 
INFO: executing command: C:\Android\android-sdk\build-tools\21.1.2\aapt.exe dump 
badging F:\\resigned-selendroid-test-app-0.12.0.apk 
Jan 14, 2015 11:54:14 PM io.selendroid.io.ShellCommand exec 
INFO: executing command: C:\Android\android-sdk\build-tools\21.1.2\aapt.exe dump 
badging F:\\resigned-selendroid-test-app-0.12.0.apk 
Jan 14, 2015 11:54:14 PM io.selendroid.server.model.SelendroidStandaloneDriver i 
nitApplicationsUnderTest 
INFO: App io.selendroid.testapp:0.12.0 has been added to selendroid standalone s 
erver. 
Jan 14, 2015 11:54:14 PM io.selendroid.io.ShellCommand exec 
INFO: executing command: C:\Android\android-sdk\build-tools\21.1.2\aapt.exe remo 
ve C:\Users\sai\AppData\Local\Temp\android-driver8494728849163801343.apk META-IN 
F/MANIFEST.MF 
Jan 14, 2015 11:54:14 PM io.selendroid.io.ShellCommand exec 
INFO: executing command: C:\Android\android-sdk\build-tools\21.1.2\aapt.exe remo 
ve C:\Users\sai\AppData\Local\Temp\android-driver8494728849163801343.apk META-IN 
F/CERT.RSA 
Jan 14, 2015 11:54:14 PM io.selendroid.io.ShellCommand exec 
INFO: executing command: C:\Android\android-sdk\build-tools\21.1.2\aapt.exe remo 
ve C:\Users\sai\AppData\Local\Temp\android-driver8494728849163801343.apk META-IN 
F/CERT.SF 
Jan 14, 2015 11:54:14 PM io.selendroid.io.ShellCommand exec 
INFO: executing command: C:\Android\android-sdk\build-tools\21.1.2\aapt.exe remo 
ve C:\Users\sai\AppData\Local\Temp\android-driver8494728849163801343.apk META-IN 
F/ANDROIDD.SF 
Jan 14, 2015 11:54:14 PM io.selendroid.io.ShellCommand exec 
INFO: executing command: C:\Android\android-sdk\build-tools\21.1.2\aapt.exe remo 
ve C:\Users\sai\AppData\Local\Temp\android-driver8494728849163801343.apk META-IN 
F/ANDROIDD.RSA 
Jan 14, 2015 11:54:14 PM io.selendroid.io.ShellCommand exec 
INFO: executing command: C:\Android\android-sdk\build-tools\21.1.2\aapt.exe remo 
ve C:\Users\sai\AppData\Local\Temp\android-driver8494728849163801343.apk META-IN 
F/NDKEYSTO.SF 
Jan 14, 2015 11:54:14 PM io.selendroid.io.ShellCommand exec 
INFO: executing command: C:\Android\android-sdk\build-tools\21.1.2\aapt.exe remo 
ve C:\Users\sai\AppData\Local\Temp\android-driver8494728849163801343.apk META-IN 
F/NDKEYSTO.RSA 
Jan 14, 2015 11:54:14 PM io.selendroid.io.ShellCommand exec 
INFO: executing command: C:\Java\jdk1.6.0_26\bin\jarsigner.exe -sigalg MD5withRS 
A -digestalg SHA1 -signedjar C:\Users\sai\AppData\Local\Temp\resigned-android-dr 
iver8494728849163801343.apk -storepass android -keystore C:\Users\sai\.android\d 
ebug.keystore C:\Users\sai\AppData\Local\Temp\android-driver8494728849163801343. 
apk androiddebugkey 
Jan 14, 2015 11:54:15 PM io.selendroid.builder.SelendroidServerBuilder signTestS 
erver 
INFO: App signing output: 
Jan 14, 2015 11:54:15 PM io.selendroid.builder.SelendroidServerBuilder signTestS 
erver 
INFO: The app has been signed: C:\Users\sai\AppData\Local\Temp\resigned-android- 
driver8494728849163801343.apk 
Jan 14, 2015 11:54:17 PM io.selendroid.io.ShellCommand exec 
INFO: executing command: C:\Android\android-sdk\tools\android.bat list avds 
Jan 14, 2015 11:54:21 PM io.selendroid.io.ShellCommand exec 
INFO: executing command: C:\Android\android-sdk\platform-tools\adb.exe devices 
Jan 14, 2015 11:54:21 PM io.selendroid.server.model.DeviceStore addEmulators 
INFO: No emulators has been found. 
Jan 14, 2015 11:54:21 PM io.selendroid.server.model.DeviceStore initAndroidDevic 
es 
WARNING: Warning: io.selendroid.exceptions.SelendroidException: No android virtu 
al devices were found. Please start the android tool and create emulators and re 
start the selendroid-standalone or plugin an Android hardware device via USB. 
selendroid-standalone server has been started on port: 4444 

請在解決問題幫助!謝謝

回答