【发布时间】:2013-11-25 05:34:20
【问题描述】:
我知道如何从 Android 应用程序的 shell 中执行命令
shell.exec("ls /");
以及如何从中读取响应
new BufferedReader(new InputStreamReader(_process.getInputStream())).readLine();
但我有一个 shell 应用程序,它在运行后需要额外的用户输入。而且我想知道如何向同一个 shell 命令发送额外的输入。
例如:
cp /abc/ /a/abc/
假设该命令要求用户通过输入额外的Y 来确认覆盖,该怎么做?
【问题讨论】:
标签: android shell android-context execute