尝试使用 Appium 检查器连接到 Appium 服务器时出现以下错误
ErrorFailed to create session. An unknown server-side error occurred while processing the command. Original error: Check https://github.com/appium/appium/issues/13802 for throubleshooting. Error executing adbExec. Original error: 'Command 'C:\Users\vivek.thapliyal\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s CYTKIB6SPN8SIRE6 shell 'settings delete global hidden_api_policy_pre_p_apps;settings delete global hidden_api_policy_p_apps;settings delete global hidden_api_policy'' exited with code 255'; Command output: Security exception: Permission denial: writing to settings requires:android.permission.WRITE_SECURE_SETTINGS java.lang.SecurityException: Permission denial: writing to settings requires:android.permission.WRITE_SECURE_SETTINGS at com.android.providers.settings.SettingsProvider.enforceWritePermission(SettingsProvider.java:2055) at com.android.providers.settings.SettingsProvider.mutateGlobalSetting(SettingsProvider.java:1114) at com.android.providers.settings.SettingsProvider.deleteGlobalSetting(SettingsProvider.java:1097) at com.android.providers.settings.SettingsProvider.delete(SettingsProvider.java:679) at android.content.ContentProvider$Transport.delete(ContentProvider.java:404) at com.android.providers.settings.SettingsService$MyShellCommand.deleteForUser(SettingsService.java:406) at com.android.providers.settings.SettingsService$MyShellCommand.onCommand(SettingsService.java:289) at android.os.ShellCommand.exec(ShellCommand.java:103) at com.android.providers.settings.SettingsService.onShell
尝试使用以下配置
{"appium:automationName": "uiautomator2","appium:platformName": "Android","appium:platformVersion": "9","appium:deviceName": "CYTKIB6SPN8SIRE6","appium:app": "D:/Automation/ApiDemos-debug.apk","appium:appium": "ignoreHiddenApiPolicyError"}
您需要将 Appium Inspector 的键和值放入 Capability Builder 中
忽略HiddenApiPolicyError文本true