Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/234.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Android应用程序中与shell(BusyBox)接口_Android_Shell_Busybox - Fatal编程技术网

如何在Android应用程序中与shell(BusyBox)接口

如何在Android应用程序中与shell(BusyBox)接口,android,shell,busybox,Android,Shell,Busybox,我想从标准的安卓应用程序向安卓shell(BusyBox)发送命令(并从中接收输出)。我该怎么做呢?谷歌搜索了一个小时,没有结果 非常感谢你的帮助 问候,, 斯万特 这将执行ls-la命令并返回流程。如果您想要更复杂的交互,您应该使用输入和输出流:proc.getInputStream()和proc.getOutputStream() Process proc = Runtime.getRuntime().exec("ls -la");

我想从标准的安卓应用程序向安卓shell(BusyBox)发送命令(并从中接收输出)。我该怎么做呢?谷歌搜索了一个小时,没有结果

非常感谢你的帮助

问候,, 斯万特

这将执行
ls-la
命令并返回流程。如果您想要更复杂的交互,您应该使用输入和输出流:
proc.getInputStream()
proc.getOutputStream()

Process proc = Runtime.getRuntime().exec("ls -la");