adb 连接情况如图示

连接代码

def setUp(self):
        desired_caps = {}
        desired_caps['platformName'] = 'Android'
        desired_caps['platformVersion'] = '4.4.2'
        desired_caps['deviceName'] = '13b7ef9d'
        desired_caps['app'] = PATH(
            'C:\pythonex\ContactManager.apk'
        )
        desired_caps['appPackage'] = 'com.example.android.contactmanager'
        desired_caps['appActivity'] = '.ContactManager'

        self.driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub', desired_caps)

python 显示报错信息
Traceback (most recent call last):
File "C:\Python34\android_contacts.py", line 24, in setUp
self.driver = webdriver.Remote('http://127.0.0.1:4723/wd/hub', desired_caps)
File "C:\Python34\lib\site-packages\appium\webdriver\webdriver.py", line 35, in init
super(WebDriver, self).init(command_executor, desired_capabilities, browser_profile, proxy, keep_alive)
File "C:\Python34\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 73, in init
self.start_session(desired_capabilities, browser_profile)
File "C:\Python34\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 121, in start_session
'desiredCapabilities': desired_capabilities,
File "C:\Python34\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 173, in execute
self.error_handler.check_response(response)
File "C:\Python34\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 164, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: 'A new session could not be created. (Original error: Could not find a connected Android device.)'

appium 报错信息

ERROR: debug: executing: "C:\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe" kill-server
warn: code=ENOENT, errno=ENOENT, syscall=spawn
ERROR: error: Error killing ADB server, going to see if it's online anyway
warn: code=ENOENT, errno=ENOENT, syscall=spawn
ERROR: debug: executing: "C:\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe" devices
info: Sent shutdown command, waiting for UiAutomator to stop...
warn: UiAutomator did not shut down fast enough, calling it gone
ERROR: error: Failed to start an Appium session, err was: Error: Could not find a connected Android device.
info: Cleaning up android objects
info: Cleaning up appium session
info: Error: Could not find a connected Android device.
at ADB.getDevicesWithRetry (C:\appium\node_modules\appium\lib\devices\android\adb.js:599:15)
at androidCommon.prepareActiveDevice (C:\appium\node_modules\appium\lib\devices\android\android-common.js:338:12)
at null. (C:\appium\node_modules\appium\lib\devices\android\android-common.js:279:26)
at C:\appium\node_modules\appium\node_modules\async\lib\async.js:610:21
at C:\appium\node_modules\appium\node_modules\async\lib\async.js:249:17
at iterate (C:\appium\node_modules\appium\node_modules\async\lib\async.js:149:13)
at C:\appium\node_modules\appium\node_modules\async\lib\async.js:160:25
at C:\appium\node_modules\appium\node_modules\async\lib\async.js:251:21
at C:\appium\node_modules\appium\node_modules\async\lib\async.js:615:34
at androidCommon.prepareEmulator (C:\appium\node_modules\appium\lib\devices\android\android-common.js:329:5)
info: Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Could not find a connected Android device.)","origValue":"Could not find a connected Android device."},"sessionId":null}
POST /wd/hub/session 500 27428ms - 234b
Killed Node Server.
Node Server Process Ended

求助,怎么才能连上真机启动调试,在线等,万分感谢


↙↙↙阅读原文可查看相关链接,并与作者交流