【发布时间】:2012-02-10 05:45:04
【问题描述】:
我想从一个 android 应用程序执行 shell 脚本。我可以通过以下方式传递 ls pwd date 等命令:
进程 p= Runtime.getRuntime.exec("command");
但现在我想执行我的应用程序所需的 shell 脚本。 shell 脚本在 linux 终端上运行良好。
你能帮我在哪里存储 shell 脚本以及如何从程序中调用它吗?
首先这可能吗?
【问题讨论】:
-
我发现你在 shell 命令中获得的权限是有限的。很多可以在
adb shell中执行的命令在Runtime.exec中却无法执行。谁能解释一下?