[Q] Heimdall - "Claiming Interface Failed!" - Samsung Epic 4G Touch

I am trying to use Heimdall to flash a kernel to my ET4G, but running into a problem. It is able to detect my device, but when I use the flash command I get the following message:
Initialising connection...
Detecting device...
Claiming interface...
ERROR: Claiming interface failed!
This is Heimdall 1.3.0, OSX 10.7.1
Anyone know how to fix this? Thanks in advance!

Just to cover the obvious, you've enabled USB debugging, right?

Kn0wBuddy said:
Just to cover the obvious, you've enabled USB debugging, right?
Click to expand...
Click to collapse
Yes, it is enabled. I've tried every combination of USB settings and running the command with SU privs. I've installed Heimdall twice, to make sure it wasn't a bad install, and I've repaired permissions, and multiple reboots of both devices.

Solved!
It was my Mac. I'd been having issues ever since installing Lion, especially with WiFi and beach balls. So, I did a complete erase and install, and the first thing I did was install Heimdall and ran it, worked perfectly!

Is there any way around this? I would like to avoid reinstalling my OS. I believe that I have the same exact set-up (with Lion). This is my very first time Rooting, coming from the HTC Touch Pro 2. Forgive my noobness...

Kn0wBuddy said:
Just to cover the obvious, you've enabled USB debugging, right?
Click to expand...
Click to collapse
100% irrelevant to Heimdall.
There's a Heimdall update in testing that is supposed to fix a lot of OSX issues.

same error message here also using lion..
any suggestions?
thanks

Did anyone find a solution to this ?

I'm having the same problems. Tried a few different things to get it to work, to no avail... Anyone else? Tried using ODIN in Wine as well, but no dice there.

For what it is worth, heimdall and heimdall-frontend from 64bit Linux, using the official packages off the website yields this:
Code:
# heimdall flash --repartition --pit s1_odin_20100512.pit --factoryfs factoryfs.rfs --cache cache.rfs --dbdata dbdata.rfs --primary-boot boot.bin --secondary-boot Sbl.bin --param param.lfs --kernel zImage --modem modem.bin
Heimdall v1.3.1, Copyright (c) 2010-2011, Benjamin Dobell, Glass Echidna
This software is provided free of charge. Copying and redistribution is
encouraged.
If you appreciate this software and you would like to support future
development please consider donating:
Initialising connection...
Detecting device...
Claiming interface...
Setting up interface...
ERROR: Setting up interface failed!
I will keep digging around for solutions but I am fresh out of ideas. It detects the device, claims the interface and errors out in the setting up from what the output says.

im getting this error too! anyone find a fix?

nate633 said:
I am trying to use Heimdall to flash a kernel to my ET4G, but running into a problem. It is able to detect my device, but when I use the flash command I get the following message:
Initialising connection...
Detecting device...
Claiming interface...
ERROR: Claiming interface failed!
This is Heimdall 1.3.0, OSX 10.7.1
Anyone know how to fix this? Thanks in advance!
Click to expand...
Click to collapse
Hi - I had the same issue with OSX 10.6.8 and odin 1.3.1.
I got it to work - without having to reinstall everything on my mac (what kind of fix is that?). Anyway - the fix. I just reinstalled odin - restarted - and tried again - and it worked!
Good-luck.

...
I'm getting the same error as well. the funny thing is that i used zedomaxs method found here: xda-developers.com/showthread.php?t=1277000
and was able to root the first time around, kernel, cwm recover, su installed etc..
but every time i went to flash a new kernel or rom, clockwork (cwm) would not recognize the .zip on my sd card. i tried switching out multiple cards to no avail. not sure if it was an issue with the version of cwm or not but i decided to go back to stock and start the process over again. now i get this same error u guys are in terminal.

Me too With At&t Galaxy s2
I am having the same problem, any known fixes?

I was having the same "claiming interface error" and so I tried reinstalling as suggested in one of the posts. When I reinstalled, I noticed a message saying /System/Library/Extensions/Heimdall.kext wasn't properly installed, so after the installation completed, I restarted and deleted the kext file then reinstalled. After that, everything worked correctly.

everkleer said:
I was having the same "claiming interface error" and so I tried reinstalling as suggested in one of the posts. When I reinstalled, I noticed a message saying /System/Library/Extensions/Heimdall.kext wasn't properly installed, so after the installation completed, I restarted and deleted the kext file then reinstalled. After that, everything worked correctly.
Click to expand...
Click to collapse
How did you uninstall and reinstall the kext file?
Sent from my SAMSUNG-SGH-I777 using XDA App

I had the same problem. I reinstalled heimdall 1.3.1 and rebooted. Worked like a charm.

I'm getting this error on OS X 10.6.8 and can't resolve it. I've reinstalled heimdall multiple times, both from the .dmg and from source. Nothing seems to help.
Regarding the error about /System/Library/Extensions/heimdall.kext, I've noticed that the installer apparently installs it owned by your current user and group. You can verify this causes the error by attempting to load it manually with the command:
Code:
sudo kextload /System/Library/Extensions/heimdall.kext
It will give the dialog that people have been seeing, plus an error on the command line about permissions. Running the following commands fixes it, allowing the previous command to work succesfully:
Code:
sudo chown -R root:wheel /System/Library/Extensions/heimdall.kext
I still have no idea what is causing my errors, though. My only idea is that maybe it is yet another permissions issue that I haven't tracked down, possibly with libusb.
If anyone has any advice, please let me know. Otherwise, I will keep poking and if I by some chance figure it out, I will post here.

i had so many issues with heimdall that i just pulled out my old vista laptop and got her done in no time! heimdall is a cluster if you ask me

Fixed Heimdall "Claiming Interface Failed!" error!
Ok, I have a solution for the interface error. After considering the fact that the one step had permissions issues, it eventually occurred to me that, maybe, just maybe the rest of the issues are all permissions related as well. That said, if you install the heimdall-1.3.1-mac.dmg as root, it works flawlessly.
Open an OS X terminal, then (assuming you downloaded the .dmg to Downloads) type the following commands:
Code:
$ cd ~/Downloads
$ sudo open heimdall-1.3.1-mac.dmg
Enter your password then go through the setup normally. You should not see any errors, including the one about heimdall.kext, it will reboot, and it should work.
NB: If you have your phone plugged in in download mode and restart your computer, you may need to restart your phone and re-enter download mode for heimdall to detect it.
Hope this helps!

Related

Firekit LiveUSB repair kit 1.1- when you're about to kill Windows

What it is
Firekit combines all the command line tools for Kindle Fire recovery with the Ubuntu LiveUSB. All you need is a USB stick and a PC that can boot off it. All files stay on the stick, so nothing on your PC is changed.
Firekit is run from the command line, but there are scripts to automate common tasks so the typical restoration involves running just two commands. A fastboot-bootable TWRP and FFF is included as well as the Rekindle USB boot tools so even the most fubared bricks can be restored.
This is only for the first gen Kindle Fire 7" from late 2011. It will not work on any other model.
What can it do
Fix power on problems: If the Fire's screen never seems to turn on, you may have wrecked the bootloaders or the partitioning. Fortunately most of the time this results in the CPU falling into the low level USB boot mode. Use the "usb_fix_parts_and_install_fff_twrp" to rebuild the flash enough to boot TWRP. You don't need to use the USB shorting trick for this one, just power up the Kindle after running the script.
Fix stuck-at-triangle-logo: This can be due to being stuck in fastboot or having a corrupt /system. First try getting into recovery. Press power for a few seconds just after turning on, LED should go orange and the TWRP should show up. If that works, reflash your ROM from TWRP. If not, try the "normal_boot" script to get out of being stuck in fastboot.
Fix stuck-at-Kindle Fire-logo: Similar to the above. First try the "normal_boot" script. If that doesn't work, you need to reflash the stock ROM from TWRP. But you don't have TWRP. So use the "install_fff_twrp_from_stock" script which will force the stock ROM into letting you install fastboot. Then flash a ROM.
-and more
Why
A lot of people seem to be having problems with Windows and ADB drivers needed for fastboot and adb. Linux doesn't seem to have this kind of trouble, so I threw this together. It's not pretty or menu driven, but I find that too much automation gets in the way when things are broken to begin with.
Downloading a ~600MB Ubuntu image is needed, and this has only been tested on one PC so far. Don't complain if you spend hours grabbing this only to not have it fix your problem. I thought about rolling my own USB image with debootstrap for a much smaller image but figured that a prefab Ubuntu Live image is probably best for compatibility.
Using Firekit
Making the LiveUSB
Get the latest 32-bit Ubuntu and follow the directions to make a USB stick. If you want to try this with another distro (not tested) it must be 32-bit or have full 32-bit compatibility libraries.
Then unpack the attached zip to the top of the stick. The easiest way is to open the .zip in Explorer, right-click on "fk" (the only file in the zip), and choose "Send to..."->your USB stick's drive letter. You may have to unplug and replug the stick for Windows to see the drive after Ubuntu's been installed. If you have anything else you want available on the stick (roms, other recovery/bootloader, etc) copy them here as well. When done, eject the drive.
Before Booting
Set your PC's BIOS to boot USB before your internal drive. Each PC is different, so it's up to you to figure out how to set your PC to boot from USB.
Running the tools
Always start with your Kindle turned off and unplugged from USB. These directions assume that your Fire is stuck in fastboot, has FFF installed, or you are using the USB boot shorting trick. The exception is if you're trying to install FFF/TWRP from stock Kindle OS, in which case leave it booted and plugged in.
Now boot the LiveUSB. Once the Ubuntu desktop shows up, click the Ubuntu logo in the top left (or press the Windows key) and type "term". Hit enter to run the terminal.
In the terminal window, type "sudo /cdrom/fk". This unpacks the tools and sets up your environment. You should now have a prompt that says "[email protected]:~/firekit#"
A list of the possible scripts should now be showing. Type the name of the script you want and hit enter. Protip: type a few letters and hit tab to autocomplete the rest of the word. If you're using any of the usb_ scripts, short the test point and plug in the Fire. As mentioned before, you should have the Fire already booted when using "install_fff_twrp_from_stock". For all the other commands, just plug the Fire in.
If this keeps you from returning or junking an otherwise good Fire, consider throwing a thanks or a beer my way.
Props to TeamWin & agraben for TWRP, everyone at Canonical
These are the commands as of 1.1:
install_fff_twrp_from_stock: Install FFF and TWRP while in stock Android. Uses fbmode to reboot. Use this to get FFF/TWRP installed on 6.2.1 stock OS.
install_fff_twrp: Install FFF and TWRP while in fastboot. Good if you're stuck in fastboot and you want FFF/TWRP.
fix_parts Restore partition table to stock while in fastboot. Do this if you're in fastboot and your partition table is screwed up.
normal_boot: Set the bootmode to boot android and reboot while in fastboot. Try this if you're stuck at the Kindle Fire logo.
usb_boot_twrp: USB boot TWRP without installing. Boot TWRP if your Kindle black screens when you try to power it on. Needs the USB boot mode trick.
usb_install_fff_twrp: USB boot FFF, install FFF and TWRP. Install / recover the bootloader and recovery if they are broken. Needs the USB boot mode trick.
usb_fix_parts_and_install_fff_twrp: USB boot FFF, restore partition table to stock, install FFF and TWRP. Fix everything if you screwed up the partition table and your Fire's screen no longer turns on. Needs the USB boot mode trick.
Changelog:
1.1:
-Add restore of mmcblk0p1 (x-loader) to the "usb_fix_parts_and_install_fff_twrp" script to recover from total brain damage. Thanks to TyHi for proving this works and may be necessary.
1.0:
-Initial release
(todo: make videos, integrate usb boot mode instructions)
Thanks for the compilation of tools and directions. Rolling up your own image with debootstrap is probably more trouble then it's worth; the images provided by Canonical might be larger -- but they will pretty much work on *.
This is very interesting. I never really was interested in learning about Ubuntu but if it saves me worry about finally getting around to flashing FFF & TWRP then it's worth a shot.
This is a very, very good idea. I spent a long time trying to get the drivers working on Windows, it seems that the ones packaged with the latest KFU are FUBAR.
Maybe you could package this with a minimal Ubuntu install, or another distro? For something with such a simple purpose Ubuntu is mighty bloated.
The sdk version of adb has trouble on windows too. Linux : for those who want their computer to work for them, not the other way around.
Sent from my DROID2 using xda premium
yumcax said:
This is a very, very good idea. I spent a long time trying to get the drivers working on Windows, it seems that the ones packaged with the latest KFU are FUBAR.
Maybe you could package this with a minimal Ubuntu install, or another distro? For something with such a simple purpose Ubuntu is mighty bloated.
Click to expand...
Click to collapse
Ubuntu is a known quantity, and Canonical does all the hard QA work making sure it runs on the largest swath of hardware. I put this together to be a sure thing for people having trouble in other environments, and trying to streamline the OS may compromise that.
pokey9000 said:
What can it do
These are the commands as of 1.0:
install_fff_twrp_from_stock: Install FFF and TWRP while in stock Android. Uses fbmode to reboot. Use this to get FFF/TWRP installed on 6.2.1 stock OS.
Click to expand...
Click to collapse
Sorry for noob questions
1. This means that it will unstall FFF and TWRP without any other downloads, or I should put another files in USB (along with attached one) It will work with 6.2 OS?
2. Should I been rooted first?
And
3. Any root method for ubuntu from USB?
Once more, sorry to ask noobs questions in developers forum
Edit:
I find answer for 3rd question here
Hello,
I have my unbuntu on a bootable usb and I have the extracted kf file on the root folder right where terminal opens up to... so in the terminal I do "sudo fk" and "sudo /fk" and it just gives me command not found, could somebody give me a little help? I'm not a linux noob but I am no pro either.
bigjkcfan said:
Hello,
I have my unbuntu on a bootable usb and I have the extracted kf file on the root folder right where terminal opens up to... so in the terminal I do "sudo fk" and "sudo /fk" and it just gives me command not found, could somebody give me a little help? I'm not a linux noob but I am no pro either.
Click to expand...
Click to collapse
sudo ./fk
"sudo /fk" doesn't work because I'm guessing your file is located in /root/fk, and "sudo fk" doesn't work because executables without a path prefix are assumed to be in the $PATH, and most of the time /root and the current directory ("./") aren't in the $PATH.
Ah, I got it! the permissions needed to be changed, then I ran the sudo ./fk and it worked, thanks!
Alright here is my situation. When trying to revert to stock my brother's kindle got very screwed up, adb shell does not work at all, adb works just fine though. So I bought a factory cable and now once I do the boot sequence with that in windows adb does not recognize anymore, actually in windows it just says unknown device. So it has to be in fastboot mode, yet now that I figured this linux stuff out, it still says waiting for device when trying to install twrp. Is my brother's kindle really screwed up?
bigjkcfan said:
Ah, I got it! the permissions needed to be changed, then I ran the sudo ./fk and it worked, thanks!
That makes since to me, but my computer must hate me... here is from a brand new terminal window that I had opened.
[email protected]:~$ dir
Desktop Documents Downloads fk Music Pictures Public Templates Videos
[email protected]:~$ "sudo ./fk"
bash: sudo ./fk: No such file or directory
Click to expand...
Click to collapse
Don't include the quotes...
Anyone trying to develop for the Kindle Fire should make this. It really saved me in a pinch.
Hi,
I'm running off ubuntu in a USB stick, and every time I type "sudo ./fk" I get the following error messages:
[email protected]:/cdrom$ sudo /cdrom/fk
tar: firekit: Cannot mkdir: Input/output error
tar: firekit/twrp2-blaze.img: Cannot open: Input/output error
tar: firekit/install_fff_twrp: Cannot open: Input/output error
5837+1 records in
5837+1 records out
5977554 bytes (6.0 MB) copied, 0.636875 s, 9.4 MB/s
tar: firekit/u-boot.bin: Cannot open: Input/output error
tar: firekit/usb_install_fff_twrp: Cannot open: Input/output error
tar: firekit/aboot.bin: Cannot open: Input/output error
tar: firekit/normal_boot: Cannot open: Input/output error
tar: firekit/fastboot: Cannot open: Input/output error
tar: firekit/install_fff_twrp_from_stock: Cannot open: Input/output error
tar: firekit/adb: Cannot open: Input/output error
tar: firekit/mmcblk0p1: Cannot open: Input/output error
tar: firekit/usb_fix_parts_and_install_fff_twrp: Cannot open: Input/output error
tar: firekit/usb_boot_twrp: Cannot open: Input/output error
tar: firekit/fbmode: Cannot open: Input/output error
tar: firekit/adb_usb.ini: Cannot open: Input/output error
tar: firekit/usbboot: Cannot open: Input/output error
tar: firekit/fix_parts: Cannot open: Input/output error
tar: Exiting with failure status due to previous errors
mkdir: cannot create directory `/root/.android': Input/output error
cp: accessing `/root/.android/.': Input/output error
Stopping any running adb servers...
/cdrom/fk: line 18: adb: command not found
/cdrom/fk: line 20: cd: /root/firekit: Input/output error
Done. Tools are in /root/firekit. Files copied to USB are likely in /cdrom
Scripts:
install_fff_twrp_from_stock - install FFF and TWRP while in stock Android
install_fff_twrp - install FFF and TWRP while in fastboot
fix_parts - restore partition table to stock while in fastboot
normal_boot - set the bootmode to boot android and reboot while in fastboot
usb_boot_twrp - USB boot TWRP without installing
usb_install_fff_twrp - USB boot FFF, install FFF and TWRP
usb_fix_parts_and_install_fff_twrp - USB boot FFF, restore partition
table to stock, install FFF and TWRP
Good luck. -pokey9000
Is there a system setting I should set to enable r/w? Thanks.
This totally saved my ass today. And my Fire. I figured it was a brick but between this kit and the breakout kit it's back up and running. Stock. Many thanks!
I booted ubuntu fine and was able to get the terminal to boot the program, however when I try to run one of the commands, im getting a 'no such file or directory' with the kindle plugged in.
im a super ubuntu noob...
ive got the live usb done and i can get into the os but once i get into the terminal im at a loss for words of how monkey f***** i am..
every time i try sudo/cdrom/fk i get no directory
same with any other command i get.
i put the fk file directly on the live usb anyone care to break down the terminal a lil better or maybe give advice on a better place to put the fk file
Indebted
I am really grateful that you decided to share this wonderful unbricking method with us. I just successfully unbricked my kindle after a bad bootloader flash.
Thanks!
Here are some pointers for those still stuck with a brick:
- I followed DirectFix's video on Kindle teardown to get off the back cover.
- Then I setup pokey9000's Firekit on my Ubuntu 12.04 ( change file fk's permission to make it executable). After that I ran the script 'usb_fix_parts_and_install_fff_twrp' and at 'waiting for OMAP44xx device...' I did the shorting and plugging in. (I had already setup adb earlier) (USB cable was plugged in the computer from the start of this process; but not in the Kindle)
- I used a spare thin wire lying around, shaved both ends and put one end on the metal casing and then put kindle's back cover on top of it to hold it in place. This way I had both hands free to short the point. Then plug in the usb. (Make sure USB is plugged in the computer from the very beginning) (Also make sure kindle is really off; do a hard reset prior to this step just in case)
I can second that. the said method did not work off my ubuntu 12.04 (i think it was my personal setup) but i followed the linked instructions on using a pendrive and it worked 1st time. i suggest follow the instructions exactly.
thanks again pk9 and anyone else that helped me in my 48 hour bricking session
Sent from my Amazon Kindle Fire using xda premium
i think you are doing the terminal ok. you needed to extract the fk file to your pendrive ie. when you open pendrive you should see lots of files associated with the fire kit & not just one file (fk).
Sent from my Amazon Kindle Fire using xda premium
My Kindle is bricked.
I ran the Kindle Fire Utility 0.95, followed steps in the first post, installed drivers fine, then rooted it. It turned off, and now will not turn on. I've tried charging it, pressing and holding the button 100 times for varying lengths.. nothing.
My question is, what are my options now? I was thinking of doing the Firekit LiveUSB repair kit short trick.. but that will for sure void the warranty. Is there any possibility of me returning the Kindle as is right now? It's only 2 days old.
Any advice would be most certainly appreciated, because I'm pretty f**ked right now.
I'm trying to run your utility, but am a little confused. At first it says:
Fix power on problems: If the Fire's screen never seems to turn on, you may have wrecked the bootloaders or the partitioning. Fortunately most of the time this results in the CPU falling into the low level USB boot mode. Use the "usb_fix_parts_and_install_fff_twrp" to rebuild the flash enough to boot TWRP. You don't need to use the USB shorting trick for this one, just power up the Kindle after running the script.
But then down below it says "Needs usb shorting trick".. which is it?

"Claiming interface failed" when using Heimdall on a Mac

Well, this is extremely frustrating.
I've downloaded Heimdall 1.4RC1 for my T999, and upon following instructions exactly down to the letter, I get met with "Claiming interface failed" when trying to flash CWM on my phone. I've asked just about everywhere and searched on Google, with every source telling me to unload drivers associated with Samsung Kies, which I have never installed. All I have is my mac (running OS X 10.8.2), so "finding someone with a windows computer" is not an option. Is anyone here using Heimdall 1.4RC1 on OS X and experienced this issue? I would love some help here, as I've been sitting here for hours trying to understand what is going on.
If anyone is having the same issue, I solved it, as the instructions on the CyanogenMod website makes no mention of installing the Heimdall kext for OS X. Upon loading the kext, I was able to access the device the next time I ran Heimdall. Cheers.
chyback which
mofogx said:
If anyone is having the same issue, I solved it, as the instructions on the CyanogenMod website makes no mention of installing the Heimdall kext for OS X. Upon loading the kext, I was able to access the device the next time I ran Heimdall. Cheers.
Click to expand...
Click to collapse
I'm just having the same problem. Where can I get the kext? The Heimdall zip for 1.4RC1 does not include it.
Thanks!
EDIT: OK, I got it from Heimdall's github page.
mofogx said:
If anyone is having the same issue, I solved it, as the instructions on the CyanogenMod website makes no mention of installing the Heimdall kext for OS X. Upon loading the kext, I was able to access the device the next time I ran Heimdall. Cheers.
Click to expand...
Click to collapse
OK, so I installed the kext and loaded it and still getting the same Claiming interface failed error.
EDIT: OK, unloaded Kies kexts and now it worked, thanks.
Yeah, I want to see if I can edit the instructions on CyanogenMod, as they make no mention of loading Mac kext modules, which could cause a lot of problems.
I'm glad I was able to figure it out, because the internet is an impossible place to get help, especially when it involves macs. You wouldn't believe how many times I was told to give up and find someone with a windows machine.
I'd do it, but I rather solve the problem in my hands than to run off towards the perceived easier solution.
If you are still having trouble, try this on your mac´s terminal
it will kill kies.....
$ sudo kextunload -b com.devguru.driver.SamsungComposite
$ sudo kextunload -b com.devguru.driver.SamsungACMData
$ sudo kextunload -b com.devguru.driver.SamsungACMControl
bolio said:
If you are still having trouble, try this on your mac´s terminal
it will kill kies.....
$ sudo kextunload -b com.devguru.driver.SamsungComposite
$ sudo kextunload -b com.devguru.driver.SamsungACMData
$ sudo kextunload -b com.devguru.driver.SamsungACMControl
Click to expand...
Click to collapse
This only works, however, if you had kies installed in the first place. If you're flashing roms, the best thing to do would be to remove kies completely.

[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:
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.
Click to expand...
Click to collapse
Onto the magic..
1. Download CF-Root by Chainfire here: http://forum.xda-developers.com/showthread.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*)
Click to expand...
Click to collapse
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!
Click to expand...
Click to collapse
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
didadi said:
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
Click to expand...
Click to collapse
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.
theexel said:
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.
Click to expand...
Click to collapse
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.
Try using sudo before the heimdall command.
sudo heimdall flash ....
theexel said:
Try using sudo before the heimdall command.
sudo heimdall flash ....
Click to expand...
Click to collapse
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
Glad you got it sorted!
Sent from my SGH-M919 using Tapatalk 4
theexel said:
Glad you got it sorted!
Sent from my SGH-M919 using Tapatalk 4
Click to expand...
Click to collapse
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.
nyloxy said:
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.
Click to expand...
Click to collapse
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. :good:
If you want me to check it out for you and write a tutorial, I'll be more than happy to me.
theexel said:
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. :good:
If you want me to check it out for you and write a tutorial, I'll be more than happy to me.
Click to expand...
Click to collapse
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! :victory:
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!
Just 3 big steps.
1.Download and install Heimdall: http://www.glassechidna.com.au/products/heimdall/
2. Install libusbx. You need to download the sources and compile them. Usual ./configure, make , make install.
Use sudo su and then compile.
you may have to do , sudo apt-get install libudev-dev before compiling the libusbx libs.
3.Onto the magic..
..as said in post 1....
Make sure to use sudo for the heimdall flash ...Needless to say use the caps.!
Then install cwm from the Google Play and then you are Golden.
Thank you again to theexel for quick replies thru my earlier posts.:good:
Added a fix for a possible error:
If you receive this error message:
Initialising connection…
Detecting device…
Claiming interface…
ERROR: Claiming interface failed!
Can somebody make a video on how to do this?
This sounds confusing and I don't wanna brick my phone lol
I'm willing to donate to whoever does a video!
So will this wipe my phone?
[email protected] said:
So will this wipe my phone?
Click to expand...
Click to collapse
No. It will only root your phone.
flemingg said:
There is nothing can be done without the libraries files.
Click to expand...
Click to collapse
Library files?
Noob help with installing libusbx?
Hi Guys,
First off kudos and many thanks Exel for posting this. Also, sorry to bug you all with such a noob question but may I bother someone to post the exact commands/syntax for installing libusbx on/in mac os x 10.8.x? I've tried looking online and may not be using the right keywords to get the information I need.
Thanks loads for all the help you guys,
nv_gck
Re: Noob help with installing libusbx?
NV_GCK said:
Hi Guys,
First off kudos and many thanks Exel for posting this. Also, sorry to bug you all with such a noob question but may I bother someone to post the exact commands/syntax for installing libusbx on/in mac os x 10.8.x? I've tried looking online and may not be using the right keywords to get the information I need.
Thanks loads for all the help you guys,
nv_gck
Click to expand...
Click to collapse
Hi Guys,
Please ignore my last request. I figured it out from the INSTALL file in the libusbx source code. Also, I did it without installing the full Xcode IDE on my Mac, just the Xcode terminal tools. Have successfully rooted.
Thanks again Exel
NV_GCK said:
Hi Guys,
Please ignore my last request. I figured it out from the INSTALL file in the libusbx source code. Also, I did it without installing the full Xcode IDE on my Mac, just the Xcode terminal tools. Have successfully rooted.
Thanks again Exel
Click to expand...
Click to collapse
Glad you got it working!
It would really be worth it to mention that you actually have to compile libusbx from source. I spent a half hour Googling before coming to this realization.
Hey there fellas, spent the last couple hours trying to get this to work and keep getting hung up in terminal here,
Code:
Invalid argument: folder/recovery.img
Any help?

ADB Sideload Cannot Read Issue, Searched Nothing worked

I am unable to flash anything even official firmware with official recovery, when in adb sideload mode. whenever i try to push a zip to install terminal says:
C:\Users\nd4ios\Desktop>adb sideload a.zip
loading: 'a.zip'
* cannot read 'a.zip' *
the file is named a.zip
it is in the Desktop folder
ive tried doing this like this:
Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.
C:\Windows\system32>adb sideload C:\Users\nd4ios\Desktop\a.zip
loading: 'C:\Users\nd4ios\Desktop\a.zip'
* cannot read 'C:\Users\nd4ios\Desktop\a.zip' *
C:\Windows\system32>
but same issue
ive tried reinstalling the drivers -(adb, fastboot, and device)-
no avail
ive also tried moving the zip file to the system32 folder and still same error. ive tried multiple zips and nothing.
Ive looked at the ram - practically no ram usage on my pc
ive tried installing twrp recovery but it never can boot into it - just turns to black screen and stays there. (tried multiple different versions of twrp)
ive looked online for help and nothing has helped so far which is why im turning to here.
use this ADB . Yours is old
here
also use TWRP Recovery 3.0.2-1.28 if you are on Oxygen OS Open beta or 4.0 ( N)
it's a windows problem .. a simple restart will solve it ..
not windows probem but probably driver
Go to Computer/Devic manager /Kedacom USB devices or something similar...
change adb driver to ADB generic
thanks, well i was finally able to install the previous firmware via booting and transfering the zip file to the internal storage and installing it from there. so it was a windows problem or driver. im installing this now and hope it fixes it for the future.
I had the same problem with my computer not recognizing my phone with trying to transfer file and flash joints. I went to device manager > right click mtp > update driver software > browse my computer > let me pick > mtp USB device > happy me ??
ok well ive tried using the adb drivers you mentioned and it is still coming up with the same error, so im going to try booting into linux and trying it from there
It's because the ADB executable isn't large address aware and so it fails to allocate memory when you're trying to sideload something big (>1GB) like the OOS 4.0 for our OnePlus 3. You need an ADB that's been made large address aware or you can do it yourself if you have Visual Studio installed on your machine. I'd provide it myself but I've already sworn off posting files here.
i have Visual Studio Enterprise - i got it from being a student, so how would i go about making the adb large address aware? thanks
i found an app online to convert the adb to 64bit and see if that works on it.
ok so what you said is the issue, apparently my adb is not large address aware, as i tried pushing a zip file under a 1GB and it worked but when i push a file over it says it cannot read.
now if only if there was a thanks button so i could add a thank you
ok ive finally got it to work
heres what i did:
i used the original adb.exe in my C:\adb folder
then i right clicked the program and clicked properties and under compatability i chose run as administrator (probably dont need to do this but did it as an extra)
then used https://www.techpowerup.com/forums/threads/large-address-aware.112556/ to convert it to 64bit to allow for long address awareness. and viola it works.
also a side note:
does not work on the minimal adb and fastboot.exe adb program

Question How to install factory image using Linux

Hey guys,
I was trying to update while keeping root and made a mistake. i don't think my phone is hard bricked, as it does boot, it just never actually reaches the stock
When device boots, it says "device is corrupt, it can't be trusted and may not work properly". This happened after I tried to utilize the Master-Root.img file. Not sure exactly how this happened, I will investigate later, but right now trying to get something on my phone (right now it just doesn't boot past the error message I just mentioned)
I looked online, and I've heard methods about using a flash-all.bat and flash-all.sh file within the factory image. However, I'm using linux, not windows, these files so not seem to work.
for the record:
bootloader is unlocked
phone was rooted prior to this happening
i don't deny i made some kind of mistake that resulted in this happening, i just don't know what yet. i will investigate, but right now just trying to recover my phone. there does not appear to be an OS on it, or it is corruped
i will post any images that are needed, im just under a time constraint
i have the factory image on my computer already. what do i need to do to get this installed? i looked up tons of guide, but it only seems to be applicable for windows.
thanks so much in return btw!
You can use Android Flash Tool. Flash-all.sh should work on LInux as well. But Android Flash Tool is probably the easiest way.
Lughnasadh said:
You can use Android Flash Tool. Flash-all.sh should work on LInux as well. But Android Flash Tool is probably the easiest way.
Click to expand...
Click to collapse
is Android Flash Tool a windows only program? or does this work on Linux too? because linux is all i have at the moment.
pojr said:
is Android Flash Tool a windows only program? or does this work on Linux too? because linux is all i have at the moment.
Click to expand...
Click to collapse
Yes, supports Linux.
Android Flash Tool | Android Open Source Project
source.android.com
Lughnasadh said:
Yes, supports Linux.
Android Flash Tool | Android Open Source Project
source.android.com
Click to expand...
Click to collapse
Thanks so much. I will try this out. For the record, I actually did go into flash-all.bat and I noticed the individual terminal commands it wanted me to put in. So I tried putting them in manually, but after I finished the commands and rebooted the phone, I still received the same message "device is corrupted, it can't be trusted".
I will still try the tool that you linked though, but I'm nervous it won't help because I tried running the commands individually that were within the flash-all file.
Later on I will go into more detail on what I mean, but I'm at work right now and I don't have a lot of time to type.
pojr said:
I looked online, and I've heard methods about using a flash-all.bat and flash-all.sh file within the factory image. However, I'm using linux, not windows, these files so not seem to work.
Click to expand...
Click to collapse
I'm on linux (fedora) and the flash-all.sh script will work, but you have to ensure adb and fastboot drivers are installed system-wide or you run your terminal from platform-tools. If you want to be able to run the script from any directory, you'll have to edit your bash config to point to the directory of your platform-tools. You may also need to edit your udev rules.
Bash
sudo nano .bashrc
export PATH=${PATH}:/home/YOUR-USERNAME/path/to/adb
udev Rules
See github page for instructions, assuming your distro requires it.
Linux Fix Fastboot "no permissions, verify udev rules"
Linux Fix Fastboot "no permissions, verify udev rules" - fbootfix.md
gist.github.com
Edit: If you're on any distro with an up-to-date version of android-tools, you can install the package and it will automatically install the adb/fastboot drivers system-wide and you can skip the above manual process. Otherwise, if android-tools is too old, fastboot won't work and the shell script will end abruptly as it's out-of-date compared to the most recent A12 or A13 builds.
pojr said:
Thanks so much. I will try this out. For the record, I actually did go into flash-all.bat and I noticed the individual terminal commands it wanted me to put in. So I tried putting them in manually, but after I finished the commands and rebooted the phone, I still received the same message "device is corrupted, it can't be trusted".
I will still try the tool that you linked though, but I'm nervous it won't help because I tried running the commands individually that were within the flash-all file.
Later on I will go into more detail on what I mean, but I'm at work right now and I don't have a lot of time to type.
Click to expand...
Click to collapse
One method to get rid of the corrupt message that has worked for people is to flash the boot image from the prior month in fastboot (it will likely not boot) and then flash your current boot image.
Lughnasadh said:
One method to get rid of the corrupt message that has worked for people is to flash the boot image from the prior month in fastboot (it will likely not boot) and then flash your current boot image.
Click to expand...
Click to collapse
I will try that as a last resort (if all else fails)
To go into more detail, when I opened up terminal, I migrated to the folder that has the flash-all files (both the .bat and .sh) by typing "cd [folder name]", however I didn't know how to run those scripts in terminal, even after googling. So I opened the .bat file in text editor and notice the script had 3 or 4 fastboot commands.
Since I couldn't get flash-all file to run on its own, I tried manually typing in fastboot commands right into the terminal. The first fastboot commands seems to run without any problems, but then the final fastboot command seems to have issues. While it ran, they were a bunch of files it could not find. But still, it didn't give a error or anything. So once the three or four fast food commands were ran, then I rebooted the device, and still received the "device is corrupted, device cannot be trusted" error.
Still haven't downloaded that program you linked to yet, I apologize. I have to wait until lunch to try this because I'm at work. Don't you hate it when you're running to issues right before work? Haha.
pojr said:
To go into more detail, when I opened up terminal, I migrated to the folder that has the flash-all files (both the .bat and .sh) by typing "cd [folder name]", however I didn't know how to run those scripts in terminal, even after googling. So I opened the .bat file in text editor and notice the script had 3 or 4 fastboot commands.
Click to expand...
Click to collapse
Use the batch file (.bat) on windows and use the shell script (.sh) on linux. They both execute the same commands based on the OS.
To run the shell script from terminal, type:
sh flash-all.sh
lottarake said:
Use the batch file (.bat) on windows and use the shell script (.sh) on linux. They both execute the same commands based on the OS.
To run the shell script from terminal, type:
sh flash-all.sh
Click to expand...
Click to collapse
thank you. i just tried this. says "fastboot too old; please download the latest version at https://developer.android.com/studio/releases/platform-tools.html"
not a problem. you did mention i need to install the latest platform tools. so i did, and tried again. same error message, fastboot too old. now i'm on the latest platform-tools, so not sure why i'm receiving that message.
currently installing android flash tool right now. having difficulties because (for some reason) chrome is required. i'm on firefox. but i will update once it's all installed. thanks again for the support btw.
Update: On the android flash tool right now. So far I like what is happening. Didn't realize how easy this is. I am a little concerned though, because while the site appears to be working as intended, my phone is still on the fastboot screen with nothing on it, but that might be normal. I'll keep waiting and see what happens.
pojr said:
thank you. i just tried this. says "fastboot too old; please download the latest version at https://developer.android.com/studio/releases/platform-tools.html"
not a problem. you did mention i need to install the latest platform tools. so i did, and tried again. same error message, fastboot too old. now i'm on the latest platform-tools, so not sure why i'm receiving that message.
currently installing android flash tool right now. having difficulties because (for some reason) chrome is required. i'm on firefox. but i will update once it's all installed. thanks again for the support btw.
Click to expand...
Click to collapse
If the latest adb/fastboot drivers aren't system-wide and you're running the commands from any other directory other than from the platform-tools folder, you'll get the out-of-date error. If you want to run it from the directory, make sure to add "./" (without quotes) before adb/fastboot.
Example:
./adb devices
If you edit your bash config to point to the new platform-tools folder, it'll execute adb/fastboot from the latest you've downloaded as system level versus what was installed on your OS previously.
lottarake said:
If the latest adb/fastboot drivers aren't system-wide and you're running the commands from any other directory other than from the platform-tools folder, you'll get the out-of-date error. If you want to run it from the directory, make sure to add "./" (without quotes) before adb/fastboot.
Example:
./adb devices
If you edit your bash config to point to the new platform-tools folder, it'll execute adb/fastboot from the latest you've downloaded as system level versus what was installed on your OS previously.
Click to expand...
Click to collapse
Thank you. I will look into that.
So at the moment, I'm running the Android flash tool. Seems to be pretty straightforward, but the download keeps starting over. Is that supposed to happen? Or is there something wrong? My apologies if I'm sounding like an idiot right now
pojr said:
Thank you. I will look into that.
So at the moment, I'm running the Android flash tool. Seems to be pretty straightforward, but the download keeps starting over. Is that supposed to happen? Or is there something wrong? My apologies if I'm sounding like an idiot right now
Click to expand...
Click to collapse
Not quite sure the reason it's restarting tbh. It should only download the zip once and then proceed to flash as long as it's properly connected to the phone. When using the Android Flash Tool, I stick to Chrome since it seems to work properly for me. I haven't tested it with Firefox yet. You could always reset the adb access to Firefox by disconnecting the phone and closing the browser, then from terminal run "adb kill-server" before reconnecting and granting adb to Android Flash Tool again.
lottarake said:
Not quite sure the reason it's restarting tbh. It should only download the zip once and then proceed to flash as long as it's properly connected to the phone. When using the Android Flash Tool, I stick to Chrome since it seems to work properly for me. I haven't tested it with Firefox yet. You could always reset the adb access to Firefox by disconnecting the phone and closing the browser, then from terminal run "adb kill-server" before reconnecting and granting adb to Android Flash Tool again.
Click to expand...
Click to collapse
I'm on Chrome now. I think it might just be poor USB connection. I moved it to a safer position, so hopefully that will fix the problem. Seems like it's installing now. I'm having some really bad luck today lol.
Good news. I checked my phone just now, it is now booted without any issues. Thank god. Long story short, I ran into some issues trying to perform an OTA update while keeping root access, but ran into issues while following the directions. So I started troubleshooting the problem and went a little too far with it. Thanks so much @lottarake and @Lughnasadh for helping me out.
Not sure if the OS will remain on there if I reboot the device. I assume so, because the OS was installed, not just flashed.

Categories

Resources