SelendroidException:未找到任何Android虚拟设备

时间:2015-01-14 18:41:56

标签: selendroid avd

我正在尝试在我的系统中设置Selendroid。我已经设置了ANDROID_HOME,JAVA_HOME并安装了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 #################
io.selendroid.SelendroidConfiguration@12c9b19[
  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 #################
io.selendroid.SelendroidConfiguration@12c9b19[
  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

请帮助解决问题!!感谢

1 个答案:

答案 0 :(得分:0)

查看http://selendroid.io/setup.html部分“使用仿真器”。