4

So I have a rooted SGS3 running the lastest CyanogenMod nightly. I am trying to use DDMS while developing but have run into a problem. I do have root access on my phone (evident when I use an adb shell and use the su command), however DDMS does not use adb in root mode, forcing me to manually change permissions of files using the adb shell before being able to copy them. Is there a way to force ddms to use root all the time? I figured this must be some setting somewhere but I cannot find it.

Any help is gladly appreciated.

pogo2065
  • 226
  • 1
  • 3
  • 14
  • 1
    Will that then force all the future adb commands for that session to use root? Ill give it a shot. Ill feel so stupid if that is the answer though. – pogo2065 Jun 10 '13 at 14:01
  • So that works - running that command will successfully put adb in root and I can access the internal file system and the like. Is there an easy way to make adb always run as root? Like a preference file or something? – pogo2065 Jun 10 '13 at 14:07
  • You might want to refer to the following for possible solutions https://android.stackexchange.com/questions/5884/is-there-a-way-for-me-to-run-adb-shell-as-root-without-typing-in-su – Zerhinne Jun 10 '13 at 14:42

1 Answers1

9

You can try this method, but be carefully as this allows any app to gain root, can you say, "Security Hole!"

Make your suid binary insecure by typing the following commands.

adb shell
su
mount -o remount,rw /system # or: adb remount
ls -la /system/bin/sh
lrwxr-xr-x root shell 2012-11-10 15:20 sh -> mksh
chmod 4755 /system/bin/sh
ls -la /system/bin/mksh
-rwsr-xr-x root shell 157520 2012-11-10 09:54 mksh # notice the suid bit is set
^D
adb shell
pevik
  • 4,523
  • 3
  • 33
  • 44
Ajster1989
  • 197
  • 1
  • 12
  • This works well; really clever workaround! Note that I had to change the settings of `mksh` instead (didn't work on the symlink). – George Hilliard Sep 05 '14 at 17:02
  • Hmm, I think I'm missing something - I'm trying these steps on a rooted Nexus5 w/ 5.0.1 and, within /system/bin (a) `sh` does not appear to be a symlink and (b) `mksh` doesn't appear to be there at all. – Jordan Feb 22 '15 at 19:51
  • Cool. After following above steps my DDMS runs as root and i need not worry about accessing files. – user1501382 Apr 19 '15 at 18:13