【发布时间】:2015-10-02 09:17:32
【问题描述】:
我正在尝试运行以下代码,我正在使用 [1]:https://github.com/rbochet/Fast-Forward-Reboot 这个链接。
try {
Runtime.getRuntime().exec(
new String[] { "/system/bin/su", "-c", "reboot now" });
} catch (IOException e) {
e.printStackTrace();
}
和错误 W / System.err:java.io.IOException:运行exec()时出错。命令:[/system/bin/su, -c, reboot now] 工作目录:null 环境:null。
权限
android.permission.WRITE_EXTERNAL_STORAGE
android.permission.READ_EXTERNAL_STORAGE
android.permission.WRITE_INTERNAL_STORAGE
android.permission.READ_INTERNAL_STORAGE
android.permission.REBOOT.
我正在使用 Android Studio,目标是 Android 6.0(API 级别 23) 任何人请有一个想法。提前致谢。
【问题讨论】:
-
你有解决办法吗?
-
你找到解决办法了吗?
标签: java android linux android-os-handler