代码之家  ›  专栏  ›  技术社区  ›  Gqqnbig

android shell su没有选项-c

  •  0
  • Gqqnbig  · 技术社区  · 6 年前

    我从源代码编译了android 8.1。

    $ 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.
    

    各种资源,包括 https://stackoverflow.com/a/10038568/746461 , https://android.stackexchange.com/q/201680/97993 ,似乎表明 su 有选择权 -c . 但是我的安卓没有。

    原因可能是什么?

    0 回复  |  直到 6 年前
        1
  •  2
  •   Alex P.    6 年前

    安卓 su 从来没有过 -c 选项。所有建议使用的来源 su -c 用于第三方 来自类似包的二进制文件 SuperSU .

    的Android版本 不需要 -C 因为它是默认选项。