Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,782,554 Members 36,454 Now Online
XDA Developers Android and Mobile Development Forum

[GUIDE] How to ROOT your T-Mobile Galaxy S4 on a Mac / Linux PC using Heimdall

Tip us?
 
Exel
Old
(Last edited by Exel; 14th September 2013 at 10:53 PM.)
#1  
Exel's Avatar
Senior Member - OP
Thanks Meter 1,317
Posts: 2,863
Join Date: Dec 2010
Location: Southern California
Default [GUIDE] How to ROOT your T-Mobile Galaxy S4 on a Mac / Linux PC using Heimdall

How to ROOT your T-Mobile Galaxy S4 on a Mac / Linux PC using Heimdall


Before you do ANYTHING, start here:
Quote:
Download and install Heimdall: http://www.glassechidna.com.au/products/heimdall/
And Install libusbx: http://libusbx.org/

What is Heimdall?
Heimdall is a cross-platform open-source tool suite used to flash firmware (aka ROMs) onto Samsung Galaxy S devices.

What is libusbx?
libusbx is a library that provides generic access to USB devices. As a library, it is meant to be used by developers, to facilitate the production of applications that communicate with USB hardware.
Onto the magic..
Quote:
1. Download CF-Root by Chainfire here: http://forum.xda-developers.com/show....php?t=2294005

2. Unzip the file: CF-Auto-Root-jfltetmo-jfltetmo-sghm919.zip

3. Unzip the file called "CF-Auto-Root-jfltetmo-jfltetmo-sghm919.tar.md5" that is inside the original zip file.

4. You should end up with "recovery.img" and "cache.img.ext4" (Put them on your desktop or somewhere easy to navigate to!)

5. Put your phone into download mode. (Hold Volume down + Power + Home button)

6. Connect your phone to your computer.

6. Open your favorite Terminal program on your computer. (I use the stock Mac Terminal)

7. Run the following command:
sudo heimdall flash --RECOVERY *RECOVERY DIRECTORY* --CACHE *CACHE DIRECTORY*

NOTE: Replace *RECOVERY DIRECTORY* and *CACHE DIRECTORY* to the full path of where the file is on your computer!
NOTE: --RECOVERY and --CACHE are CASE SENSITIVE!
For example: heimdall flash --recovery C:\Users\user\Desktop\recovery.img --cache C:\Users\user\Desktop\cache.img.ext4

8. Your phone should reboot.

NOTE: Sometimes the device does *not* boot into recovery mode and root your device. Just do the entire procedure again if this happens. If it still will not install root and such, then after flashing, pull the battery, and boot with VolUp+Home+Power button to boot into recovery manually. This will start the install process.

9. Done!

Note: This does not install a custom recovery, but you can download ROM Manager from the Play Store and install ClockworkMod Recovery using that. Alternatively, you can flash a recovery.img using the same way you flashed these two files. (heimdall flash --recovery *RECOVERY DIRECTORY*)
Quote:
Getting an error?

If you receive this error message:
Initialising connection…
Detecting device…
Claiming interface…
ERROR: Claiming interface failed!

it’s because you have used the Samsung Kies software, which you should uninstall at once, but as it adds some kernel extensions, run this as well:

A. Launch Terminal
B. Get Root and run these:

sudo sh
kextunload -b com.devguru.driver.SamsungComposite
kextunload -b com.devguru.driver.SamsungACMData
kextunload -b com.devguru.driver.SamsungACMControl

C. Try again!
||Phone: Google Nexus 5 (Hammerhead)
||Additional Memory: None
||ROM: Android 4.4 KitKat
||Kernel: Nexus 5 Faux Kernel

Tablet: ASUS Nexus 7 16GB||
Additional Memory: None||
ROM: CM10.2 Nightlies||
Kernel: Stock Tweaked||
The Following 5 Users Say Thank You to Exel For This Useful Post: [ Click to Expand ]
 
didadi
Old
#2  
Member
Thanks Meter 2
Posts: 95
Join Date: Aug 2010
thanks, But a couple of qns.
1. USB debugging should be turned on or off?
2. when I put the device in download mode, it asks up to cancel and down continue in download mode. What to press?
If i put down, it says - downloading do not turn off. At this time, I've not run the heimdall command yet on terminal. (Ubuntu).

The error thats spit out is:

Initialising connection...
Detecting device...
libusbx: error [op_open] libusbx couldn't open USB device /dev/bus/usb/001/007: Permission denied.
libusbx: error [op_open] libusbx requires write access to USB device nodes.
ERROR: Failed to access device. libusb error: -3
 
Exel
Old
(Last edited by Exel; 12th September 2013 at 10:24 PM.)
#3  
Exel's Avatar
Senior Member - OP
Thanks Meter 1,317
Posts: 2,863
Join Date: Dec 2010
Location: Southern California
Quote:
Originally Posted by didadi View Post
thanks, But a couple of qns.
1. USB debugging should be turned on or off?
2. when I put the device in download mode, it asks up to cancel and down continue in download mode. What to press?
If i put down, it says - downloading do not turn off. At this time, I've not run the heimdall command yet on terminal. (Ubuntu).

The error thats spit out is:

Initialising connection...
Detecting device...
libusbx: error [op_open] libusbx couldn't open USB device /dev/bus/usb/001/007: Permission denied.
libusbx: error [op_open] libusbx requires write access to USB device nodes.
ERROR: Failed to access device. libusb error: -3
1. It does not matter.
2. Yes, you press volume down to continue.

As for that error, try installing this on your Linux setup: http://libusbx.org/

It should have been bundled with Heimdall for Linux but maybe it isn't.
||Phone: Google Nexus 5 (Hammerhead)
||Additional Memory: None
||ROM: Android 4.4 KitKat
||Kernel: Nexus 5 Faux Kernel

Tablet: ASUS Nexus 7 16GB||
Additional Memory: None||
ROM: CM10.2 Nightlies||
Kernel: Stock Tweaked||
 
didadi
Old
#4  
Member
Thanks Meter 2
Posts: 95
Join Date: Aug 2010
Quote:
Originally Posted by theexel View Post
1. It does not matter.
2. Yes, you press volume down to continue.

As for that error, try installing this on your Linux setup: http://libusbx.org/

It should have been bundled with Heimdall for Linux but maybe it isn't.
Hmm,still the same err,but I guess I was able to detect S4.
I did install libusbx from source, by
./configure && make && make install && sudo ldconfig - blah.

Then tried to use heimdall flash command/action.
 
Exel
Old
#5  
Exel's Avatar
Senior Member - OP
Thanks Meter 1,317
Posts: 2,863
Join Date: Dec 2010
Location: Southern California
Try using sudo before the heimdall command.

sudo heimdall flash ....
||Phone: Google Nexus 5 (Hammerhead)
||Additional Memory: None
||ROM: Android 4.4 KitKat
||Kernel: Nexus 5 Faux Kernel

Tablet: ASUS Nexus 7 16GB||
Additional Memory: None||
ROM: CM10.2 Nightlies||
Kernel: Stock Tweaked||
 
didadi
Old
#6  
Member
Thanks Meter 2
Posts: 95
Join Date: Aug 2010
Quote:
Originally Posted by theexel View Post
Try using sudo before the heimdall command.

sudo heimdall flash ....
hmm,sudo is able to write,but stil one error, "recovery" not found in specified PIT as below. One last step?
--------
Downloading device's PIT file...
PIT file download successful.

ERROR: Partition "recovery" does not exist in the specified PIT.
Ending session...
Rebooting device...
Releasing device interface...
Re-attaching kernel driver...

---------- Post added at 11:07 PM ---------- Previous post was at 11:05 PM ----------

heimdall flash --RECOVERY ./clockworkmod_6.0.3.2_jfltespr.img --no-reboot - May be like this?

---------- Post added at 11:13 PM ---------- Previous post was at 11:07 PM ----------

Alright,thank you very much!. I am rooted. Exact command to run is:
sudo heimdall flash --RECOVERY /path_to_recovery/recovery.img --CACHE /path_to_cache/cache.img.ext4
Fantastic! thanks
 
Exel
Old
#7  
Exel's Avatar
Senior Member - OP
Thanks Meter 1,317
Posts: 2,863
Join Date: Dec 2010
Location: Southern California
Glad you got it sorted!

Sent from my SGH-M919 using Tapatalk 4
||Phone: Google Nexus 5 (Hammerhead)
||Additional Memory: None
||ROM: Android 4.4 KitKat
||Kernel: Nexus 5 Faux Kernel

Tablet: ASUS Nexus 7 16GB||
Additional Memory: None||
ROM: CM10.2 Nightlies||
Kernel: Stock Tweaked||
 
nyloxy
Old
#8  
nyloxy's Avatar
Junior Member
Thanks Meter 1
Posts: 5
Join Date: May 2013
Location: Portland, OR
Quote:
Originally Posted by theexel View Post
Glad you got it sorted!

Sent from my SGH-M919 using Tapatalk 4
Would this also work if say...I bricked my phone?

I run windows virtualized on OpenSUSE, but the USB drivers for windows won't work in a virtual environ. I can never be too sure if I can get my hands on a windows PC.
 
Exel
Old
#9  
Exel's Avatar
Senior Member - OP
Thanks Meter 1,317
Posts: 2,863
Join Date: Dec 2010
Location: Southern California
Quote:
Originally Posted by nyloxy View Post
Would this also work if say...I bricked my phone?

I run windows virtualized on OpenSUSE, but the USB drivers for windows won't work in a virtual environ. I can never be too sure if I can get my hands on a windows PC.
You'd probably need to flash the whole Samsung Stock firmware not just the files I listed above, but yes, it should be possible, bud.

If you want me to check it out for you and write a tutorial, I'll be more than happy to me.
||Phone: Google Nexus 5 (Hammerhead)
||Additional Memory: None
||ROM: Android 4.4 KitKat
||Kernel: Nexus 5 Faux Kernel

Tablet: ASUS Nexus 7 16GB||
Additional Memory: None||
ROM: CM10.2 Nightlies||
Kernel: Stock Tweaked||
The Following User Says Thank You to Exel For This Useful Post: [ Click to Expand ]
 
nyloxy
Old
#10  
nyloxy's Avatar
Junior Member
Thanks Meter 1
Posts: 5
Join Date: May 2013
Location: Portland, OR
Quote:
Originally Posted by theexel View Post
You'd probably need to flash the whole Samsung Stock firmware not just the files I listed above, but yes, it should be possible, bud.

If you want me to check it out for you and write a tutorial, I'll be more than happy to me.
Thanks for the info! Quick tutorial would be the bomb! I just got into rooting and flashing a few weeks ago and I never want to go back!

Started using the Infamous Alpha. Currently on 8.6, and it's rock solid. I just worry that there may be a time in the near future that I brick my S4 and I'm no longer a fan of windozzz!

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes