5,594,151 Members 47,093 Now Online
XDA Developers Android and Mobile Development Forum

[VERY EASY GUIDE] ADB/FASTBOOT/RECOVORY *FULL GUIDE* for flashing ROMs, Kernels, APKs

Tip us?
 
uppon2
Old
(Last edited by uppon2; 23rd February 2013 at 05:25 AM.)
#1  
uppon2's Avatar
Recognized Contributor - OP
Thanks Meter 1063
Posts: 2,447
Join Date: Oct 2010
Default [VERY EASY GUIDE] ADB/FASTBOOT/RECOVORY *FULL GUIDE* for flashing ROMs, Kernels, APKs

Keep in mind bootloader unlock will not work if you have done the latest OTA update without previously using supercid. See bootloader unlock guide below for more details.

This procedure is designed to be EXTREMELY EASY and for people using windows. Following this guide will give you the knowledge you need to use ADB and Recovery menus in order to flash all of the ROMs, Kernels and APK (apps) files that you want. I am not responsible if anything undersireable happens in this procedure that makes you sad, poo yourself or ends the world.

Even if you have accidentally formatted your internal storage and you have no files on your phone, this section is down the bottom of the thread. Only follow this if you have no access to your phone and have nothing installed on your sdcard. For everybody else simply follow from step 1.


WINDOWS DRIVERS

You will need the USB drivers for your phone to communicate with your computer. You can search around and get these drivers separately or if that is not possible then please download and install The HTC Sync Manager from here


UNLOCKING YOUR BOOTLOADER

Since the new method came out, it is ridiculously easy to unlock your bootloader now. If you haven't unlocked your bootloader than please visit this thread and follow the instructions. I found this video on youtube that will make this process easier for you too.


INSTALLING ADB/FASTBOOT (SDK) (Please read this even if you have already installed this)

I would recommend following the guide to install adb (sdk) I have included below. If you have already done this step then keep in mind you should always have sdk updated and to make life easier rename your 'platform-tools' folder to something easier, for example rename the folder to android-adb. Now copy the 'android-adb' folder to a convenient location on your PC e.g: root of the C: so it will now look like this c:\android-adb *If you're having trouble locating this folder it will usually be here c:android-sdk-windows\platform-tools or something along those lines* At this stage the Windows’s Path Environment Variables will now have to suit this change, which in this case is: ;C:\android-adb - If you would prefer to leave things as they are than so be it and continue reading.

If this is all sounding too hard than you really need to start again and follow the EASY!!!!!! guide below

Make sure you have SDK installed and updated. If you haven't already than follow this extremely easy guide


DOWNLOADING REQUIRED FILES FOR FLASHING

(Download the following items listed below)

1. CWM Recovery This is what you will be using ALL THE TIME to flash ROMs and Kernel Modules. There is an alternative recovery called TWRP which can be found here but I am not using that right now so for the purpose of this guide please use CWM, if for some reason you need to use TWRP then the steps will be very similar just look on screen for the right area and touch the screen to select, pretty straight forward right?

2. Your desired ROM I would 100% recommend ViperDNA from HERE if not you can grab a different one from HERE or HERE

3. You now need all required kernel files you are planning to use with the ROM you have selected. If you don't have the kernel installed correctly you will face bugs, the most common is WiFi not working correctly (keeps searching) or something else like that. Now for the Droid DNA at the moment the kernel is broken down in to 2 parts. The first file is kernel modules and the second file is the the boot.img. Now whatever ROM you choose to download and install, it should already be using a specific kernel. When you flash a ROM the kernel modules will already be installed for the specific kernel the ROM is using.

For example If you listened to my advice and are going to use ViperDNA, this ROM already comes with the kernel modules required for the kernel it is using. The only thing that is left for you to do is download the second part of the kernel which is the boot.img file. Every kernel needs both the kernel modules and boot.img files to work 100% without fault, and every kernel has different modules and a boot.img that will only work for that specific kernel.

Each ROM should give you a download link for the required boot.img so just make sure to read the first few posts - If you are planning to use ViperDNA then it can be found on the first page post number 2 of the ViperDNA thread and it is named Stock DSB System Write Boot.img -

* If that wasn't already clear enough I would like to say that if you are download a complete kernel zip separately (which you can do) then you will get both files required. The first is the "already included in the ROM" kernel modules and the second file will be the boot.img - You can find all of the different kernels here - as you can see in this list the kernel included in ViperDNA is the one named "[KERNEL]Droid DNA Cubed Kernel Stock" - Once you have finished installing a ROM then I would recommend having a look at some different kernels if you want. Down the very bottom of this post I have included instructions on how to flash a kernel so please check it out.*

Now read this next part carefully. before doing anything else, I want you to prepare the files that you are going to be flashing with ADB.


PREPARING FILES FOR FLASHING

1. ** Using your computer, unzip your CWM Recovery zip and move the recovery.img to your platform-tools folder which you may or may not have renamed by now. this is where adb and fastboot.exe files are. for example If you have followed the guide I provided it will be c:\android-adb if not it will be whatever you have named it as, and wherever you have installed it to. Usually c:android-sdk-windows\platform-tools or something along those lines. I'm assuming by this stage you have changed the Windows’s Path Environment Variables, if not then you really should be following the very simple guide above!
(if you don't have a zip program, use this one)

2. ** Next I need you move the boot.img (for your kernel) to the same location you just moved your recovery.img (If you have followed my advice then you can get this file from the first page of the ViperDNA thread) if you didn't then the boot.img file might be on the first page of your desired ROM. *If you have downloaded the same kernel used in the ROM, but as a complete zip then you will need to unzip the kernel zip to access the boot.img and continue as above*.

Do not close the folder where you have copied these files, simply leave it open

3. ** Now connect your phone to a USB port. Sometimes it's best to stick to USB 2 rather than USB 3. Copy and paste the ROM.zip (Whatever the name of your ROM is, you don't need to rename it ) file that you want to flash over to your phone (make sure to not accidentally drop it in to an already existing folder) So as soon as you open the contents of your device it should be pasted right there - Once this is complete disconnect the phone and switch it off.

4. ** Boot your phone in to bootloader by holding down the "power button" and the "volume down" key at the same time until you see the bootloader screen on your phone. Now press the power button once to make sure you're in fastboot (If you don't your phone will not be found by ADB and will be constantly "waiting for device") - Now connect your phone to your computer again and continue reading

5. ** Back to your computer, while still in the same folder you have copied your recovery.img and boot.img I want you to hold the shift button at the same time as right clicking on a blank space inside the folder and click on "open command window here"


FLASHING YOUR FILES IN FASTBOOT

Now you are ready to flash your files. Starting with your recovery.img file and then followed by your kernels boot.img - In your command window type the following commands

1. ** To flash a recovery you will need to type**

fastboot flash recovery recovery.img

2. ** To flash your kernels boot.img you need to type**

fastboot flash boot boot.img

Before flashing the boot.img, you can in fact flash your ROM.zip with the instructions given below. However, it is strongly recommended to do it before you flash the boot.img. This is the standard procedure that should be used for every single ROM.


USING CWM FOR THE ROM INSTALLATION AND A CLEAN WIPING PROCEDURE

Go back to your phone and scroll down to where it says recovery and hit the power button. Your phone will now reboot in to CWM Recovery. (If you can't see the recovery option then you might be in the main bootloader menu screen, try pressing the power button once to change back to fastboot). Your phone should now reboot and display a white HTC screen and up the top it will read "Entering Recovery" - After it has finished you can now navigate through CWM Recovery by using the volume keys and pressing the power button to enter. Some versions of CWM you can also touch the screen to make selections. Lets begin

*WARNING* Although you don't have to, but if you do choose to use the recommended Step 3 which is found below, it will wipe all of your games and apps including saved game data and such. Don't worry all of your photos and music will be fine. Make sure to sync your contacts with your Google account**

1. Scroll down to -advanced and hit power, then do as follows
- wipe dalvik cache
-***go back***

2. Scroll down to -mounts and storage and hit power then:
-format system
-press your back key on the phone to go back

3. Scroll down to -wipe data/factory reset and hit the power button
"you can skip this process but it is a highly recommended one if you want less bugs in the ROM" (If you decide to skip make sure you you also -wipe cache partition which is in the same menu)

4. Scroll down to install zip from sdcard and hit power and then:
-choose zip from sdcard. (Locate your ROM.zip and hit power)
- Wait for this process to finish or follow on screen prompts from here on.
- go back to the main menu and reboot your device if it isn't already

This method will work with every other zip file that is flashable through CWM including kernel modules. You will not however need to follow all of the steps for wiping and such, simply just start from step 4

This is the end of my guide!. If you already have a ROM installed and you want to change the kernel, then scroll all the way to the bottom of this post
__________________________________________________ __________________________________________________ ______________________

*NOTE* KEEP SCROLLING DOWN IF YOU ARE LOOKING AT HOW TO FLASH A DIFFERENT KERNEL. THIS SECTION IS FOR PEOPLE WHO HAVE ACCIDENTALLY FORMATTED THEIR INTERAL STORAGE. OR FOR ANY OTHER RANDOM REASON YOU CAN'T USE A COMPUTER TO DROP AND DRAG FILES TO YOUR PHONE.

Place desired ROM, kernel modules, recovery files, or APK (apps) files inside the same folder your adb/fastboot.exe files. It's usually found here c:android-sdk-windows\platform-tools or something along those lines unless you have moved or renamed it. If you are having trouble then please follow the ADB installation guide I have listed at the beginning of this thread.

Now while your phone is booted in Android and you make sure to have USB Debugging on, we are going to push these files depending on the file type by typing in commands:

adb push ROM.zip /sdcard/ROM.zip ***replace the word ROM with the exact name of the file you are pushing***

For example if you were using ViperDNA ROM you would type: adb push ViperDNA-version2.3.zip /sdcard/ViperDNA-version2.3.zip

And if it was a kernel (boot) file you would change the name respectively. For example: adb push cubedversion1000.boot/sdcard/cubedversion1000.boot


Now for applications such as games etc. You can either install the game directly or push the file to you phone to be installed later. Personally I always like to install from my phone so I always just push the file. But I will give you both options. ***To clarify if you are confused right now: adb push will copy any file to the phone, whereas adb install will only accept an apk file, and will install it onto the device***

To install an apk, it is quite simple, however it has a different path than what we have spoken about previously. The files will automatically push install themself in the correct area with your current installed apps .

If you want to install apps then you would type:
adb install apkfile
***For example if it is the game temple run, it would look like this: adb install templerun.apk

If you would prefer to manually install the game from your phone than you will need to push the file like we have mentioned already with the other file types:

adb push templerun.apk/sdcard/templerun.apk

Now remember if your phone is working correctly you can simply copy and paste all of these files directly to your phone and then flash in recovery for your ROMs or if you want to install apps you would then use a file explorer and locate the apk on your sdcard of the phone and then install it all from your phone. This was simply written for people that have no files on their sdcard due to accidental formatting of internal memory


INSTALLING ANOTHER KERNEL

If you have flashed a ROM and do want to use a kernel that isn't included with your ROM, then you can get another one from HERE Now this process is exactly the same as the stuff you have already done. Instead you will need to flash both of the kernel files included in the kernel zip file.

The first part is identical to what you did earlier. Move the boot.img file to the same place I mentioned earlier in this guide, and flash it the same way I mentioned in fastboot. This time the path will need to be changed because it is a boot file not a recovery file. So use this command: fastboot flash boot boot.img

In this second part move the kernel modules file to your phone and do exactly the same as you did in order to flash the ROM in CWM Recovery as mentioned earlier, only this time start from step 9 section 4.

That is all. Keep in mind things like wifi might not work if you forget to flash the kernel modules! - Just be sure it is always a 2 step process.


*Credits*

nitsuj17 for the greatest ROM on our phone ViperDNA
Jailbreak Eye for the wonderful ADB guide
DroidModd3rX for his video
dsb9938 for his awesome kernel work
jcase and beaups for their unlocking methods
htcdev.com for the unlocking
All of the fantastic developers for Android
The more you sweat in training the less you bleed in battle
The Following 21 Users Say Thank You to uppon2 For This Useful Post: [ Click to Expand ]
 
atishpatel2012
Old
#2  
Senior Member
Thanks Meter 21
Posts: 187
Join Date: Jan 2013
Good guide. I would suggest adding a link to unlocking the phone because you have the about everything else. I really like that you included changing PATH and such in your guide because a lot of people kept getting the adb not found stuff.
The Following User Says Thank You to atishpatel2012 For This Useful Post: [ Click to Expand ]
 
treahuggs
Old
(Last edited by treahuggs; 3rd February 2013 at 04:44 PM.)
#3  
Member
Thanks Meter 7
Posts: 63
Join Date: Aug 2012
I need a video. Its hard for me to learn so much by reading, esp when you could brick your phone.

good write up though!

Followed instructions and it says
sending 'recovery' (6944 KB)... OKAY [ 1.162s]
writing 'recovery'... OKAY [ 0.760s]
finished. total time: 1.924s

Then i go back to the recovery and go to it, does the HTC recovery..Also going back into the boot screen, the top says unlocked but also now says tampered on top.
 
uppon2
Old
(Last edited by uppon2; 3rd February 2013 at 05:04 PM.)
#4  
uppon2's Avatar
Recognized Contributor - OP
Thanks Meter 1063
Posts: 2,447
Join Date: Oct 2010
Quote:
Originally Posted by treahuggs View Post
I need a video. Its hard for me to learn so much by reading, esp when you could brick your phone.

good write up though!

Followed instructions and it says
sending 'recovery' (6944 KB)... OKAY [ 1.162s]
writing 'recovery'... OKAY [ 0.760s]
finished. total time: 1.924s

Then i go back to the recovery and go to it, does the HTC recovery..
I would reboot the phone in to bootloader mode and then press the power button once to switch to the fastboot menu. Now scroll down to recovery again and press the power button. If this doesn't work than try flashing the recovery again using the step for it. When you do in fact click on recovery in your bootloader, does it reboot in to a white HTC screen that says up the top Entering recovery?

A video would be extremely tedious to make for this guide. If you have already unlocked your bootloader than the bricking of this device would be drastically minimised. I wouldn't worry too much at this stage.
The more you sweat in training the less you bleed in battle
 
treahuggs
Old
#5  
Member
Thanks Meter 7
Posts: 63
Join Date: Aug 2012
Quote:
Originally Posted by uppon2 View Post
I would reboot the phone in to bootloader mode and then press the power button once to switch to the fastboot menu. Now scroll down to recovery again and press the power button. If this doesn't work than try flashing the recovery again using the step for it. When you do in fact click on recovery in your bootloader, does it reboot in to a while screen that says up the top Entering recovery?

A video would be extremely tedious to make for this guide. If you have already unlocked your bootloader than the bricking of this device would be drastically minimised. I wouldn't worry too much at this stage.
Yes it says that.

Let me ask some questions, you say copy the complete ROM.zip over to the phone. Where at on the phone? Does it have to be named ROM.zip?
Does the CWM need to be copied over too? Using your guide to download the viper files and the second boot.img is confusing since the .zip with the viper has a boot.img with it, should we use that, ignore it, or what?

I thank you for taking the time to write a guide but with so many variables that are being used and referenced, there needs to be more specific instructions.

ALL i want to do is use mt titanium backup to get my old apps and app data on my DNA. Is it really this many steps just to gain root access to the DNA? With the Razr maxx it was just connecting it to the computer in debugging mode, and running a batch file.
 
skkitzopath
Old
#6  
Junior Member
Thanks Meter 1
Posts: 5
Join Date: Feb 2013


---------- Post added at 06:21 PM ---------- Previous post was at 06:15 PM ----------

 
uppon2
Old
(Last edited by uppon2; 23rd February 2013 at 05:34 AM.)
#7  
uppon2's Avatar
Recognized Contributor - OP
Thanks Meter 1063
Posts: 2,447
Join Date: Oct 2010
Quote:
Originally Posted by treahuggs View Post
Yes it says that.

Let me ask some questions, you say copy the complete ROM.zip over to the phone. Where at on the phone? Does it have to be named ROM.zip?
Does the CWM need to be copied over too? Using your guide to download the viper files and the second boot.img is confusing since the .zip with the viper has a boot.img with it, should we use that, ignore it, or what?

I thank you for taking the time to write a guide but with so many variables that are being used and referenced, there needs to be more specific instructions.

ALL i want to do is use mt titanium backup to get my old apps and app data on my DNA. Is it really this many steps just to gain root access to the DNA? With the Razr maxx it was just connecting it to the computer in debugging mode, and running a batch file.
1. Sorry I didn't mean to put complete at the beginning of ROM.zip and no you do not need to rename the ROM zip file
2. To avoid confusing anybody, please ignore the boot.img file inside of the ROM
3. If you read the whole guide you will know exactly what to do with CWM file and every other file
4. It is unfortunately an annoying process to root this phone. However if you follow the guide completely you will have root. I'm not sure about a batch process for the DNA, sorry. It makes it very hard that we can't write to system easily, if and only if we gain this access will we be able to pack the the files which installs the su binary and busybox in to the kernels like you would find with other phones such as Samsung etc. Then you would be able to just flash a kernel and have root, without installing a custom ROM. (I could be wrong and would like further education here from other users as there might in fact be a file flashable through fastboot or recovery that gives you root and nothing else, I simply don't know about this file)
The more you sweat in training the less you bleed in battle
The Following 2 Users Say Thank You to uppon2 For This Useful Post: [ Click to Expand ]
 
treahuggs
Old
(Last edited by treahuggs; 4th February 2013 at 02:22 AM.)
#8  
Member
Thanks Meter 7
Posts: 63
Join Date: Aug 2012
Ok where do you put the downloaded files onto the phone. When you plug the phone in you get many different windows pop up that is gives you access to different parts in the phone.

EDIT: of the three opitions that pop up when you plug the phone in only one is large enough for the viper rom so it has the viper folder AS WELL as the .zip onto it now.

My paths are "C:\android" for all my android files like the adb and the boot.img and recovery.img. I am able to write the two .img files to the phone with the console telling me it wrote ok.
I go to the recovery on the phone and it says entering recovery on the top of the phone screen but then it boots straight into android.

I will redownload all of the files, if anyone else has any ideas id love to hear.

EDIT 2: Got it to work, i think the CWM files were the problem. I just used the TWRP files and it is flashing now! Also found this video which was a huge help. http://www.youtube.com/watch?v=vAwfgi0suJQ
 
uppon2
Old
#9  
uppon2's Avatar
Recognized Contributor - OP
Thanks Meter 1063
Posts: 2,447
Join Date: Oct 2010
Quote:
Originally Posted by treahuggs View Post
Ok where do you put the downloaded files onto the phone. When you plug the phone in you get many different windows pop up that is gives you access to different parts in the phone.

EDIT: of the three opitions that pop up when you plug the phone in only one is large enough for the viper rom so it has the viper folder AS WELL as the .zip onto it now.

My paths are "C:\android" for all my android files like the adb and the boot.img and recovery.img. I am able to write the two .img files to the phone with the console telling me it wrote ok.
I go to the recovery on the phone and it says entering recovery on the top of the phone screen but then it boots straight into android.

I will redownload all of the files, if anyone else has any ideas id love to hear.

EDIT 2: Got it to work, i think the CWM files were the problem. I just used the TWRP files and it is flashing now! Also found this video which was a huge help. http://www.youtube.com/watch?v=vAwfgi0suJQ
I'm glad you got it working
The more you sweat in training the less you bleed in battle
The Following 2 Users Say Thank You to uppon2 For This Useful Post: [ Click to Expand ]
 
treahuggs
Old
(Last edited by treahuggs; 4th February 2013 at 05:34 AM.)
#10  
Member
Thanks Meter 7
Posts: 63
Join Date: Aug 2012
Kinda, i have wifi issues. Ive read thats because of the boot.img. Ive tried both boot.img files that you can get with the ViperDNA page and both dont seem to work.

Nvm... again. I have been writing "fastboot flash recovery boot.img" instead of boot... I feel like a noob to reading.

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes