【问题标题】:how to uninstall apps on my rooted phone如何在我的手机上卸载应用程序
【发布时间】:2014-10-15 11:42:39
【问题描述】:

我尝试在我的根手机上卸载应用程序,我使用来自How to uninstall Android App with root permissions? 的代码,我尝试了这个建议,但我失败了。 这是我的代码:

Process process;
try {
    process = Runtime.getRuntime().exec("su");
    DataOutputStream os = new DataOutputStream(process.getOutputStream());
    os.writeBytes("pm uninstall com.lixiancheng.orangemusic"+"; \n");
    os.flush();
} catch (IOException e) {
    e.printStackTrace();
}  

为什么我无法卸载应用程序?代码有问题吗?

【问题讨论】:

  • 我认为 \n 在这里无效。
  • 我尝试删除这些\n,再次失败。

标签: android uninstallation rooted-device


【解决方案1】:

你试过了吗:

try {
    Process su = Runtime.getRuntime().exec("su");
    DataOutputStream outputStream = new DataOutputStream(su.getOutputStream());

    outputStream.writeBytes("pm uninstall com.lixiancheng.orangemusic\n");
    outputStream.flush();
    outputStream.writeBytes("exit\n");
    outputStream.flush();
    su.waitFor();
} catch(IOException e){
    throw new Exception(e);
} catch(InterruptedException e){
    throw new Exception(e);
}

【讨论】:

    【解决方案2】:

    键入 adb shell rm -f/{data,system}/app/APKNAME”,将“APKNAKE”替换为您要删除的应用程序的名称,然后按 Enter。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2023-04-09
      • 1970-01-01
      • 1970-01-01
      • 2013-06-15
      • 1970-01-01
      • 2019-06-28
      相关资源
      最近更新 更多