I m new android app developer
I want to know how to run a bash script from my android activity
我是这样说的。
public void RunAsRoot(String[] cmds) {
Process p = Runtime.getRuntime().exec("su");
DataOutputStream os = new DataOutputStream(p.getOutputStream());
for (String tmpCmd : cmds) {
os.writeBytes(tmpCmd+"
");
}
os.writeBytes("exit
");
os.flush();
}
但现在我有许多错误: