【发布时间】:2017-05-20 19:12:08
【问题描述】:
我想运行类似am -help 的命令并获取该命令的使用信息。但是,-help 参数似乎不适用于 Process Runtime。如何使这项工作?
cmd1[0] = "/system/bin/sh";
cmd1[1] = "-c";
cmd1[2] = "/system/bin/am -help" //I want to do sth like this
Process process = Runtime.getRuntime().exec(cmd1);
该命令在没有-help 的情况下工作。有没有办法获取 Android Shell 命令的使用信息和/或语法?
请注意,如果我不发送am -help 而只是发送命令am,那么它会自动返回该命令的使用信息。有没有办法以任何其他方式调用该响应?
【问题讨论】:
标签: android linux shell process terminal