相关疑难解决方法(0)

清除Android应用程序用户数据

使用adb shell清除应用程序数据

adb shell pm clear com.android.browser
Run Code Online (Sandbox Code Playgroud)

但是从应用程序执行该命令时

String deleteCmd = "pm clear com.android.browser";      
        Runtime runtime = Runtime.getRuntime();
        try {
            runtime.exec(deleteCmd);
        } catch (IOException e) {
            e.printStackTrace();                
        }
Run Code Online (Sandbox Code Playgroud)

问题:

虽然我已经给出了以下许可,但它不会清除用户数据也不会给出任何异常.

<uses-permission android:name="android.permission.CLEAR_APP_USER_DATA"/>
Run Code Online (Sandbox Code Playgroud)

题:

如何使用adb shell清除应用程序数据?

android adb user-data

99
推荐指数
3
解决办法
10万
查看次数

使用 root 安装 APK,处理“/data/local/tmp/”文件夹的新限制

背景

到目前为止,我能够通过以下代码使用 root(在应用程序内)安装 APK 文件:

pm install -t -f fullPathToApkFile
Run Code Online (Sandbox Code Playgroud)

如果我想(尝试)安装到 SD 卡:

pm install -t -s fullPathToApkFile
Run Code Online (Sandbox Code Playgroud)

问题

最近,不确定来自哪个 Android 版本(至少在 Android P beta 上存在问题),上述方法失败,向我显示此消息:

avc:  denied  { read } for  scontext=u:r:system_server:s0 tcontext=u:object_r:sdcardfs:s0 tclass=file permissive=0
System server has no access to read file context u:object_r:sdcardfs:s0 (from path /storage/emulated/0/Download/FDroid.apk, context u:r:system_server:s0)
Error: Unable to open file: /storage/emulated/0/Download/FDroid.apk
Consider using a file under /data/local/tmp/
Error: Can't open file: /storage/emulated/0/Download/FDroid.apk
Exception occurred while executing:
java.lang.IllegalArgumentException: Error: Can't open file: /storage/emulated/0/Download/FDroid.apk
    at com.android.server.pm.PackageManagerShellCommand.setParamsSize(PackageManagerShellCommand.java:306) …
Run Code Online (Sandbox Code Playgroud)

android root apk android-9.0-pie

11
推荐指数
1
解决办法
7108
查看次数

标签 统计

android ×2

adb ×1

android-9.0-pie ×1

apk ×1

root ×1

user-data ×1