如何执行“帮助"步骤.Android上的Linux命令? [英] How to execute the "help" Linux command on Android?

查看:47
本文介绍了如何执行“帮助"步骤.Android上的Linux命令?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想运行 am -help 之类的命令,并获取该命令的使用信息.但是, -help 参数在进程运行时"上似乎不起作用.如何进行这项工作?

I would like to run a command like am -help and get usage information for that command. However, the -help parameter does not seem to work on the Process Runtime. How to make this work?

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 ,那么它将自动返回该命令的使用情况信息.有没有其他方法可以调用该响应?

The command works without the -help. Is there any way of getting Android Shell commmands' usage information and/or syntaxes? Note that if I don't send am -help and just send the command am then it automatically returns usage information for that command. Is there any way to invoke that response in any other way?

推荐答案

我希望我没有误会您正在尝试做什么.但是您听说过man命令吗?例如,如果要运行gparted,则可以输入 man gparted 并获取程序上的文档.-help 并不像您在手册页中找到的信息那样详尽.

I hope I haven't misunderstood what it is you are trying to do. But have you heard of the man command? For example if you wanted to run gparted you could enter man gparted and get the documentation on the program. --help is not as thorough as the information you'll find in a man page.

您不需要root就可以使用 man 命令.

You do not need to root to use the man command.

编辑:我不好. https://android.stackexchange.com/questions/2149/我可以在哪里找到关于shell命令的文档我认为您不能在Android上使用man命令.糟透了.不过请检查该链接,这里有一些有趣的答案.

EDIT: My bad. https://android.stackexchange.com/questions/2149/where-can-i-find-documentation-for-shell-commands I don't think you can use the man command on Android. That sucks. Check that link though, there are some interesting answers.

这篇关于如何执行“帮助"步骤.Android上的Linux命令?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆