desired_caps['platformName'] = 'Android'
desired_caps['platformVersion'] = '4.1'
desired_caps['automationName'] = 'Selendroid'
self.driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
以上为基本信息的一部分(真机测试),报错为:
Error
Traceback (most recent call last):
File "/home/yinchuan/PycharmProjects/SpiderMan/sample-code-master/sample-code/examples/python/android_contacts.py", line 27, in setUp
self.driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)
File "/usr/local/lib/python2.7/dist-packages/appium/webdriver/webdriver.py", line 35, in init
super(WebDriver, self).init(command_executor, desired_capabilities, browser_profile, proxy, keep_alive)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 73, in init
self.start_session(desired_capabilities, browser_profile)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 121, in start_session
'desiredCapabilities': desired_capabilities,
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/webdriver.py", line 173, in execute
self.error_handler.check_response(response)
File "/usr/local/lib/python2.7/dist-packages/selenium/webdriver/remote/errorhandler.py", line 164, in check_response
raise exception_class(message, screen, stacktrace)
WebDriverException: Message: u'A new session could not be created. (Original error: hasInternetPermissionFromManifest failed. Error: Command failed: /bin/sh -c "/opt/adt-sdk/sdk/build-tools/android-4.4W/aapt" dump badging \nERROR: no dump file specified\n)'
请问这是什么原因?为什么 hasInternetPermissionFromManifest failed
还有这个信息:
debug: Starting logcat capture
debug: Checking whether aapt is present
debug: Using aapt from /opt/adt-sdk/sdk/build-tools/android-4.4W/aapt
debug: hasInternetPermissionFromManifest: "/opt/adt-sdk/sdk/build-tools/android-4.4W/aapt" dump badging
warn: ERROR: no dump file specified
debug: Cleaning up appium session
error: Failed to start an Appium session, err was: Error: hasInternetPermissionFromManifest failed. Error: Command failed: /bin/sh -c "/opt/adt-sdk/sdk/build-tools/android-4.4W/aapt" dump badging
ERROR: no dump file specified
debug: Error: hasInternetPermissionFromManifest failed. Error: Command failed: /bin/sh -c "/opt/adt-sdk/sdk/build-tools/android-4.4W/aapt" dump badging
ERROR: no dump file specified