Remove All Ads from XDA

 View Poll Results: Was this helpful?

40 Vote(s)
0 Vote(s)

How 2 - ADB, Rooting(reflash), Unrooting, Nandroid, Remove/Install App, roms, kernels

308 posts
Thanks Meter: 32
By dreamersipaq, Senior Member on 24th June 2010, 02:44 AM
Post Reply Email Thread
So far, this is going to be a guide for noobs. Please read through this, and ask any questions that you have. This has been compiled from different guides around XDA, and information has been stripped that does not relate to our phones. More will be put up here when I find it, and all credit will be provided. This will be from 'duh' to 'didn't know that'. The idea is to provide a beginning to end explanation: Stock Incredible to Rooted with custom Rom.

Topics so far - ADB, Rooting (reflash), Unrooting, Nandroid, Remove/Install Apps, roms, kernels...


**********At this point, I'm going to ask that you uninstall HTC Sync. Also, please uninstall HTC Driver... (whatever it's called) Nobody likes them (really though, it will mess up a lot of things. You can install them later when all this is done).**********

1) Setting up ADB
ADB stands for Android Development Bridge. It is used by Android developers for programming. For us, it is used to hack into our phones . For our purposes, just know that it is like the cmd (command prompt) that allows us to send commands to our phone. This is extremely useful when we're in the custom recovery

Download the Android SDK from Google:
Unzip to your desktop
Take the "android-sdk-_**-windows" folder and move it to the root of your hard drive (C:\)
** will change, it is revision of SDK, like "r6"

****The below is not necessary, but is useful sometimes if you just want to run "adb shell" from anywhere without going into the sdk directory****
Right click on My Computer and click properties
Select the Advanced Tab or Advanced System Setting (Vista/Windows 7)
Select Environment Variables...
Press New

For Variable Name type: adb
For Variable Value type: C:\android-sdk-_**-windows\tools
****End of the "This is not necessary thing****

Now, we get USB drivers to work. Some use HTC Sync for drivers, however HTC Sync does not like to play nice with the reflash tool (later on this), so we will use the generic google USB drivers.

1. Run SDK Setup.exe
2. If it gives you any error go to settings and click on "Force http//....."
3. Select usb driver package, let it download and install
4. Some say the below step is not needed, but I did this so I'm posting it
Go to tools folder, and edit "android_winusb.inf" (you can do this by opening it via wordpad). Add the following at the end of the [Google.NTx86] and [Google.NTamd64] blocks:
;HTC Incredible
%SingleAdbInterface% = USB_Install, USB\VID_0BB4&PID_0C9E
%CompositeAdbInterface% = USB_Install, USB\VID_0BB4&PID_0C9E&MI_01
%SingleBootLoaderInterface% = USB_Install, USB\VID_0BB4&PID_0C94
Save the file and exit.

5). Plug your phone into PC, when windows asks to install drivers for new found hardware, point the New Hardware Found wizaed to android_winusb.inf that you just edited.

================================================== ==========
2) Preparing your phone for ADB

Go to Settings on your phone
Select Applications
Select Development
Make sure 'USB Debugging' is checked

================================================== ==========
3) Check if your phone is detected by ADB

Open up Command Prompt (Go to run, type in cmd, press enter)
Type in:

cd C:\**your sdk name**\tools (Press Enter)
adb devices (Enter) You should see your device listed
adb shell (Enter) you should see $ in the next line
**After you obtain root**
su (Enter) you should see # in the next line if you are already rooted
**you may need to allow adb shell to run as root. Look at the phone and see if Superuser.apk is asking for your permission to allow adb root access. Click on "Remeber my selection" and select yes.
Now you are all set to run adb commands as root or as a regular user

**Note: for a list of commands that you can type using adb type "adb" in cmd

All Credit for Topics 1 - 3 go to user XDA member nephron. I mostly copied all of his guide, but updated some information on it to make sense for our phones. Also, removed some stuff I didn't see necessary. Please go to the original thread for the G1: for a list of further Credits, and for information I've left out. If you like this thread, please donate to HIM

================================================== ==========
4) Rooting your phone - READ THIS WHOLE SECTION BEFORE GOING TO ANY EXTERNAL LINKS PLEASE. At this point, running the UnrEVOked reflash3 tool will root your phone and install a custom recovery. To try to make it really easy to understand, recovery allows you to access your phone to make PERMANENT changes (something we can't do while booted yet), flash custom roms, and save your sorry little @$$ if you do something that you weren't supposed to

Ok, at this point, I'm going to ASSUME that you don't have HTC SYNC installed (or uninstalled it), and that you have the Google USB drivers installed (i.e. you read at least some of this post). The first thing we're going to do is:

1) Read this:
2) If you read #1, you already went here:
and downloaded the MODIFIED (i.e. changed, not the same, DON'T SKIP THIS STEP) driver and installed it
3) If you read #1, you already downloaded the reflash tool executable
4) If you read #1, you've already done #2, and 3, and this is just a worthless step of me explaining how important it is that you did #1
5) Lets do this. #1,2,3 and 4 were "get ready" steps. By now, you installed the modified driver, went to the webpage and downloaded the UnrEVOked3 reflash tool. HTC sync is also uninstalled. Plug in your phone (normally booted) to your pc and select "Charge Only" when asked how to connect to PC, and click on "remember my selection". Click Done.
6) Unplug Phone from PC.
6a) If you have double twist installed, at this time open the task manager on your pc, and kill doubletwist.devicehelpder....
7) Run the "reflash_package" executable that you just downloaded. Notice the path that it lists and click "install". This will unzip "reflash.exe" and a bunch of other stuff that is needed to the directory that you just noted. Go to this directory (usually the same one where the executable you just ran is) and run "reflash.exe"
8) Plug in your phone.
9) When the program is finished, you should see koush's clockworkmod recovery on your phone's screen and reflash will say that it's done. Congrats, you have root and a new recovery.
If something went wrong, and you're not on koush's recovery and reflash says it's done, don't worry, just re-run reflash. You can run it as many times as necessary. It will not hurt anything AT THIS TIME (this may change later)
10) Koush's recover works a little differently:
a) Vol+ and - scroll up / down
b) the Power button work as a "Back" button, and will turn off screen if you're at the root of the menu. If your screen goes blank, don't read, just hit Power again
c) To make a selection, click the optical trackpad
11) Reboot your phone by highlighting the selection and choosing it

For the most part, these instructions were written from memory, but all credit goes to UnrEVOked, Shadowmite, and anyone that they've given credit to in original links.

================================================== ==========
5) Unrooting - I didn't want to re-invent the wheel, so I'm posting an external link:

Just follow the instructions. Credit goes to the OP. If this link ever goes to a 404, pm me and I will find another link with instructions and update this. Also, if you don't understand something, just ask in this thread, someone will answer (maybe even me ).

================================================== ==========
6) Whats is a Nandroid Backup?
**Using Koush Recovery:
Power takes you "bacK" in menu's. On root of the menu, it will turn on/off screen. Hit Power again to turn it back on.
Vol+/Vol- lets you scroll up/down through menus
Pushing optical trackpad in makes your selection

Nandroid Backup is a tool allowing your Incredible that has koush ClokworkMod Recovery to create a full system backup and restore it, which, when flashing and testing different roms can be very useful.

A) Creating a Backup using Nandroid

Boot up your phone in recovery (Turn off, then turn on while holding Vol- and Power. Press Vol- once to highlight recovery, hit Power once to go into it)
You will now see your new koush recovery
Scroll down (Vol -) to "nandroid" and select it (press the optical button in)
"Backup" will be highlighted. select it
Let it work, it might take a while for a full system backup
Once its done, your backup is complete and is saved on your sdcard in the "clockworkmod" folder. Normally it's stored in the "nandroid" folder, however our Recovery does things a little differently.

B) Recovering to Your Nandroid Backup

Make sure u made a backup and its in the clockworkmod folder on your sdcard
Boot up your phone in recovery (Explained Above)
Go into "nandroid" in the recovery (also explained above)
Select "restore backup" and select from the backups you have (if you have multiple) that you want to restore; this will do a simple, "restore all" of your latest nandroid backup
Select "Advanced Restore", choose from the backups that you have on your SD card, and then what you want to restore. You can individually restore "system", "data", "cache", etc....
In "Advanced Restore", i have not seen a way to restore multiple options (cashe AND system, etc...) Koush, am I missing something?
Let it work
Once its done, restore more options through the Advanced Restore menu, or reboot your phone and your selections will now be restored!

================================================== ==========
7) Remove Apps
**Using Koush Recovery:
Power takes you "bacK" in menu's. On root of the menu, it will turn on/off screen. Hit Power again to turn it back on.
Vol+/Vol- lets you scroll up/down through menus
Pushing optical trackpad in makes your selection

1) Go into Clockworkmod Recovery (With phone turned off, Vol - + Power, then Vol - to select recovery, then hit Power)
2) Select "partitions" from menu, then select "mount sytem" You can also "mount sdcard" if you want to back apps up to sdcard
3) Connect Phone to PC
3a) Open a command prompt and navigate to your sdk\tools directory
3b) Type: adb remount (it shoud return successful)
4) Open Adb Shell on your pc (Type: adb shell)
It should automatically show #, otherwise type "su"
cd /system/app (enter)
5)Type ls (this will show you all of the stuff in the /system/app directory)
6) To "delete" apps, type the following:
/system/bin/mv Your_APP.apk Your_APP.apk.bak (i.e. CityID.apk CityID.apk.bak). If you want to clear up space on your internal storage for whatever reason, you can replace Your_APP.apk.bak with /sdcard/Your_APP.apk.bak (this will move the app to the root of your SD Card instead of just change it's name)
If you don't get errors, you're done.
*This does not delete apps, but changes their file type so they will not show up as an app, in case you want to get them back at any time later you still have them and don't have to frantically post threads on XDA asking for them.

================================================== ==========
8) Install Apps to /system/app
**Using Koush Recovery:
Power takes you "bacK" in menu's. On root of the menu, it will turn on/off screen. Hit Power again to turn it back on.
Vol+/Vol- lets you scroll up/down through menus
Pushing optical trackpad in makes your selection

1) Place your app you want to install into the root of your sd card (this is easiest)
2) Go into Clockworkmod Recovery (Explained in 7)
3) Mount system and sdcard under partitions (Explained in 7)
4) Connect Phone to PC
4a) adb remount in command prompt (should sow successful) (again, in 7)
5) Open Adb Shell on your PC
IF NOT at #, type "su" to go from $ to #.
/system/bin/mv /sdcard/Your_App_Name.apk /system/app/Your_App_Name.apk
7) If you don't get errors, you're done. You can unplug phone, and reboot

================================================== ==========
9) Flashing Custom Roms

Download a ROM that you want to try. One of the roms from here are a good starting point: They are mostly stable might get a few random reboots.

1. Download Rom of your choice
1a. Right now, there might be two ROM types, a nandroid backup and an type file. For right now, I recommend sticking with the kind. These instructions are meant for it, but I just want you to make sure you know which type it is before you try to flash it.
2. Copy and Paste the downloaded file onto sdcard. Make sure it is not in any directory's of SD card, just on the sdcard (the "root" of it).
3. Verify it's there using Astro or some other File Manager just to be safe.
4. Download and Run Titanium Backup from the Market if you haven't already. (If you don't have it, get it, it's must have for root users.)
a. Select Menu, Batch, Backup user apps. (in Titanium Backup)
b. let it run, this will take some time.
5. When that's done open your command prompt, navigate to your sdk\tools directory, and type "adb reboot recovery" (Not within adb shell, but in command prompt in that directory. I'm not going to explain how to do this because it's already explained above. Also, if you're flashing roms then you're already familiar with it, or maybe you shouldn't be flashing roms ).
6. Do "Wipe data/factory reset" and "wipe cache partition" in Recovery **This WILL WIPE your phone**
7. Select "install zip from sdcard", then select "choose zip from sdcard", then select the name of the zip you want to install.
8. When that's done reboot your phone, once your done setting up all the settings, download titanium backup from the market again, and set that up.
9. In Titanium, Select Menu, Batch, Restore User apps.

After that's done you'll have all your apps that you had before, data included, with a fresh new rom to try out. Hope this helps!!

All credit for these instructions goes to tcbert2010, they were suggested to me, and I liked them. I modified them a BIT, so they make more sense to me and hopefully to you. See post #2 in Original Thread =

================================================== ==========
10) Installing custom kernels
I'm only mentioning Hydra's kernels. I'm running the Undervolted, NOT overclocked kernel with wireless N to preserve my battery to get more life out of it

**Taken from website's FAQ**
Q: So how do I install the kernel?

A: First step is to either download the kernel zip file straight to your phone, or download it onto your computer and put it on the sdcard of your phone. Next you turn the phone off hold volume down and power at the same time. When the phone is in HBOOT wait a few seconds for it to initialize then hit volume down once and then power to boot into Clockwork recovery. Once in clockwork recovery you want to select "Install zip from sdcard", then "Choose zip from sdcard". You will now see a listing of files on your sdcard select the kernel zip you downloaded, or if you downloaded strait to your phone go to the Downloads folder and select the kernel zip file. The kernel will now install to the phone and once it's done it will say install complete. Now you can hit the power button once to return to main menu and select "reboot system now" . Your phone will now reboot with the new kernel.

Go to: to download the kernels
Please read: to educate yourself. It's worth it.

Credit to EJHEART for the wonderful kernels! Where are my 2.2 kernels EJ ?

================================================== ==========

Again, if you have suggestions, requests, or whatever please post or PM me.
PM Me if I missed giving someone credit. PLEASE!!!
The Following 5 Users Say Thank You to dreamersipaq For This Useful Post: [ View ] Gift dreamersipaq Ad-Free
24th June 2010, 02:50 AM |#2  
OP Senior Member
Thanks Meter: 32
reserved for future.
24th June 2010, 02:50 AM |#3  
OP Senior Member
Thanks Meter: 32
reserved for future
24th June 2010, 02:55 AM |#4  
Senior Member
Thanks Meter: 1
Great thread topic... reserved for future use
24th June 2010, 03:39 AM |#5  
OP Senior Member
Thanks Meter: 32
Updated with Reflash instructions.
24th June 2010, 04:02 AM |#6  
rynosaur's Avatar
Senior Member
Flag Dekalb
Thanks Meter: 28
Donate to Me
Originally Posted by dreamersipaq

Help I'm stuck at waiting for system to settle
check these common issues:
- You switched your driver to the one from this post? It's NOT identical to the SDK one.
- You don't have any usb applications that might be taking focus while we are working with the phone right?
- Is the SD card present in the device?
- You did give su permenent access when you allowed it in superuser right?
More to come...

Good start, iPaq! I just want to plug Linux AGAIN. I had zero problems using reflash for linux and using Gparted in Ubuntu/Debian/Linux Mint mint means one can do all kinds of things that will become helpful very soon if not already (e.g., manipulate ext and swap partitions on the sdacard!). Aside from linux being Android's native file system, using a Linux distro just makes 110% good sense if you plan to do any developing for the DI/Android. Why poeple struggle so much with Windows when Linux is free is beyond me

2 cents deposited!
24th June 2010, 07:01 AM |#7  
jdmba's Avatar
Senior Member
Thanks Meter: 96
Additional items to add
1) After I have rooted and reflashed - How do I flash new ROMs
2) After I have rooted and reflashed - Is there an easier way to get back in and get rid of CityID, etc?
3) How do I update to a later version of ClockworkMod
24th June 2010, 07:31 AM |#8  
Junior Member
Thanks Meter: 0
Great topic

Sent from my ADR6300 using XDA App
24th June 2010, 12:49 PM |#9  
OP Senior Member
Thanks Meter: 32
Originally Posted by jdmba

1) After I have rooted and reflashed - How do I flash new ROMs
2) After I have rooted and reflashed - Is there an easier way to get back in and get rid of CityID, etc?
3) How do I update to a later version of ClockworkMod

1) - Will update soon
2) - I BELIEVE that this works:
1) Go into Clockworkmod Recovery
2) Mount Internal Storage under partitions
3) Connect Phone to PC
4) Open Adb Shell on your pc
su (will change to #)
cd /system/app
mv CityID.apk CityID.apk.bak
you're done.
Not in front of my phone at this sec, but if mv does not work, try
busybox mv CityID.apk CityID.apk.bak or
/system/bin/mv CityID.apk CityID.apk.bak
*This does not delete it, but changes the file type so it will not show up as an add, in case you want to get it back at any time later.

If I'm wrong please correct me.

3) The easiest way to update recovery at this time is through Koush's Rom Manager. However, at this time I've read somewhere that it's not persistent. Let's give this a few days.
24th June 2010, 02:16 PM |#10  
OP Senior Member
Thanks Meter: 32
First Post Updated.
24th June 2010, 02:36 PM |#11  
Senior Member
Flag Pittsburgh
Thanks Meter: 1
here is my problem, apparently when I got root I didn't push superuser.apk as a system app correctly.

SO, I have root in the OS after each boot, once I install superuser.apk.

Problem is, I can't get back in recovery to fix this. I have gotten into recovery with ADB again (maybe twice in the 2000 times I have tried again), but when I get to the step where you do the update and push the zip file at the same time, it never works now. So I am unable to push the apk as a system file.

So, the unrevoked recovery flash fails because it doesn't have su rights when it gets to the os on reboot.

Anyone want to help me out?
Post Reply Subscribe to Thread

Guest Quick Reply (no urls or BBcode)
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes