运行代码
from appium import webdriver
desired_caps={}
desired_caps[‘platformName’]=‘Android’
desired_caps[‘platformVersion’]=‘6.0’
desired_caps[‘deviceName’]=‘emulator-5554’
desired_caps[‘appPackage’]=‘com.android.settings’
desired_caps[‘appActivity’]=‘com.android.settings.Settings’
driver=webdriver.Remote(‘http://localhost:4723/wd/hub’,desired_caps)
print(“启动【设置】应用”)
driver.quit()
报错信息
E selenium.common.exceptions.WebDriverException: Message: An unknown server-side error occurred while processing the command. Original error: Error getting device platform version. Original error: Error executing adbExec. Original error: ‘Command ‘D:\android-sdk-windows\platform-tools\adb.exe -P 5037 -s URU0218A25003520 shell getprop ro.build.version.release’ exited with code 1’; Stderr: ‘error: device unauthorized.
E This adb server’s $ADB_VENDOR_KEYS is not set
E Try ‘adb kill-server’ if that seems wrong.
E Otherwise check for a confirmation dialog on your device.’; Code: ‘1’