【问题标题】:MAC : Appium is unable to open Android Emulator keeps on giving, unable to find the devicesMAC : Appium 无法打开 Android Emulator 一直给,找不到设备
【发布时间】:2020-11-17 15:13:05
【问题描述】:

我在通过 appium 打开 android 模拟器时遇到问题。这是我遇到的错误

  [BaseDriver] Creating session with MJSONWP desired capabilities: {
[BaseDriver]   "app": "/Users/MY_NAME/Downloads/ApiDemos-debug.apk",
[BaseDriver]   "appActivity": ".view.TextFields",
[BaseDriver]   "appPackage": "io.appium.android.apis",
[BaseDriver]   "automationName": "UiAutomator2",
[BaseDriver]   "deviceName": "Pixel 2",
[BaseDriver]   "platformName": "Android",
[BaseDriver]   "platformVersion": "10.0",
[BaseDriver]   "newCommandTimeout": 0,
[BaseDriver]   "connectHardwareKeyboard": true
[BaseDriver] }
[BaseDriver] The following capabilities were provided, but are not recognized by Appium:
[BaseDriver]   connectHardwareKeyboard
[BaseDriver] Session created with session id: ea88911e-0939-4cb0-b32c-22be3af1d405
[BaseDriver] Using local app '/Users/MY_NAME/Downloads/ApiDemos-debug.apk'
[UiAutomator2] Checking whether app is actually present
[ADB] Using 'adb' from '/Users/MY_NAME/Library/Android/sdk/platform-tools/adb'
[AndroidDriver] Retrieving device list
[ADB] Trying to find a connected android device
[ADB] Getting connected devices...
[ADB] No connected devices have been detected
[ADB] Could not find devices, restarting adb server...
[ADB] Restarting adb
[ADB] Killing adb server on port '5037'
[ADB] Running '/Users/MY_NAME/Library/Android/sdk/platform-tools/adb -P 5037 kill-server'
[ADB] Getting connected devices...
[ADB] No connected devices have been detected
[ADB] Could not find devices, restarting adb server...
[ADB] Restarting adb
[ADB] Killing adb server on port '5037'
[ADB] Running '/Users/MY_NAME/Library/Android/sdk/platform-tools/adb -P 5037 kill-server'
[ADB] Getting connected devices...
[ADB] No connected devices have been detected
[ADB] Could not find devices, restarting adb server...
[ADB] Restarting adb
[ADB] Killing adb server on port '5037'
[ADB] Running '/Users/MY_NAME/Library/Android/sdk/platform-tools/adb -P 5037 kill-server'
[ADB] Getting connected devices...

在日志的末尾

[ADB] Running '/Users/MY_NAME/Library/Android/sdk/platform-tools/adb -P 5037 kill-server'
[UiAutomator2] Deleting UiAutomator2 session
[BaseDriver] Event 'newSessionStarted' logged at 1595922772048 (00:52:52 GMT-0700 (Pacific Daylight Time))
[MJSONWP] Encountered internal error running command: Error: Could not find a connected Android device in 20288ms.
[MJSONWP]     at getDevices (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-adb/lib/tools/system-calls.js:211:13)
[MJSONWP]     at getDevices (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-adb/lib/tools/system-calls.js:224:18)
[MJSONWP]     at getDevices (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-adb/lib/tools/system-calls.js:224:12)

这是大部分配置的截图

我可以通过 android Studio 启动 Android 模拟器,没有任何问题

来自 adb devices 终端的结果

MY_NAME-Pro:~ MY_NAME$ adb devices
List of devices attached
emulator-5554   device

【问题讨论】:

    标签: android automation testng appium appium-android


    【解决方案1】:

    我缺少所需功能的"avd": "Pixel_2"

    【讨论】:

      猜你喜欢
      • 2020-05-05
      • 2014-01-04
      • 1970-01-01
      • 1970-01-01
      • 2014-02-17
      • 2015-10-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多