设备:小米9 + Android 9.0 / OPPO R17 + Android 10
工具: Appium desktop 1.15.1

相关解答:github issue

1、解决方法
*小米设备: 开启 USB调试(安全设置)

(1) 手机-插入 sim卡
(2) 设置 - 更多设置 - 开发者选项 - USB调试(安全设置)- 开启

*OPPO设备: 开启 禁止权限监控

开发者选项 - 禁止权限监控 - 开启

2、详细报错信息
An unknown server-side error occurred while processing the command. 
Original error: Error executing adbExec. 
Original error: 'Command '/Users/xx/Library/Android/sdk/platform-tools/adb -P 5037 -s 77c9ea2f shell settings delete global hidden_api_policy_pre_p_apps' exited with code 255'; 
Stderr: '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:1815) 
at com.android.providers.settings.SettingsProvider.mutateGlobalSetting(SettingsProvider.java:1023) 
at com.android.providers.settings.SettingsProvider.deleteGlobalSetting(SettingsProvider.java:1006) 
at com.android.providers.settings.SettingsProvider.delete(SettingsProvider.java:592) 
at android.content.ContentProvider$Transport.delete(ContentProvider.java:343) 
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.onShellCommand(SettingsService.java:51) at android.os.Binder.shellCommand(Binder.java:634) 
at android.os.Binder.onTransact(Binder.java:532) 
at android.os.Binder.execTransact(Binder.java:733)'; Code: '255'
Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐