1

I compiled Android 8.1 from source code.

$ adb shell getprop ro.build.version.release 
8.1.0

$ adb shell
angler:/ $ su -c date
su: invalid uid/gid '-c'
1|angler:/ $ su --help
usage: su [UID[,GID[,GID2]...]] [COMMAND [ARG...]]

Switch to WHO (default 'root') and run the given command (default sh).

where WHO is a comma-separated list of user, group,
and supplementary groups in that order.

Various resources, including https://stackoverflow.com/a/10038568/746461, https://android.stackexchange.com/q/201680/97993, seem to indicate su has option -c. However my android doens't have.

What could be the reason?

Gqqnbig
  • 5,845
  • 10
  • 45
  • 86

1 Answers1

4

The Android su never had the -c option. All sources suggesting to use su -c are meant to be used with third-party su binaries from packages like SuperSU.

The Android version of su does not need -c because it is the default option.

Alex P.
  • 30,437
  • 17
  • 118
  • 169