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?
This problem usually occurs when you change the ownership of /usr/bin from root to an ordinary user or you have mistakenly granted both the owner, the group and others the full permission to read, write and execute (rwxrwxrwx) to the /usr/bin directory by running sudo chmod 777 /usr/bin/ or by granting the owner and ...
To provide sudo access, the user has to be added to the sudo group. The su command lets you switch the current user to any other user. If you need to run a command as a different (non-root) user, use the –l [username] option to specify the user account.
Step 1: Go to System -> Administration -> Login window. Step 2: In the Security tab, click on the check box “Allow local system administrator” as shown below. After this change, reboot the system and login directly using root account.
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"
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...]]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With