3

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);

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?

Zac
  • 695
  • 1
  • 11
  • 34

2 Answers2

-1
#!/system/bin/sh
curl -s http://man.he.net/?topic=$1\&section=all | tail -n +10 | head -n -9

save this in xbin (lets call it hlp.sh) then just hlp.sh cat, you will have help documentation for cat .. you just need install curl first & also need internet connection ..

vins mv
  • 46
  • 7
-1

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.

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

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.

Community
  • 1
  • 1
Rehaan
  • 119
  • 1
  • 10