2
我是Android编程的新手,我需要创建一个Android应用程序来运行Shell脚本上的按钮单击事件。 我正在使用下面的命令,但没有发生任何操作。Android程序运行Shell脚本
Process p;
try {
p = new ProcessBuilder()
.command("/data/test.sh")
.start();
} catch (IOException e) {
e.printStackTrace();
} finally {
if(p!=null) p.destroy();
}
- 我已经创建了 “Data” 文件夹,并保持我的shell脚本存在。
- 拥有电话根权限。
在此先感谢。 :)
谢谢,请尝试遵循... :) – 2014-09-23 09:37:23