Android包管理器无法使用ICS工作 [英] android package manager can not work with ICS

查看:176
本文介绍了Android包管理器无法使用ICS工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

4.0之前,这是正常工作,但4.0后,我不能像卸载下午com.abc

Before 4.0,It's work normally, but after 4.0,I can't run it like "pm uninstall com.abc"

我的code是这样的:

my code like this:

try {
                // Executes the command.
                Process process = Runtime.getRuntime().exec("pm uninstall me.onemobile.android");
                DataOutputStream toProcess = new DataOutputStream(process.getOutputStream());
                toProcess.writeBytes("exec " + "shell pm uninstall me.onemobile.android" + "\n");
                toProcess.flush();
            } catch (IOException e) {
                System.out.println(e.getMessage());
                throw new RuntimeException(e);
            }

当我运行它,它的表现是这样的:

when I run it,it's show like this:

[1] + Stopped (signal)

有一定的差异,当我在root身份运行卸载下午com.test,它只是显示

There some difference when i run "pm uninstall com.test" in root,and it just show

[1] + Stopped (signal)

但运行亚行外壳时卸载com.test的时候,它的工作,所以它让我疯了。

but when run "adb shell pm uninstall com.test" ,It's work, so it's make me crazy.

任何帮助或暗示将AP preciate。

any help or hint will be appreciate.

推荐答案

试试这个code

  toProcess.writeBytes("export LD_LIBRARY_PATH=/vendor/lib:/system/lib" + "\n"); 
  toProcess.writeBytes("exec " + "shell pm uninstall me.onemobile.android" + "\n"); 
  toProcess.flush(); 

这篇关于Android包管理器无法使用ICS工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆