Appium运行时报does not have permission android.permission.CLEAR_APP_USER_DATA to clear data

今日长缨在手,何时缚住苍龙。这篇文章主要讲述Appium运行时报does not have permission android.permission.CLEAR_APP_USER_DATA to clear data相关的知识,希望能为你提供帮助。
在oppo R11 操作系统:android8.1.0手机上运行h5 ui自动化用例时,报错:An unknown server-side error occurred while processing the command. Original error: Error executing adbExec. Original error: \'Command \'/Users/amoliu/android/android-sdk_r24.4.1-macosx/platform-tools/adb -P 5037 -s 3cb2dc77 shell pm clear com.xiaomi.shop\' exited with code 1\'; Stderr: \'Error: java.lang.SecurityException: PID 22474 does not have permission android.permission.CLEAR_APP_USER_DATA to clear data of package com.xiaomi.shop\'; Code: \'1\'
尝试后2种方法可解决:
1)增加配置项noReset=true
2)除了常见开发者选项中打开usb调试,同时还需要开启以下2项,然后重启手机即可
【Appium运行时报does not have permission android.permission.CLEAR_APP_USER_DATA to clear data】

Appium运行时报does not have permission android.permission.CLEAR_APP_USER_DATA to clear data

文章图片

 
Appium运行时报does not have permission android.permission.CLEAR_APP_USER_DATA to clear data

文章图片

 
 
 

    推荐阅读