Runtime.getRuntime().exec(new String[]{"/system/bin/su", "-c", "setprop ctl.stop zygote"});
If you are getting failures like this:
W/su ( 1043): request rejected (0:0->0:0 /system/bin/setprop)
that means that
- you didn't send "-c", or
- you didn't give it a parameter, or
- you gave it more than one parameter
Runtime.getRuntime().exec("/system/bin/su -c 'setprop ctl.stop zygote'");
4 comments:
Fantastic. After weeks of searching this was exactly the post I was looking for.
Thank you wherever you are.
Kevin
It works for me,
thanks
Thanks. It's works :-)
It gives me an error "null environment"!
When trying to run it manually in the android terminal emulator, it also gave an error: "/system/bin/su not found"!
My phone is rooted and I can execute root commands manually from the emulator, but programmatically I am not able to do that!
Can you help?!
Post a Comment