Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[ROOT] G2x Easy Root for Mac and Linux

OP jnichols959

24th April 2011, 05:38 AM   |  #1  
OP Senior Member
Thanks Meter: 96
 
152 posts
Join Date:Joined: Mar 2011
NOTE: does not work with gingerbread 2.3.x. The exploit used by this (and SuperOneClick) does not work on gingerbread. It won't hurt anything if you try to run it (at least not in my experience) but it does not root the phone.

I put together a couple shell scripts that are meant to make rooting and unrooting a G2x on Mac or Linux dead simple (folks claim it works on the Optimus 2X as well). I only tested the linux version on Ubuntu 10.10 (32 and 64-bit) so let me know if you run into any issues. Some folks have had success using the gingerbreak app to root the G2x so that may be an option too - though I haven't tried it myself.

I was motived to do so after reading mhaedo's excellent thread that uses SuperOneClick (http://forum.xda-developers.com/show....php?t=1039985). Head over there if you want to root from Windows or want to use SuperOneClick via mono on Linux/Mac.

The scripts use the same files as SuperOneClick 1.8 so mad props to CLShortFuse. Note that they won't work on PowerPC macs.

If you like the scripts please click the Thanks button. To root, download the attached G2xRootMacLinux zip file, expand it and:
  1. enable USB debugging on your phone (Settings -> Applications -> Development)
  2. connect your phone via USB. no drivers or android sdk needed.
  3. double-click root.command (Mac) or run it as you would any shell script (Linux)
  4. wait for the script to finish and your phone to reboot

Unroot is similar but run unroot.command instead of root.command. It's only designed to unroot devices rooted with the root.command script.

I also created a thread for flashing clockworkmod (or stock) recovery from the mac though it's not as simple. If you want clockworkmod for a safety net when installing ROMs (highly recommended) check it out and click Thanks if it helps: http://forum.xda-developers.com/show....php?t=1099281

Problems/Issues

If you get something like "No connected device found" when running the script make sure usb debugging is enabled, the phone is powered on and plugged in to the computer via USB.

On Mac OS X EasyTether is known to cause adb to break, which is what the scripts use to talk to the phone. I'll look into a fix in the scripts to disable/enable the kernel module automatically but if you have EasyTether installed you can try the steps at http://www.mobile-stream.com/easytet...html#adbmacosx before running root/unroot.

If you're still getting "No connected device found" and you're on a mac, try the following and post the results:
  1. open Terminal (Applications -> Utilities)
  2. type the following: sudo tail -Fn 0 /var/log/kernel.log (that's a zero)
  3. plug the phone into the computer
  4. copy the lines that show up in Terminal and post them here

If you want to learn more about how the G2x is rooted I put a small Readme.txt file in the tar that explains what the scripts do. You could always read the shell scripts too

Edit: hypmatize helped me find a bug when the path to the script had a space in it. fixed in 0.4
Edit: Kdogg71 and artismyrevolt helped me find and fix some permissions problems on some stock linux distros. fixed in 0.5
Attached Files
File Type: zip G2xRootMacLinux_v0.5.zip - [Click for QR Code] (1.17 MB, 8827 views)
File Type: txt G2xRootMacLinux_v0.5.md5.txt - [Click for QR Code] (59 Bytes, 1464 views)
Last edited by jnichols959; 26th July 2011 at 05:06 AM. Reason: added a note about this exploit not working on gingerbread
The Following 34 Users Say Thank You to jnichols959 For This Useful Post: [ View ]
24th April 2011, 06:27 AM   |  #2  
samir5421's Avatar
Senior Member
Thanks Meter: 56
 
155 posts
Join Date:Joined: Apr 2009
More
Works great! Thanks!
24th April 2011, 06:49 AM   |  #3  
Senior Member
Thanks Meter: 25
 
319 posts
Join Date:Joined: Dec 2006
Very nice, thanks!
The Following User Says Thank You to mapin0518 For This Useful Post: [ View ]
24th April 2011, 08:03 AM   |  #4  
drewtang's Avatar
Senior Member
Flag Boise
Thanks Meter: 234
 
826 posts
Join Date:Joined: Jun 2010
More
Rad, thank you for this.
24th April 2011, 12:00 PM   |  #5  
Senior Member
Flag SoCal
Thanks Meter: 16
 
196 posts
Join Date:Joined: Jul 2009
More
I keep getting command not found... do I need to run this with su privileges? if so, how? This is what I see in the Terminal window:


Checking for connected device...
/Users/Ahmed/Documents/android stuff/G2X /rooting stuff/G2xRootMacLinux_v0.3/root.command: line 10: ensureDevice: command not found
/Users/Ahmed/Documents/android stuff/G2X /rooting stuff/G2xRootMacLinux_v0.3/root.command: line 12: isRooted: command not found
/Users/Ahmed/Documents/android stuff/G2X /rooting stuff/G2xRootMacLinux_v0.3/root.command: line 21: checkForExitEarly: command not found
/Users/Ahmed/Documents/android stuff/G2X /rooting stuff/G2xRootMacLinux_v0.3/root.command: line 23: pushAndRunPsneuter: command not found
Waiting for device...
/Users/Ahmed/Documents/android stuff/G2X /rooting stuff/G2xRootMacLinux_v0.3/root.command: line 28: ensureDevice: command not found
Remounting /system read/write...
/Users/Ahmed/Documents/android stuff/G2X /rooting stuff/G2xRootMacLinux_v0.3/root.command: line 35: remount: command not found
Pushing su to /system/bin/su...
/Users/Ahmed/Documents/android stuff/G2X /rooting stuff/G2xRootMacLinux_v0.3/root.command: line 38: push: command not found
/Users/Ahmed/Documents/android stuff/G2X /rooting stuff/G2xRootMacLinux_v0.3/root.command: line 39: shell: command not found
Pushing busybox to /system/bin/busybox...
/Users/Ahmed/Documents/android stuff/G2X /rooting stuff/G2xRootMacLinux_v0.3/root.command: line 42: push: command not found
/Users/Ahmed/Documents/android stuff/G2X /rooting stuff/G2xRootMacLinux_v0.3/root.command: line 43: shell: command not found
Installing Superuser.apk android application...
/Users/Ahmed/Documents/android stuff/G2X /rooting stuff/G2xRootMacLinux_v0.3/root.command: line 46: push: command not found
Removing psneuter from device...
/Users/Ahmed/Documents/android stuff/G2X /rooting stuff/G2xRootMacLinux_v0.3/root.command: line 49: removePsneuter: command not found

Rebooting device...
reboot: Operation not permitted


I'm running 10.6 (snow leopard) btw

followed everything in the instructions
Last edited by hypmatize; 24th April 2011 at 12:04 PM. Reason: typo
The Following User Says Thank You to hypmatize For This Useful Post: [ View ]
24th April 2011, 04:55 PM   |  #6  
Junior Member
Thanks Meter: 0
 
9 posts
Join Date:Joined: Aug 2010
Donate to Me
More
Quote:
Originally Posted by hypmatize

I'm running 10.6 (snow leopard) btw

followed everything in the instructions

Worked fine for me, 10.6.

Thanks for the root, worked perfectly.
24th April 2011, 06:58 PM   |  #7  
Senior Member
Flag Kansas City
Thanks Meter: 75
 
295 posts
Join Date:Joined: Jun 2009
More
was incredibly fast and easy. on 10.6.7 here as well.

thanks for the hard work!
24th April 2011, 07:04 PM   |  #8  
OP Senior Member
Thanks Meter: 96
 
152 posts
Join Date:Joined: Mar 2011
Quote:
Originally Posted by hypmatize

I keep getting command not found... do I need to run this with su privileges? if so, how? This is what I see in the Terminal window:


Checking for connected device...
/Users/Ahmed/Documents/android stuff/G2X /rooting stuff/G2xRootMacLinux_v0.3/root.command: line 10: ensureDevice: command not found
...

Rebooting device...
reboot: Operation not permitted


I'm running 10.6 (snow leopard) btw

followed everything in the instructions

Are you running this by double clicking the root.command file or are you running it via terminal? I'll PM you with some more info not fit for public consumption
The Following User Says Thank You to jnichols959 For This Useful Post: [ View ]
24th April 2011, 08:30 PM   |  #9  
Member
Thanks Meter: 1
 
83 posts
Join Date:Joined: Oct 2008
you are awesome!! i prefer not to use adb so i hadn't rooted my g2x until now!! thank you so much.
25th April 2011, 12:36 AM   |  #10  
Member
Thanks Meter: 3
 
57 posts
Join Date:Joined: Apr 2011
More
Thank you so much it worked like a charm... quick fast and easy... Much better experience than with my returned Atrix (Mac 10.4)
Last edited by baykakes; 25th April 2011 at 12:43 AM.

The Following User Says Thank You to baykakes For This Useful Post: [ View ]
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes