pm命令执行不了
process = Runtime.getRuntime().exec("su");dos = new DataOutputStream(process.getOutputStream());
cls = cls.replace("$", "\\$");
command = "export LD_LIBRARY_PATH=/vendor/lib:/system/lib \n";
Log.e("command-------------", command);
dos.writeBytes(command);
dos.flush();
为什么老是报
11-13 02:03:07.374: I/System(2737): Failed to destroy process 2753
11-13 02:03:07.397: I/System(2737): libcore.io.ErrnoException: kill failed: ESRCH (No such process)
11-13 02:03:07.397: I/System(2737): at libcore.io.Posix.kill(Native Method)
11-13 02:03:07.397: I/System(2737): at libcore.io.ForwardingOs.kill(ForwardingOs.java:77)
11-13 02:03:07.397: I/System(2737): at java.lang.ProcessManager$ProcessImpl.destroy(ProcessManager.java:257)
11-13 02:03:07.397: I/System(2737): at com.example.startuptest.StrartUpActivity.disableBoot(StrartUpActivity.java:177)
11-13 02:03:07.397: I/System(2737): at com.example.startuptest.StrartUpActivity.init(StrartUpActivity.java:48)
11-13 02:03:07.397: I/System(2737): at com.example.startuptest.StrartUpActivity.onCreate(StrartUpActivity.java:38)
11-13 02:03:07.397: I/System(2737): at android.app.Activity.performCreate(Activity.java:4465)
11-13 02:03:07.397: I/System(2737): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1049)
11-13 02:03:07.397: I/System(2737): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1919)
11-13 02:03:07.397: I/System(2737): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1980)
11-13 02:03:07.397: I/System(2737): at android.app.ActivityThread.access$600(ActivityThread.java:122)
11-13 02:03:07.397: I/System(2737): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1146)
11-13 02:03:07.397: I/System(2737): at android.os.Handler.dispatchMessage(Handler.java:99)
11-13 02:03:07.397: I/System(2737): at android.os.Looper.loop(Looper.java:137)
11-13 02:03:07.397: I/System(2737): at android.app.ActivityThread.main(ActivityThread.java:4340)
11-13 02:03:07.397: I/System(2737): at java.lang.reflect.Method.invokeNative(Native Method)
11-13 02:03:07.397: I/System(2737): at java.lang.reflect.Method.invoke(Method.java:511)
11-13 02:03:07.397: I/System(2737): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:784)
11-13 02:03:07.397: I/System(2737): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:551)
11-13 02:03:07.397: I/System(2737): at dalvik.system.NativeStart.main(Native Method)
请大神指点一下 Android PM命令 --------------------编程问答-------------------- 你是不是在杀一个ESRCH进程啊? --------------------编程问答-------------------- 没有啊 我就是要用代码执行pm命令 process = Runtime.getRuntime().exec("su");这一句就报错了 --------------------编程问答--------------------
是否有权限问题?获取当前的运行时环境!
补充:移动开发 , Android