Adb for "dummies"

Thursday, July 2, 2009
#still being written.

Too many noobs popping up on xda and none can read. hopefully they can read this.

Windows Users:

First lets download the android sdk files located here. (some /sdk/filepaths might be different from yours to mine, since ive modified my sdk a bit)

Once downloaded go ahead and make a folder in C:\ named something like C:\asdk\ and put all the file's from the sdk into that folder, this way you dont have to do a lot of typing in comand prompt, but to save you even more time copy "adb.exe" and "adbwinapi.dll" from what should be "C:\asdk\tools\" and paste those into "C:\windows\" this way when you open comand promt {windows key + r / or start>run>cmd} all you have to do is type adb and everything works out the way it should. test it to make sure it works ofcourse type "adb" and it should give you a list of commands that it can do.

Android Debug Bridge version 1.0.20

-d (directs command to the only connected USB device returns an error if more than one USB device is present.)
-e (directs command to the only running emulator. returns an error if more than one emulator is running.)
-s (directs command to the USB device or emulator with the given serial number.)
-p (simple product name like 'sooner', or a relative/absolute path to a product out directory like 'out/target/product/sooner'. If -p is not specified, the ANDROID_PRODUCT_OUT environment variable is used, which must be an absolute path.)

device commands:

adb devices - lists all connected devices
adb push - copy file/dir to device
adb pull - copy file/dir from device
adb sync [ ] - copy host->device only if changed
(see 'adb help all')
adb shell - run remote shell interactively
adb shell - run remote shell command
adb emu - run emulator console command
adb logcat [ ] - View device log
adb forward - forward socket connections
forward specs are one of:
jdwp: (remote only)
adb jdwp - list PIDs of processes hosting a JDWP transport

adb install [-l] [-r] - push this package file to the device and install it
('-l' means forward-lock the app)
('-r' means reinstall the app, keeping its data)
adb uninstall [-k] - remove this app package from the device
('-k' means keep the data and cache directories)
adb bugreport - return all information from the device
that should be included in a bug report.

adb help - show this help message
adb version - show version num

(no option) - don't touch the data partition
-w - wipe the data partition
-d - flash the data partition

adb wait-for-device - block until device is online
adb start-server - ensure that there is a server running
adb kill-server - kill the server if it is running
adb get-state - prints: offline | bootloader | device
adb get-serialno - prints:
adb status-window - continuously print device status for a specified device
adb remount - remounts the /system partition on the device read-write

adb ppp [parameters] - Run PPP over USB.
Note: you should not automatically start a PDP connection.
refers to the tty for PPP stream. Eg. dev:/dev/omap_csmi_tty1
[parameters] - Eg. defaultroute debug dump local notty usepeerdns

adb sync notes: adb sync [ ]
can be interpreted in several ways:

- If is not specified, both /system and /data partitions will be u

- If it is "system" or "data", only the corresponding partition
is updated.

now with all that said. make sure you have the adb drivers, they're posted in the sdk if you have the new spl, you'll more than likely need the drivers posted here. there shouldn't be a reason why your phone wont connect to adb with the drivers listed. so with that said lets move on.

Commands( used while typing adb shell)
Like DOS the command "cd" (change dir) is used to move through the file system;
cd data
cd app

will take you to /data/app, you can also type cd /data/app which will take you to the same area, and wildcards work here too, if you get an error it means you either there is no file/dir with that name or there is more than one file/dir that starts/ends with the wildcard)

so you wanna know what files are listed in the dir that you are in? typing "ls" (l as in lizard) will show all files (those with out the . before the name); "ls -a" will show every file/dir even ones listed with . infront (hidden files); "ls -l" will show the chmod level, size, datemodified, and name and more.

how to mount /system/ for read/write:
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
(if doing this from terminal you'll need to type su, then the command above.

so you wanna add files to the phone from adb? typing adb push C:\path\to\file\filename.ext /sdcard/ will place the file root of the sdcard, i prefer this way than directly into the phone /system/ because from adb shell; you can just cp /sdcard/filename.ext /system/

so you want to remove files from your phone? - adb shell rm /path/to/file/NameOfAPK.apk
(file/dir names are case sensitive so make sure you spell it right, or if you're lazy you can use wild cards known as * , like so, rm /path/to/file/NameO* and anything that begins with NameO will be removed , same goes for ending with; rm /path/to/file/*OfAPK.apk, anything that ends with OfAPK.apk will be removed.)

this will conclude the data for today, will post more later; if you have questions please ask.

Formatting sdcards made easy.

Wednesday, June 24, 2009
For those who don't know how to format their sdcards to perform apps2sd its really really really simple.. but the tools are somewhat confusing to some. so im just going to go the easy way, some will say find Paragon partition manager "illegally" , but im going to say scratch that.

The easiest way to go is to download ubuntu, its simple easy to use, and you don't have to install anything at all. the only knowledge you need to have is how to burn an iso image, which isn't hard at all. but if you don't just click here. Now with that said, Lets download ubuntu here. once that's done make the cd, then back up everything on your sdcard, put it where you wont forget where its at. (its easy to do that sometimes) anyways, once you've backed up your files, reboot your computer and boot from cd, some computers promt to boot from cd, sometimes you have to hit f12 or some other type of key combination, besure to do that, now when booting you'll see a bunch of text, just let it work its self, soon it will ask you the language, default is english , then it will ask if you want to try ubuntu, press enter, once its booted up, you will want to connect your phone and mount the sdcard, you should see it show up on the desktop

Almost there!, ok back to the guide, now what you'll want to do is on the top of the screen click system>administration>partition editor , the first drive you will see is your HD:

There is a drop down menu on the right and it should show 2 devices, if more, you have other memory units connected. but i only have 2, so /dev/sdb is my sdcard, so select that one, now what you will see is a unmodified sdcard hopefully:

(if yours is partitoned... why are you reading this.)

Now what you will want to do is click on the lower window's text that says /dev/sdb1 and select unmount (/dev/sdb1 what this means is device/name1 / 1 being the first partition and the keys means its mounted and we cant do anything to it -- in the formatting sense, so right click it and unmount it)

After that, delete the partition

This will format the card, and give it all that free space back, next right click on it and click new, it will give you a window like:

Now your sizes will be different than mine but all you need to do is select fat32 (this is where the camera stores all the pictures,music,downloads from the phone, what you see on a mounted sdcard in windows), and put 500 for the begining of the partition (this will be where the apps2sd goes 500mbs is good but you can change it up to what ever you want, but in my opinion anything over 500 is overkill) so go ahead and click add

Now you'll have a nice large partition for your info on the sdcard, and a small unallocated partition in the front, go ahead and click new on that the unallocated spot, and this time just change the format to ext2 or ext3 then click add (most roms use ext2, but are starting to use ext3 so check the rom's type before selecting ext3)

after thats done, click apply it should take just a short time, and ofcourse you'll know when you're finished.

now its safe to reboot and take the cd out. now congratulate yourself on formatting your sdcard. on the post about flashing theres a link to the apps2sd's app, or you can get it from the market, you'll want to copy existing files over - and well it guides you ... also when ever you're flashing to a newer rom you'll want to format that ext2/ext3 clean before flashing. your apps and system info might still be on the ext2/ext3 side and could cause a boot loop. any other questions just comment and ill get back too it when i can.

Hero Status

Monday, June 22, 2009
For those using Hero, i've repacked a non-gloss version of the status icons, (it annoyed me, just didnt seem to fit)

Download: here

How to install:
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system
cp /sdcard/framework-res.apk /system/framework/framework-res.apk

Make sure you reboot.

Biggest noob guide of flashing your phone

Since there has been an over abundance of Noobs on XDA I would post a VERY Noob friendly guide on how to flash your phone.
(Since i live in the states, this guide will be for usa users only. this guide will mostly follow this guide, which has support for other locale's)
Users Note: if your phone is already flashed skip down to the advanced part below. (my phone wont have the same look as yours don't worry about that)
Also, If you don't know what "mount" or "unzip" or "format" anything like this don't read on and just give up.

So, starting out what you will need and what will help you out.
adb drivers - x86/x64
Updated Drivers - for updated spl
Android SDK - Useful android tools. (i would say this is a must, but its not)
adb noob guide

Needed Files:
DREAMIMG.nbh - rc29 downgrade file
Recovery.img - wipes system installs updates etc.
Hard SPL - pre haykuro spl (works with jf rc30+/adp1.5/ion builds)
Jf rc33 - basic rom
(download all of these)

Let's Get Started
First things first, plug your phone up to the computer using the usb cord, (this is going to be SUPER NOOB FRIENDLY....) mount/connect your sdcard and back up anything you have on it, after you do that , its down to the nitty gritty.

Ready to break your phone? im sure you're not so follow the instructions, you should be good , and i hope you have a full battery. its time to downgrade. since your phone should still be mounted, go ahead and right click on the drive (your mounted sdcard not one of your hardrives) and select format, you will want to format this drive in fat32 once this is done, go ahead and unzip the and place the dreaimg.nbh on the sdcard. once that is finished go ahead and turn your phone off.

Now hold down your camera button and press the power button, it should promt you through the process. don't turn the phone off unhook the phone, take the battery out ... anything doing so, will of course brick your phone. now when you're finished clap your hands, you're now on rc29, just a few more steps closer to a rooted phone, and on to the bigger and better Roms.

Now go ahead and remount your sdcard, and remove the Dreaimg.nbh and add in the recovery.img, and the hardspl (should be to your sdcard. Go to Market download Telnet, after doing that shut the phone off, and then turn it back on DONT DO ANYTHING except flip out your keyboard press enter twice, then type telnetd and then press enter again. (yes this will bring up contacts all is fine)
go ahead and open telnet, and connect to localhost, if done right you should see "#" if not , or can't connect, just reboot and start the process over again, if you do give yourself a pat on the back.

Now type these exactly as it is:
mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system (press enter)
cd sdcard (press enter)
flash_image recovery recovery.img (press enter)
cat recovery.img > /system/recovery.img (press enter)

After this is done, shut your phone off, hold the home key and press power, this will put you in recovery mode, from there you will want to press alt+L then alt+S (yes on the phone not your computer)
this will add the new spl, again do not unhook your phone,power it off or anything that will disrupt the phone from its update.

once this is done, your has root hurray! now you will want to download a rom something like:
Google Ion
more roms are listed here (avoid most of haykuro builds , the neeed special spl/radio images, which ill get into shortly)

Now i assume you downloaded the rc33, Go ahead and remount your sdcard, remove all the files you have on it, and put the rc33 file on there, rename it as and shut your phone off, press the home key + power, then alt+L then Alt+w, then alt+s let this update again the usual don't disrupt the update, once finished press home and back to reboot. you should have some new goodies now you've got a fully flashed phone!

now to get into the more advanced stuff. you'll want to shut your phone off ... yes again, and press the camera + power , you will be in fastboot mode, on the top it should say dreaimg or something related, PVT or DVT or something similar, we want to have pvt, if you dont, im sorry dont flash radio's or spl's there have been many issues regarding haykuro's spl's with DVT based phones, if you have PVT awesome. (keep reading if you want to update your spl and radio for the haykuro roms / hero )

Advanced: - new spl and new radio's (be sure to have a PVT based phone read above) --beware these options have been known to brick phones, i strictly advise you to take great risk in reading posts from xda on flashing to the new spl, before flashing anything new, and i say again, READ ONLINE ABOUT FLASHING TO HAYKURO's NEW SPL. --don't blame me for your incompetence i have warned you.

Downloads: Radio
1.33.2005 spl - Haykuro's spl

go ahead and add these files to the sdcard, first flash the radio, and i will say again RADIO FIRST!... rename the to, turn the phone off, once off hit home + power , apply the update with Alt+s, once thats done, go ahead and reboot home+back, then go back to the sdcard , remove the, and rename the to then again shut the phone off, boot into recovery again and do the same thing before , applying the update, if done right your phone will boot up... if it has some issues, cant get back into recovery, cant get your phone on .. cant do anything .... you're bricked...

No issues? good! lets move a bit more forward with getting your phone to its best, lets go ahead and update that recovery.img, cyanogen has modified JF's recovery.img to suit some better needs and less keyboard usage. follow his instructions to update your recovery.img.

once thats done, you've got everything updated, the spl/radio/recovery we're ready to move on to the hero images. or other builds listed here please look around about their info. but moving into the guide ill be using jac's hero-rom.

Download/thread go ahead and download his latest ROM, save the file to your sdcard renamed as, turn your phone off, home + power, wipe your data, apply the update, reboot. your phone will take a while to boot, what your phone is doing is adding optimizations, checking the file system, if your phone takes more than 10 mins something is probably wrong, try redownloading the file, and retry the process again. Ive had issues before renaming the file while on the sdcard so try renaming on the computer then move to the sdcard, if that doesn't help post in the DREAM section of xda' not dream and development just DREAM which is located here.

Now if you haven't had any issues, pat yourself on the back. but i will mention like all things most Roms are not completely finished, HERO builds are all moded from Haykuro's ORIGINAL unwatermarked build, which was not finished, it was the first "stable" build that somewhat worked to a usable manner. so most builds/rom's will have issues. "its a feature not a bug" soo.... just wait around soon , there will be a port of a 100% hero... just ... not at this time..
if you have questions or comments please read around on the net before doing anything... and if you don't trust your intellect on flashing your phone or doing anything to your phone. don't.

Testing some shit out

Friday, February 27, 2009
i think im going to steal back my old blog shit and start posting new stuff in here.. so lets get the templates started.