Skip to content

Instantly share code, notes, and snippets.

@kevinpapst
Last active August 4, 2025 02:59
Show Gist options
  • Save kevinpapst/2962b66d9528e966ec5b068d2081f6c5 to your computer and use it in GitHub Desktop.
Save kevinpapst/2962b66d9528e966ec5b068d2081f6c5 to your computer and use it in GitHub Desktop.

Revisions

  1. kevinpapst revised this gist Aug 22, 2016. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions flash-android-rom-with-heimdall-on-mac.md
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,8 @@
    # Installing an Android ROM with your Mac via Heimdall
    # Installing an Android ROM with your Mac via Heimdall and bash

    Because every time I want to flash a new ROM, I forgot how I did it the last time.

    Hint for myself: correct Stock ROM for Galaxy S4 I9505XXUHOJ2_I9505OXAHOJ2_I9505XXUHOJ2
    This is how I re-flashed my unbranded Samsung Galaxy S4 (german black edition) with a stock ROM (because Cyanogenmod crashed my phone all the time). The correct Stock ROM for my Galaxy S4 is: I9505XXUHOJ2_I9505OXAHOJ2_I9505XXUHOJ2

    ## Software you need
    - adb
    @@ -41,7 +41,7 @@ Have fun with your new ROM!

    ## Known problems

    ### Stuck at Smasung logo
    ### Stuck at Samsung logo

    Boot into recovery mode *Volume Up + Power + Home* and execute
    - Wipe data / factory reset
  2. kevinpapst revised this gist Aug 22, 2016. 1 changed file with 3 additions and 3 deletions.
    6 changes: 3 additions & 3 deletions flash-android-rom-with-heimdall-on-mac.md
    Original file line number Diff line number Diff line change
    @@ -15,7 +15,7 @@ Hint for myself: correct Stock ROM for Galaxy S4 I9505XXUHOJ2_I9505OXAHOJ2_I9505

    ## Flashing the ROM

    Enter *Download mode* with Power On + Volumne Down or:
    Enter *Download mode* with *Power + Volumne Down* or:
    ```bash
    adb reboot bootloader
    ```
    @@ -58,12 +58,12 @@ heimdall flash --RECOVERY recovery.img

    ### Heimdall "Claiming Interface Failed

    If you have the *Samsung Kies* software installed, this might load some intrusive kernel modules. This is how to find and get rid of them:
    If you have the *Samsung Kies* software installed, this might load some intrusive kernel modules.
    This is how to find and get rid of them:

    ```bash
    kextstat | grep -v apple
    sudo kextunload -b com.devguru.driver.SamsungComposite
    sudo kextunload -b com.devguru.driver.SamsungACMData
    sudo kextunload -b com.devguru.driver.SamsungACMControl
    ```

  3. kevinpapst revised this gist Aug 22, 2016. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion flash-android-rom-with-heimdall-on-mac.md
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,6 @@
    # Installing an Android ROM with your Mac via Heimdall

    Because every time I want to flash a new ROM, I forgot how I did it the last time.
    Now here is finally a written reminder ;-)

    Hint for myself: correct Stock ROM for Galaxy S4 I9505XXUHOJ2_I9505OXAHOJ2_I9505XXUHOJ2

  4. kevinpapst revised this gist Aug 22, 2016. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions flash-android-rom-with-heimdall-on-mac.md
    Original file line number Diff line number Diff line change
    @@ -3,6 +3,8 @@
    Because every time I want to flash a new ROM, I forgot how I did it the last time.
    Now here is finally a written reminder ;-)

    Hint for myself: correct Stock ROM for Galaxy S4 I9505XXUHOJ2_I9505OXAHOJ2_I9505XXUHOJ2

    ## Software you need
    - adb
    - heimdall (brew cask install heimdall-suite)
  5. kevinpapst revised this gist Aug 22, 2016. 1 changed file with 19 additions and 1 deletion.
    20 changes: 19 additions & 1 deletion flash-android-rom-with-heimdall-on-mac.md
    Original file line number Diff line number Diff line change
    @@ -38,7 +38,24 @@ heimdall flash --APNHLOS NON-HLOS.bin \

    Have fun with your new ROM!

    ## Known problems with Heimdall "Claiming Interface Failed"
    ## Known problems

    ### Stuck at Smasung logo

    Boot into recovery mode *Volume Up + Power + Home* and execute
    - Wipe data / factory reset
    - Wipe cache partition
    - Reboot

    ### Cannot get into recovery mode

    Flash it again from within *Download mode*

    ```bash
    heimdall flash --RECOVERY recovery.img
    ```

    ### Heimdall "Claiming Interface Failed

    If you have the *Samsung Kies* software installed, this might load some intrusive kernel modules. This is how to find and get rid of them:

    @@ -48,3 +65,4 @@ sudo kextunload -b com.devguru.driver.SamsungComposite
    sudo kextunload -b com.devguru.driver.SamsungACMData
    sudo kextunload -b com.devguru.driver.SamsungACMControl
    ```

  6. kevinpapst revised this gist Aug 22, 2016. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions flash-android-rom-with-heimdall-on-mac.md
    Original file line number Diff line number Diff line change
    @@ -14,6 +14,7 @@ Now here is finally a written reminder ;-)

    ## Flashing the ROM

    Enter *Download mode* with Power On + Volumne Down or:
    ```bash
    adb reboot bootloader
    ```
  7. kevinpapst revised this gist Aug 22, 2016. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion flash-android-rom-with-heimdall-on-mac.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,7 @@
    # Installing an Android ROM with your Mac via Heimdall

    Because every time I want to flash a new ROM, I forgot how I did it the last time. Now here is finally a written reminder ;-)
    Because every time I want to flash a new ROM, I forgot how I did it the last time.
    Now here is finally a written reminder ;-)

    ## Software you need
    - adb
  8. kevinpapst revised this gist Aug 22, 2016. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion flash-android-rom-with-heimdall-on-mac.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,6 @@
    Because every time I want to flash a new ROM, I forgot how I did it the last time. Now there is finally a written reminder ;-)
    # Installing an Android ROM with your Mac via Heimdall

    Because every time I want to flash a new ROM, I forgot how I did it the last time. Now here is finally a written reminder ;-)

    ## Software you need
    - adb
  9. kevinpapst revised this gist Aug 22, 2016. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions flash-android-rom-with-heimdall-on-mac.md
    Original file line number Diff line number Diff line change
    @@ -36,6 +36,8 @@ Have fun with your new ROM!

    ## Known problems with Heimdall "Claiming Interface Failed"

    If you have the *Samsung Kies* software installed, this might load some intrusive kernel modules. This is how to find and get rid of them:

    ```bash
    kextstat | grep -v apple
    sudo kextunload -b com.devguru.driver.SamsungComposite
  10. kevinpapst revised this gist Aug 22, 2016. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions flash-android-rom-with-heimdall-on-mac.md
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,4 @@
    Because every time I want to flash a new ROM, I forgot how I did it the last time. Now there is finally a written reminder ;-)

    ## Software you need
    - adb
  11. kevinpapst revised this gist Aug 22, 2016. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions flash-android-rom-with-heimdall-on-mac.md
    Original file line number Diff line number Diff line change
    @@ -5,15 +5,16 @@

    ## Preparing the ROM
    - Find any ROM that you want to flash and unzip it
    - If there is a xxx.tar.md5 remove the .md5 and untar the file as well, until there is a list of around 12 files in a folder
    - If there is a xxx.tar.md5 remove the .md5 and untar the file as well, until there is a list of around 12 files in a folder (see list of required files in heimdall command below)
    - Now switch to your console and change into that directory

    ## Flashing the ROM

    ```bash
    adb reboot bootloader
    ```
    Wait until the system is in *Download mode*.

    Wait until the system is in *Download mode* and then execute:

    ```bash
    heimdall flash --APNHLOS NON-HLOS.bin \
  12. kevinpapst revised this gist Aug 22, 2016. 1 changed file with 20 additions and 10 deletions.
    30 changes: 20 additions & 10 deletions flash-android-rom-with-heimdall-on-mac.md
    Original file line number Diff line number Diff line change
    @@ -1,22 +1,22 @@
    Find any ROM that you want to flash and unzip it. If there is a xxx.tar.md5 remove the .md5 and untar the file as well, until there is a list of around 12 files in a folder. Not switch to your console and change into that directory.

    ## Software you need
    - adb
    - heimdall (brew cask install heimdall-suite)

    ## Known problems with Heimdall "Claiming Interface Failed"
    ## Preparing the ROM
    - Find any ROM that you want to flash and unzip it
    - If there is a xxx.tar.md5 remove the .md5 and untar the file as well, until there is a list of around 12 files in a folder
    - Now switch to your console and change into that directory

    ## Flashing the ROM

    ```bash
    $ kextstat | grep -v apple
    $ sudo kextunload -b com.devguru.driver.SamsungComposite
    $ sudo kextunload -b com.devguru.driver.SamsungACMData
    $ sudo kextunload -b com.devguru.driver.SamsungACMControl
    adb reboot bootloader
    ```
    Wait until the system is in *Download mode*.

    ## Flashing the ROM

    $ adb reboot bootloader
    $ heimdall flash --APNHLOS NON-HLOS.bin \
    ```bash
    heimdall flash --APNHLOS NON-HLOS.bin \
    --ABOOT aboot.mbn \
    --BOOT boot.img \
    --HIDDEN hidden.img.ext4 \
    @@ -28,5 +28,15 @@ $ heimdall flash --APNHLOS NON-HLOS.bin \
    --SYSTEM system.img.ext4 \
    --TZ tz.mbn \
    --CACHE cache.img.ext4
    ```

    Have fun with your new ROM!

    ## Known problems with Heimdall "Claiming Interface Failed"

    ```bash
    kextstat | grep -v apple
    sudo kextunload -b com.devguru.driver.SamsungComposite
    sudo kextunload -b com.devguru.driver.SamsungACMData
    sudo kextunload -b com.devguru.driver.SamsungACMControl
    ```
  13. kevinpapst revised this gist Aug 22, 2016. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions flash-android-rom-with-heimdall-on-mac.md
    Original file line number Diff line number Diff line change
    @@ -6,12 +6,12 @@ Find any ROM that you want to flash and unzip it. If there is a xxx.tar.md5 remo

    ## Known problems with Heimdall "Claiming Interface Failed"

    ´´´
    ```bash
    $ kextstat | grep -v apple
    $ sudo kextunload -b com.devguru.driver.SamsungComposite
    $ sudo kextunload -b com.devguru.driver.SamsungACMData
    $ sudo kextunload -b com.devguru.driver.SamsungACMControl
    ´´´
    ```

    ## Flashing the ROM

  14. kevinpapst revised this gist Aug 22, 2016. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions flash-android-rom-with-heimdall-on-mac.md
    Original file line number Diff line number Diff line change
    @@ -6,10 +6,12 @@ Find any ROM that you want to flash and unzip it. If there is a xxx.tar.md5 remo

    ## Known problems with Heimdall "Claiming Interface Failed"

    ´´´
    $ kextstat | grep -v apple
    $ sudo kextunload -b com.devguru.driver.SamsungComposite
    $ sudo kextunload -b com.devguru.driver.SamsungACMData
    $ sudo kextunload -b com.devguru.driver.SamsungACMControl
    ´´´

    ## Flashing the ROM

  15. kevinpapst renamed this gist Aug 22, 2016. 1 changed file with 0 additions and 0 deletions.
  16. kevinpapst revised this gist Aug 22, 2016. 1 changed file with 26 additions and 2 deletions.
    28 changes: 26 additions & 2 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,30 @@
    Known problems with Heimdall "Claiming Interface Failed"
    Find any ROM that you want to flash and unzip it. If there is a xxx.tar.md5 remove the .md5 and untar the file as well, until there is a list of around 12 files in a folder. Not switch to your console and change into that directory.

    ## Software you need
    - adb
    - heimdall (brew cask install heimdall-suite)

    ## Known problems with Heimdall "Claiming Interface Failed"

    $ kextstat | grep -v apple
    $ sudo kextunload -b com.devguru.driver.SamsungComposite
    $ sudo kextunload -b com.devguru.driver.SamsungACMData
    $ sudo kextunload -b com.devguru.driver.SamsungACMControl
    $ sudo kextunload -b com.devguru.driver.SamsungACMControl

    ## Flashing the ROM

    $ adb reboot bootloader
    $ heimdall flash --APNHLOS NON-HLOS.bin \
    --ABOOT aboot.mbn \
    --BOOT boot.img \
    --HIDDEN hidden.img.ext4 \
    --MDM modem.bin \
    --RECOVERY recovery.img \
    --RPM rpm.mbn \
    --SBL2 sbl2.mbn \
    --SBL3 sbl3.mbn \
    --SYSTEM system.img.ext4 \
    --TZ tz.mbn \
    --CACHE cache.img.ext4

    Have fun with your new ROM!
  17. kevinpapst created this gist Aug 22, 2016.
    6 changes: 6 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,6 @@
    Known problems with Heimdall "Claiming Interface Failed"

    $ kextstat | grep -v apple
    $ sudo kextunload -b com.devguru.driver.SamsungComposite
    $ sudo kextunload -b com.devguru.driver.SamsungACMData
    $ sudo kextunload -b com.devguru.driver.SamsungACMControl