以编程方式HotBoot(热重启)Android设备

时间:2012-09-14 20:08:31

标签: android reboot root

我目前正在使用此代码重新启动我的Android设备:

try {
    Process proc = Runtime.getRuntime()
                    .exec(new String[]{ "su", "-c", "reboot" });
    proc.waitFor();
} catch (Exception ex) {
    ex.printStackTrace();
}

现在,我想使用Java HotBoot (or "Hot Reboot")我的Android手机。有谁知道这样做的方法?

(如果您不知道HotBoot是什么,refer to this link

1 个答案:

答案 0 :(得分:4)

你需要一部扎根手机。 (以防万一)

su
busybox killall system_server

或使用您的代码

try {
Process proc = Runtime.getRuntime()
            .exec(new String[]{ "su", "-c", "busybox killall system_server"});
    proc.waitFor();
} catch (Exception ex) {
    ex.printStackTrace();
}
相关问题