Wednesday, May 20, 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.


20 comments:

Konrad Völkel said...

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.

QuiteTall said...

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

Konrad Völkel said...

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.

QuiteTall said...

yes, its OS independant. Google do SDKs for OSX / Linux and Win (in my opinion order of desirability ;-) ) at http://developer.android.com/sdk/1.5_r1/index.html.

Did you put the USB into the correct mode?

Thomas Hempen said...

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?

QuiteTall said...

you could try su-ing:

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

Thomas Hempen said...

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 ;-)

QuiteTall said...

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!

Thomas Hempen said...

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!

Anonymous said...

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! :)

Anonymous said...

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"

alan said...

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

QuiteTall said...

Alan - on your Mac

Anonymous said...

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?

JENS MAHNKE said...

permission denied

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

Anonymous said...

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!

Daedalus said...

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.

Anonymous said...

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

Ashley said...

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

Dolly(Prachi)!!! said...

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?