Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have made some modification in the android source codes recompile sources and now I have system.img, but I don't know how I can install that image on Android Phone. Have anybody do something similar ? Can anybody provide me some links or information how I can do that ? I am using HTC Amaze Phone.

share|improve this question
Are you working from HTC's source or the AOSP? The latter is highly unlikely to boot, or work in general if it does boot. – Matthew Read Apr 30 '12 at 19:47
up vote 7 down vote accepted

If you have a fastboot-enabled bootloader then it should be pretty simple. Just put the system.img file somewhere on your PC, connect your device via a USB cable, reboot into your bootloader's fastboot mode and then:

fastboot flash system /path/to/system.img

If you don't have fastboot then you'll have to jump through some more hoops. One option would be to use something like unyaffs to extract the contents of the system.img (if it's an ext2/3/4 filesystem then just mount it) and then package it up as a zip file that can be installed from a custom recovery. There are some tutorials floating around that explain the syntax of the installer script file, but the easiest way to figure it out would probably be to download a custom ROM for your device, unzip it, and look at the updater-script file (should be META-INF/com/google/android/updater-script in the archive).

You may also be able to get away with simply using dd on the device, though I'd be careful if you decide to try it, and make sure you're booted into recovery:

adb push system.img /sdcard/
adb shell
dd if=/sdcard/system.img of=/your/system/partition

Alternatively, you can often build the source so that it creates a zip file instead of raw images, then install the zip from recovery. I'd suggest checking to see see if you have something like make otapackage available to you.

share|improve this answer
♦ I have run fastboot flash system /path/to/system.img command and it successful install system.img on my phone HTC Amaze but when I try to switch it on, only HTC screen come up and my phone do not turn on :((( Can you help me. – ViTo Brothers Apoyan May 2 '12 at 12:41
@ViToBrothersApoyan: There's a lot of reasons that could be happening, unfortunately. Where did you get the source code from? If it isn't from HTC then you may be missing necessary proprietary drivers to get the device to boot. – eldarerathis May 2 '12 at 13:26
♦ no I get that sources from Android official site – ViTo Brothers Apoyan May 2 '12 at 13:53
@ViToBrothersApoyan: The best method is probably to grab a custom recovery image (like ClockworkMod) and flash it from fastboot: fastboot flash recovery /path/to/recovery.img. Then you can use that to make a backup and/or flash a ROM of your choice. Flashing a new ROM should get your device into a bootable state, and you can get ROMs from XDA. – eldarerathis May 2 '12 at 14:14
@ViToBrothersApoyan: Download the appropriate recovery image for your device. There are links for a bunch of different devices on the page I linked to. Then boot into that recovery image, copy the zip file onto your phone, and use the recovery to install the zip file. – eldarerathis May 2 '12 at 19:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.