3

I want to write some basic Linux commands in my Android app (namely ls, rm, cp, chmod with recursive -R option) but I am not sure whether they are available across different versions of the OS and whether they support "-R" or not. From my experience, cp seems to be added to Jelly Bean 4.2. The rest are all available in earlier versions.

May I ask if there is a source or reference for this? (Nothing seems to be available on the official Android site.)

An Hoa
  • 1,207
  • 12
  • 38
  • Note also that the shells differ between versions as well. `ash` on early versions, and `mksh` (which is much more powerful) from ICS (although it appears earlier on some devices). – cdarke Nov 29 '12 at 08:18
  • Possible same on android SE: http://android.stackexchange.com/questions/2149/where-can-i-find-documentation-for-shell-commands Related: POSIX compatibility: http://stackoverflow.com/questions/27604455/is-android-posix-compatible – Ciro Santilli OurBigBook.com Nov 30 '15 at 21:28

1 Answers1

1

You can always fire up a avd and in adb shell run ls /system/bin and ls /system/xbin, it will show all the commands present.

nandeesh
  • 24,740
  • 6
  • 69
  • 79
  • 1
    Could it be the case that some device vendor choose NOT to ship some commands in their device? – An Hoa Nov 30 '12 at 06:03
  • 1
    yeah.. happens lots of times. If you check the emulator, tcpdump and some other things will be present, but production devices will not have these executables – nandeesh Nov 30 '12 at 06:43