12

I have downloaded .img file for TWRP recovery. How I should use it with Heimdall? It seems that Heimdall accepts .gz files (or .pit files in older versions), not .img!

I've tried opening an .img file and Heimdall complained

Tar header contained an invalid file size

Opening a .tar file led to

firmware.xml is missing from the package

2
  • 1
    where do i fine that recovery.img file? Link please
    – Nabin
    Commented May 24, 2016 at 14:04
  • Where we can download reliable image or any other firmare for sansung galaxy S3? Commented Jan 25, 2019 at 11:07

3 Answers 3

6

If you use Linux - download heimdall-frontend so you can use GUI. It is much easier.

To flash using Heimdall you first need to specify .pit file.

.pit stands for Partitions Information Tables, so Heimdall knows where it need to flash it.


To flash TWRP using Heimdall follow this steps:

  1. Open Heimdall frontend.
  2. Go to Utilities tab.
  3. You will see Download PIT. Go Save As and save it on some location.
  4. Go to Flash tab.
  5. In PIT category, click Browse and select PIT file you downloaded from device in step 3.
  6. Click Add button.
  7. For partition name select where you want to flash it. BE CAREFUL! If you flash it on wrong partition you can perma-brick device. On my device for recovery it is Kernel2.
  8. Go Browse for file and select .img file.
  9. In Session let everything unchecked.
  10. Click Start.

Note1 : REPARTITION MUST STAY UNCHECKED!!!
Note2: This can brick device, be careful, here on site, we do NOT hold responsibility for your device.
Note3: If you're on Windows, just use Odin...

2
  • where do i fine that recovery.img file? Link please
    – Nabin
    Commented May 24, 2016 at 14:04
  • @NabinKhadka for example, inside a .tar file one can download (also called pda files). each of the contained files needs to be mapped to the exact parition name.
    – phil294
    Commented Aug 2, 2017 at 21:45
16

Newer versions of Heimdall will accept a .img file for the --RECOVERY parameter and automatically download a PIT from the device to add the img contents to.

$ heimdall flash --RECOVERY recovery.img 
Heimdall v1.4.1

[trimmed some output here]

Session begun.

Downloading device's PIT file...
PIT file download successful.

Uploading RECOVERY
100%
RECOVERY upload successful

Ending session...
Rebooting device...
Releasing device interface...
Re-attaching kernel driver...
5
  • where do i fine that recovery.img file? Link please
    – Nabin
    Commented May 24, 2016 at 14:03
  • 1
    @NabinKhadka, you must find the right .img based on your phone. Try searching on XDA-Developers or google for the recovery image for your phone.
    – Matt
    Commented May 25, 2016 at 2:38
  • @Sparr Where did you get v.1.4.1 of Heimdall, please? V1.4.0 doesn't support flash --RECOVERY and there is no later version on bitbucket.org/benjamin_dobell/heimdall/downloads, except for Mac (which I don't have).
    – Mark Smith
    Commented Oct 1, 2016 at 11:50
  • I'm on Mac. And I don't remember, sorry.
    – Sparr
    Commented Oct 1, 2016 at 20:38
  • how to select slot on command line?
    – alecxs
    Commented Feb 2, 2020 at 17:46
1

A image file does not really need heimdall. Most devices that update via a .img file allow you to just put it on internal storage and rebpot to update. An alternative is to move it to your device, and install it via TWRP by loading the File in it.

2
  • 1
    What if you don't have the TWRP?
    – Anwar
    Commented Aug 20, 2016 at 8:00
  • 1
    @Anwar Then you can use heimdall's device tab (or the fourth tab) and download the .pit from your phone, and build your .IMG around it.
    – Dan Brown
    Commented Aug 20, 2016 at 9:47

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .