getting error while using "su" command
Asked Answered
U

2

13

I try to make batch file to run adb commands. I want to use su -c, but I get the error:

 su: invalid uid/gid '-c'. 

I saw somewhere that my su version doesn't support -c, how can I enable this?

Ukase answered 6/10, 2015 at 6:49 Comment(0)
A
19

In batch file it should be like this:

adb shell "su 0 <command args>"

For example:

adb shell "su 0 mount -o rw,remount /system"
Abutment answered 12/4, 2017 at 11:22 Comment(1)
0 is uid for rootNailbrush
S
2

The standard Android su is much simpler than its regular linux counterpart. It does not support any commands other than -c - so it's become redundant.

usage: su [UID[,GID[,GID2]...]] [COMMAND [ARG...]]

Schwab answered 6/10, 2015 at 16:41 Comment(5)
Somehow, as I said, my 'su' doesn't support even '-c'. (I use Android)Ukase
su -c 'command args' becomes su 0 command args in AndroidSchwab
ok. so if I want to run commands (using batch script) from a wanted and specific path in my devices, how can I do it without it?Ukase
@AlexP. do you know what 0 means here?Megasporophyll
@AlirezaA.Ahmadi 0 is the user ID you want to run the command as, so 0 for root.Morisco

© 2022 - 2024 — McMap. All rights reserved.