2013-12-17 1 views
1

Невозможно запустить код на эмуляторе/устройстве. В Appium нет устройств, но cmd перечисляет устройства.Appium не может найти Android-эмулятор/устройство, не в состоянии запустить код

Консоль node.js дает:

info: Welcome to Appium v0.12.0 (REV a9d21807874190ae6d19f8251375cfe4da7b2ae5) 

info: Appium REST http interface listener started on 127.0.0.1:4723 

    info - socket.io started 

debug: Appium request initiated at /wd/hub/session 

debug: Request received with params: {"desiredCapabilities":{"platform":"Windows 

","browserName":"Android","app-package":"com.android.calculator2","app-activity" 

:"com.android.calculator2.Calculator","version":"4.3"}} 

warn: WARNING: use of browserName is deprecated. Please migrate your tests 

info: Didn't get app but did get Android package, will attempt to launch it on t 

he device 

info: Creating new appium session 82c07566-3e62-4c64-a505-0d31ffe40089 

info: Starting android appium 

debug: Using fast reset? false 
info: Preparing device for session 

info: Not checking whether app is present since we are assuming it's already on 
the device 

info: Checking whether adb is present 

info: [ADB] Using adb from C:\adt-bundle-windows-x86_64-20131030\sdk\platform-to 

ols\adb.exe 

info: Trying to find a connected android device 

info: [ADB] Getting connected devices... 

debug: executing: "C:\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb. 

exe" devices 

warn: code=ENOENT, errno=ENOENT, syscall=spawn 

info: Could not find devices, restarting adb server... 

debug: executing: "C:\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb. 

exe" kill-server 

warn: code=ENOENT, errno=ENOENT, syscall=spawn 

error: Error killing ADB server, going to see if it's online anyway 

info: [ADB] Getting connected devices... 

debug: executing: "C:\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb. 

exe" devices 

warn: code=ENOENT, errno=ENOENT, syscall=spawn 

info: Could not find devices, restarting adb server... 

debug: executing: "C:\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb. 

exe" kill-server 

warn: code=ENOENT, errno=ENOENT, syscall=spawn 

error: Error killing ADB server, going to see if it's online anyway 

info: [ADB] Getting connected devices... 

debug: executing: "C:\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb. 

exe" devices 

warn: code=ENOENT, errno=ENOENT, syscall=spawn 

info: Could not find devices, restarting adb server... 

debug: executing: "C:\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb. 

exe" kill-server 

warn: code=ENOENT, errno=ENOENT, syscall=spawn 

error: Error killing ADB server, going to see if it's online anyway 

info: [ADB] Getting connected devices... 

debug: executing: "C:\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb. 

exe" devices 

warn: code=ENOENT, errno=ENOENT, syscall=spawn 

info: Could not find devices, restarting adb server... 

debug: executing: "C:\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb. 

exe" kill-server 

warn: code=ENOENT, errno=ENOENT, syscall=spawn 

error: Error killing ADB server, going to see if it's online anyway 

info: [ADB] Getting connected devices... 

debug: executing: "C:\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb. 

exe" devices 

warn: code=ENOENT, errno=ENOENT, syscall=spawn 

info: Could not find devices, restarting adb server... 

debug: executing: "C:\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb. 

exe" kill-server 

warn: code=ENOENT, errno=ENOENT, syscall=spawn 

error: Error killing ADB server, going to see if it's online anyway 

info: [ADB] Getting connected devices... 

debug: executing: "C:\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb. 

exe" devices 

warn: code=ENOENT, errno=ENOENT, syscall=spawn 

info: Could not find devices, restarting adb server... 

debug: executing: "C:\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb. 

exe" kill-server 

warn: code=ENOENT, errno=ENOENT, syscall=spawn 

error: Error killing ADB server, going to see if it's online anyway 

info: [ADB] Getting connected devices... 

debug: executing: "C:\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb. 

exe" devices 

warn: code=ENOENT, errno=ENOENT, syscall=spawn 

info: Could not find devices, restarting adb server... 

debug: executing: "C:\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb. 

exe" kill-server 

warn: code=ENOENT, errno=ENOENT, syscall=spawn 

error: Error killing ADB server, going to see if it's online anyway 

info: [ADB] Getting connected devices... 

debug: executing: "C:\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb. 

exe" devices 

warn: code=ENOENT, errno=ENOENT, syscall=spawn 

info: Could not find devices, restarting adb server... 

debug: executing: "C:\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb. 

exe" kill-server 

warn: code=ENOENT, errno=ENOENT, syscall=spawn 

error: Error killing ADB server, going to see if it's online anyway 

info: [ADB] Getting connected devices... 

debug: executing: "C:\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb. 
exe" devices 

warn: code=ENOENT, errno=ENOENT, syscall=spawn 

info: Could not find devices, restarting adb server... 

debug: executing: "C:\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb. 

exe" kill-server 

warn: code=ENOENT, errno=ENOENT, syscall=spawn 

error: Error killing ADB server, going to see if it's online anyway 

info: [ADB] Getting connected devices... 

debug: executing: "C:\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb. 

exe" devices 

warn: code=ENOENT, errno=ENOENT, syscall=spawn 

info: Could not find devices, restarting adb server... 

debug: executing: "C:\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb. 

exe" kill-server 

warn: code=ENOENT, errno=ENOENT, syscall=spawn 

error: Error killing ADB server, going to see if it's online anyway 

info: [ADB] Getting connected devices... 

debug: executing: "C:\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb. 

exe" devices 

warn: code=ENOENT, errno=ENOENT, syscall=spawn 

info: Could not find devices, restarting adb server... 

debug: executing: "C:\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb. 

exe" kill-server 
warn: code=ENOENT, errno=ENOENT, syscall=spawn 

error: Error killing ADB server, going to see if it's online anyway 

info: [ADB] Getting connected devices... 

debug: executing: "C:\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb. 

exe" devices 

warn: code=ENOENT, errno=ENOENT, syscall=spawn 
info: Could not find devices, restarting adb server... 

debug: executing: "C:\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb. 

exe" kill-server 

warn: code=ENOENT, errno=ENOENT, syscall=spawn 

error: Error killing ADB server, going to see if it's online anyway 

info: [ADB] Getting connected devices... 
debug: executing: "C:\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb. 

exe" devices 

warn: code=ENOENT, errno=ENOENT, syscall=spawn 

info: Could not find devices, restarting adb server... 

debug: executing: "C:\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb. 

exe" kill-server 
warn: code=ENOENT, errno=ENOENT, syscall=spawn 

error: Error killing ADB server, going to see if it's online anyway 

info: [ADB] Getting connected devices... 
debug: executing: "C:\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb. 

exe" devices 

warn: code=ENOENT, errno=ENOENT, syscall=spawn 

info: Could not find devices, restarting adb server... 
debug: executing: "C:\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb. 

exe" kill-server 

warn: code=ENOENT, errno=ENOENT, syscall=spawn 

error: Error killing ADB server, going to see if it's online anyway 
info: [ADB] Getting connected devices... 

debug: executing: "C:\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb. 

exe" devices 

warn: code=ENOENT, errno=ENOENT, syscall=spawn 

info: Could not find devices, restarting adb server... 
debug: executing: "C:\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb. 

exe" kill-server 

warn: code=ENOENT, errno=ENOENT, syscall=spawn 

error: Error killing ADB server, going to see if it's online anyway 

info: [ADB] Getting connected devices... 

debug: executing: "C:\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb. 

exe" devices 

warn: code=ENOENT, errno=ENOENT, syscall=spawn 

info: Could not find devices, restarting adb server... 

debug: executing: "C:\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb. 

exe" kill-server 

warn: code=ENOENT, errno=ENOENT, syscall=spawn 

error: Error killing ADB server, going to see if it's online anyway 

info: [ADB] Getting connected devices... 

debug: executing: "C:\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb. 

exe" devices 

warn: code=ENOENT, errno=ENOENT, syscall=spawn 

info: Could not find devices, restarting adb server... 

debug: executing: "C:\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb. 

exe" kill-server 

warn: code=ENOENT, errno=ENOENT, syscall=spawn 

error: Error killing ADB server, going to see if it's online anyway 

info: [ADB] Getting connected devices... 

debug: executing: "C:\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb. 

exe" devices 

warn: code=ENOENT, errno=ENOENT, syscall=spawn 

info: Could not find devices, restarting adb server... 

debug: executing: "C:\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb. 

exe" kill-server 

warn: code=ENOENT, errno=ENOENT, syscall=spawn 

error: Error killing ADB server, going to see if it's online anyway 

info: [ADB] Getting connected devices... 

debug: executing: "C:\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb. 

exe" devices 

warn: code=ENOENT, errno=ENOENT, syscall=spawn 

info: Could not find devices, restarting adb server... 

debug: executing: "C:\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb. 

exe" kill-server 

warn: code=ENOENT, errno=ENOENT, syscall=spawn 
error: Error killing ADB server, going to see if it's online anyway 

info: [ADB] Getting connected devices... 

debug: executing: "C:\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb. 

exe" devices 

warn: code=ENOENT, errno=ENOENT, syscall=spawn 

info: Could not find devices, restarting adb server... 

debug: executing: "C:\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb. 

exe" kill-server 

warn: code=ENOENT, errno=ENOENT, syscall=spawn 

error: Error killing ADB server, going to see if it's online anyway 

info: [ADB] Getting connected devices... 

debug: executing: "C:\adt-bundle-windows-x86_64-20131030\sdk\platform-tools\adb. 

exe" devices 

warn: code=ENOENT, errno=ENOENT, syscall=spawn 

POST /wd/hub/session 200 599985ms 

debug: Appium request initiated at /wd/hub/session 

debug: Request received with params: {"desiredCapabilities":{"platform":"Windows 

","browserName":"Android","app-package":"com.android.calculator2","app-activity" 

:"com.android.calculator2.Calculator","version":"4.3"}} 

warn: WARNING: use of browserName is deprecated. Please migrate your tests 

info: Didn't get app but did get Android package, will attempt to launch it on t 

he device 

error: Failed to start an Appium session, err was: Error: Requested a new sessio 

n but one was in progress 

info: Responding to client with error: {"status":33,"value":{"message":"A new se 

ssion could not be created. (Original error: Requested a new session but one was 

in progress)","origValue":"Requested a new session but one was in progress"},"s 

essionId":"82c07566-3e62-4c64-a505-0d31ffe40089"} 

POST /wd/hub/session 500 55ms - 278b 

ответ

0

Пример:

File appDir = new File("<.apk location>"); 
File app = new File(appDir, "apkname.apk"); 
DesiredCapabilities capabilities = new DesiredCapabilities(); 
      capabilities.setCapability("device","Android"); 
      capabilities.setCapability(CapabilityType.BROWSER_NAME, ""); 
      capabilities.setCapability(CapabilityType.VERSION, "4.3"); 
      capabilities.setCapability(CapabilityType.PLATFORM, "LINUX"); 
     capabilities.setCapability("app-package","pkg name"); // from manifest file 
capabilities.setCapability("app-activity","activity name");//from Manifest file 
capabilities.setCapability("app", app.getAbsolutePath()); 
driver = new RemoteWebDriver(new URL("http://localhost:4723/wd/hub"), capabilities); 

Убедитесь, что вы даете полный пакет и активности имя и .apk имеет разрешение.

0

Это то, что решить мою проблемно

Открыть командную строку и путь типа. Проверьте, присутствует ли этот путь. C: \ WINDOWS \ system32. Если нет, перейдите к шагу 3. Добавьте путь, как это, в системную переменную% SYSTEMROOT% \ System32

Это происходит, когда Appium/ADB имеет проблемы с чтением и расширением папки System32.

Смежные вопросы