android system系统调用

tonyen 2010-04-27 10:11:39
我用system("system/test"),执行一个脚本,但好像没有执行,在命令行下执行是好的,
请问为什么,android是否封装了其他的API?谢谢
...全文
253 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
yihua0001 2010-06-13
  • 打赏
  • 举报
回复
可以确定应该是权限问题,我没说具体是因为楼主结贴率为0,可能都不会来看我们的回复。这个问题我遇到过,可以解决。
火箭猫 2010-06-07
  • 打赏
  • 举报
回复
同意三楼,可能是权限问题
chenjiazeng 2010-06-02
  • 打赏
  • 举报
回复
关注中。。
yihua0001 2010-05-30
  • 打赏
  • 举报
回复
权限问题
Hinagi 2010-04-29
  • 打赏
  • 举报
回复
String command = "rm /data/***";  // the command that will be execute    
Runtime runtime = Runtime.getRuntime();
Process proc = null;

try {
proc = runtime.exec(command);
} catch (IOException e1) {
e1.printStackTrace();
}

// put a BufferedReader on the ps output
InputStream inputstream = proc.getInputStream();
InputStreamReader inputstreamreader = new InputStreamReader(inputstream);
BufferedReader bufferedreader = new BufferedReader(inputstreamreader);

// read the ps output and show it to screen.
...
...

// judge the return value
try {
if (proc.waitFor() != 0) {
System.err.println("exit value = " + proc.exitValue());
}
}
catch (InterruptedException e) {
System.err.println(e);
}
infsafe 2010-04-27
  • 打赏
  • 举报
回复
看不懂..

80,351

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧