Tuesday, 19 May 2009

Enable root on Android including Cupcake using OSX

Howto enable root on Android including Cupcake.

You need a tool called ADB - Android Debug Bridge

  1. get the SDK from Google from here
  2. expand the zip and copy it someone handy. I chose /Applications/Android/SDK/sdk_1.5r1
  3. turn on USB Debugging - go to settings>applications>development
Connect your Android by USB to your Mac and type the following:

/applications/android/sdk_1.5r1/tools/adb shell

gets you a command prompt '#'

    # mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
    # cd /system/bin
    # cat sh > su
    # chmod 4755 su
    # exit

and unplug the USB.


19 comments:

  1. Konrad Voelkel20 May 2009 at 09:05

    Could this also work on other Unix-like systems (as Ubuntu GNU/Linux)?

    This sounds very easy, unlike the downgrade-upgrade-1-hour-procedures described elsewhere.

    I have android 1.5 (cupcake) on a german G1 phone.

    ReplyDelete
  2. I don't see why not. There are instructions on connecting the Android by USB.

    ReplyDelete
  3. Konrad Voelkel20 May 2009 at 16:08

    Oh, right, I didn't realise that the shell was on the phone (via ADB).

    So this is linux/mac/windows-independent and does not work for Android 1.5, because "mount: Operation not permitted" for me.

    ReplyDelete
  4. I just tried it on my G1 running Cupcake. I checked the USB debugging two times, adb shell does start, but I get the same error message Konrad gets:

    "mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system

    mount: Operation not permitted"

    Could this be related to both of us using German models? Are there differences between UK and continental G1's?

    ReplyDelete
  5. you could try su-ing:

    # su mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system

    ReplyDelete
  6. Nope, su-ing and sudo-ing also give me permission denied. Regardless which operation I try. Even "su ls" or "sudo ls" will not work... Well, would have been a to easy way anyway ;-)

    ReplyDelete
  7. Hmmmm very curious... are you root or super user on your machine, what is the host OS? Maybe it is to do with running ADB as root? I've run out of ideas, just clutching at straws!

    ReplyDelete
  8. Sorry I didn't check nack earlier, but I was on vacation ;-) I tried using adb as Adminstrator (Win XP SP 3) as well as sudo-ing (Ubuntu 9.04). But both did not yield any results other as the already mentioned. I'll let you know if I find any other way than first downgrading and re-updating.

    Thanks for your time anyway!

    ReplyDelete
  9. Folks, the key to do this is -

    > su

    which switches you to the root user, then

    > mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system

    I tried it on my Cupcake. Works! :)

    ReplyDelete
  10. im trying this in windows, and i get into the adb shell, but when i try to execute su, or any command i get "su: Permission Denied"

    ReplyDelete
  11. Do you type the applicatiocs/etc. on the g1 or the mac?

    ReplyDelete
  12. im trying this in windows too, and i get into the adb shell, but when i try to execute su, or any command i get "su: Permission Denied"


    has anyone figured this out?

    ReplyDelete
  13. permission denied

    bad luck !!! didn´t work for german g1

    ReplyDelete
  14. will only work on already rooted phones. this just gives the applications root access. if you havent already installed a rooted image, this wont work!

    ReplyDelete
  15. it didnt work for me, i have a tmobile g1 with cupcake crb43 and it gives me permission denied even with su.
    I have taken all measures and y am running adb as root in linux but i dont figure it how to reach the root in the phone.

    I will apreciate any indications, thanks in advance.

    ReplyDelete
  16. Would this work for a cdma HTC droid eris running 1.5 cupcake? James1194.ja@gmail.com please email me if you have root for eris , thanks a lot

    ReplyDelete
  17. Worked with windows 7. Very simple way to get root love it well done.

    ReplyDelete
  18. I have root permission for my phone(android OS 2.2)
    I am ablt to get su ls but when i tried su mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
    it says mount operation not permitted
    Help?

    ReplyDelete