Post Reply

Basic adb/shell commands for noobs

OP brandenk

22nd May 2009, 08:11 PM   |  #1  
brandenk's Avatar
OP Senior Member
Flag San Diego
Thanks Meter: 62
 
1,132 posts
Join Date:Joined: Aug 2007
More
Here is a list of some of the adb and terminal command I have used it Android frequently. I found that I was always having to look up these commands so I figured I would start keeping track of the common ones in case they can help anyone else. If any of these needs corrections or if you have a good one to add please post it.

Note, I type "cd C:\Android" to get to my Android folder before doing these commands in the command prompt in windows. That way when I do things like pull apps they end up in "C:\Android\apps", same thing if I want to send I file to my phone I throw it in my Android folder and send it to the phone from there.


Through ADB

Pull apps off phone onto computer
Code:
adb pull /system/sd/app app
adb pull /system/sd/app-private app-private
Push apps back to phone from the computer
Code:
adb push app /system/sd/app
adb push app-private /system/sd/app-private
Delete existing apps on SD
Code:
adb shell rm -r /system/sd/app
adb shell rm -r /system/sd/app-private

Through Terminal

Partition SD card - This erases everything on your SD card (*size* being the size of the FAT32 partition)
Code:
$  su
# cd /data
# wget http://64.105.21.209/bin/lib/droid/sdsplit
# chmod 555 sdsplit
# /data/sdsplit -fs *size* (add -nc to the end for JFv1.5ADP)

From the Recovery Screen

Sending an update file to your SD card:
Code:
adb shell mount /sdcard
adb shell rm /sdcard/update.zip
adb push *filename* /sdcard/update.zip

From Fastboot

Restoring a nandroid backup - Start command-prompt/terminal cd to the nandroid folder and enter following commands
Code:
fastboot erase boot
fastboot erase recovery
fastboot flash system system.img
fastboot flash boot boot.img
fastboot flash userdata data.img
fastboot flash recovery recovery.img
fastboot reboot
Last edited by brandenk; 1st July 2009 at 10:12 PM.
The Following 39 Users Say Thank You to brandenk For This Useful Post: [ View ]
17th June 2009, 09:06 PM   |  #2  
youngstacks74's Avatar
Senior Member
Thanks Meter: 5
 
164 posts
Join Date:Joined: Mar 2008
ok after i get adb workin i do the commands like this?

cd C:\Android adb pull /system/sd/app app

and if i wanna push em back i do

C:\Android adb push app /system/sd/app
17th June 2009, 09:14 PM   |  #3  
DeadPhoenix's Avatar
Senior Member
Flag Sacramento
Thanks Meter: 104
 
296 posts
Join Date:Joined: Apr 2009
Donate to Me
More
ADB for dummies Thread covers this.
17th June 2009, 09:18 PM   |  #4  
NeoBlade's Avatar
Senior Member
Thanks Meter: 80
 
589 posts
Join Date:Joined: Jan 2009
More
Nice list of commands, however you *might* want to remove the command to backup private apps ^_-

Also for those who are lazier to copy and paste, you can create .bat files which you can run under Windows and it will automatically run the commands within. Simply copy and paste the commands you want to run into Notepad. Save it with a suitable name but ending with .bat, for example - Restore All Apps.bat

It will now be changed into a batch command file so you can run it by double clicking.

I use a slightly different method where I can put the BAT file anywhere and instead of typing "cd C:\Android" to specify a directory, I just hold down SHIFT then double click on the bat command.

By holding down SHIFT before opening the bat file, it basically tells Windows to open the command prompt within the folder it resides in. Just another shortcut to cut down on commands :P

I suppose you could edit the .bat script further by specifying at the start what directory you want to work with before using the adb commands. You can also make it fancy by adding a menu etc etc.

EDIT: Last time I looked at ADB for dummies, the first post only illustrated how to get ADB working but it didn't actually have any useful commands to use at a glance.
The Following 5 Users Say Thank You to NeoBlade For This Useful Post: [ View ]
17th June 2009, 09:55 PM   |  #5  
youngstacks74's Avatar
Senior Member
Thanks Meter: 5
 
164 posts
Join Date:Joined: Mar 2008
just read everypage in the adb for dummies and i still dont know how to pull apps and cache to a certain folder and push them back to a new sd card
The Following User Says Thank You to youngstacks74 For This Useful Post: [ View ]
30th September 2009, 05:02 PM   |  #6  
Junior Member
Thanks Meter: 0
 
29 posts
Join Date:Joined: Sep 2008
how i resolve permission denied error in ADB Shell ??

it doesnt let me do a thing ! googled alot . couldnt find anything helpful

any idea?
30th September 2009, 05:29 PM   |  #7  
brandenk's Avatar
OP Senior Member
Flag San Diego
Thanks Meter: 62
 
1,132 posts
Join Date:Joined: Aug 2007
More
Are you using a development SPL like Cyanogen's Recovery 1.4?
30th September 2009, 06:17 PM   |  #8  
Junior Member
Thanks Meter: 0
 
29 posts
Join Date:Joined: Sep 2008
Quote:
Originally Posted by brandenk

Are you using a development SPL like Cyanogen's Recovery 1.4?

i have installed [Recovery] [16-Sept-2009] [RA-HERO-v1.2.2] via HTC SYNC . coudlnt installed it via ADB shell . permission denied error .
12th November 2009, 02:16 AM   |  #9  
TainT's Avatar
Senior Member
Flag A Desert ShitHole
Thanks Meter: 5
 
147 posts
Join Date:Joined: Aug 2007
More
anyone know why this wouldnt work with an old school usb 1.0 setup??
just wondered if the retard sammich i had this morning is kicking my ass or if im engaging in an act of futility??
Just doesnt seem right id have to walk all the way upstairs to use a lappy when the office setup would work just fine. No matter how much slower windows could possibly get :sarcasm:

Any consideration this plea gets will be appreciated by less posts and more reading :thumbsup:
12th November 2009, 02:24 AM   |  #10  
Senior Member
Thanks Meter: 19
 
503 posts
Join Date:Joined: Jan 2009
Maybe some commands on how to navigate the phone. I'm a DOS guy and the commands are similar

"dir" is "ls" for when you want a list of files and sub-directories in the current directory

"cd\" is is just "cd " (cd[space]) for changing the directory

returning to the previous directory is "cd .."

"del" is "rm" for deleting files (caution).

That's all I can think of right now.

The Following 2 Users Say Thank You to Pinesal For This Useful Post: [ View ]
Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes