Basic adb/shell commands for noobs

Search This thread

brandenk

Senior Member
Aug 11, 2007
1,147
81
San Diego
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* [I](add -nc to the end for JFv1.5ADP)[/I]


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:

youngstacks74

Senior Member
Mar 19, 2008
166
5
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
 

NeoBlade

Senior Member
Jan 26, 2009
593
79
www.eMagi.co.uk
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.
 

mecho

Member
Sep 16, 2008
29
0
how i resolve permission denied error in ADB Shell ??

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

any idea?
 

TainT

Senior Member
Aug 27, 2007
147
5
A Desert ****Hole
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:
 

Pinesal

Senior Member
Jan 28, 2009
515
19
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.
 

papo08

Member
Nov 18, 2009
7
0
ok I was going to go swap to a Moment today...not anymore. I'll be back after drinking a pot of coffee, theres a TON of info here. Thanks guys...lots of work put in by many. Its appreciated!
 

wensterretje

Member
Nov 25, 2008
13
0
???????

I've installed adb file explorer and I have my G1 connected to the PC but I can see nothing in the right side of ADB. Why ?????

helpppppp svp
 

wensterretje

Member
Nov 25, 2008
13
0
????

[QUOTE = brandenk; 3820215] Hier is een lijst van enkele van de ADB en terminal commando ik heb het gebruikt Android vaak. Ik vond dat ik altijd was te hoeven opzoeken deze commando's dus ik dacht dat ik zou beginnen met het bijhouden van de gemeenschappelijke regels voor het geval ze kunnen helpen iemand anders. Als een van deze behoeften correcties of als u een goed toe te voegen post het.

[COLOR = "Red"] Let wel, ik typ "cd C: \ Android" om naar mijn Android map voordat je deze commando's in de command prompt in Windows. Op die manier als ik dingen als pull-apps ze terecht in "C: \ Android \ apps", hetzelfde als ik wil verzenden ik bestand naar mijn telefoon gooi ik het in mijn map Android en stuur deze naar de telefoon vanaf daar. [/ COLOR]


[SIZE = "3"] Door ADB [/ B] [/ SIZE]

Apps Trek telefoon naar de computer
Code:
 ADB pull / system / sd / app app
ADB pull / system / SD / app-prive-app-private [/ CODE]

Push apps terug naar de telefoon van de computer
[CODE] ADB push app / system / sd / app
ADB push app-private / system / SD / app-private [/ CODE]

Verwijder bestaande apps op SD
[CODE] ADB shell rm-r / system / sd / app
ADB Shell rm-r / system / SD / app-private [/ CODE]


[SIZE = "3"] [B] via Terminal [/ B] [/ SIZE]

Partition SD-kaart - Dit wist alles op je SD-kaart (* maat * dat de grootte van het FAT32-partitie)
[CODE] $ su
# Cd / data
# Wget http://64.105.21.209/bin/lib/droid/sdsplit
# Chmod 555 sdsplit
# / Data / sdsplit-fs * maat * [I] (add-nc aan het einde voor JFv1.5ADP) [/ I] [/ CODE]


[SIZE = "3"] [B] Van de Recovery Screen [/ B] [/ SIZE]

Het verzenden van een update-bestand op uw SD-kaart:
[CODE] ADB shell mount / SDcard
ADB shell rm / SDcard / update.zip
ADB push * bestandsnaam * / SDcard / update.zip [/ CODE]


[SIZE = "3"] [B] Van fastboot [/ B] [/ SIZE]

Nandroid het terugzetten van een backup - Start command-prompt/terminal cd naar de nandroid map en voer volgende commando
[CODE] fastboot wissen boot
fastboot wissen herstel
fastboot flitssysteem system.img
fastboot flash boot boot.img
fastboot flash userdata data.img
fastboot flash herstel recovery.img
fastboot reboot [/ CODE] [/ QUOTE]

Bij mij waarom commado su-permission denier ?????

Wat moet ik doen ???  Helppppppp :confused::confused:
 

jamesyb0i

Senior Member
Oct 17, 2009
358
16
If an .apk won't install does that mean it's incompatible / bad? e.g. if i get this message in adb

adb install Stk.apk
771 KB/s (67151 bytes in 0.085s)
pkg: /data/local/tmp/Stk.apk
Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE]
 
Last edited:

Firerat

Senior Member
Feb 24, 2009
3,848
185
If an .apk won't install does that mean it's incompatible / bad? e.g. if i get this message in adb

Code:
adb install Stk.apk
771 KB/s (67151 bytes in 0.085s)
pkg: /data/local/tmp/Stk.apk
Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE]

looks like it is incompatible and the install failed ;)
edit: pah, just read your sig
Doh : ) maybe minimum requirement is 2.0 and your rom is 1.6
ok, so you are probably not running a donut ROM

what ROM are you running?
what apk are you installing and where did you get it

ps this is probably not the best place to post this, it has nothing to do with adb, I'm sure you would get similar error from android Application Manager
Code:
am start -a android.intent.action.VIEW -t application/vnd.android.package-archive -d file:///sdcard/your.apk
 
Last edited:

mrsato

Senior Member
Sep 20, 2009
124
8
Yokohama
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:

I didn't see any response to this, so...

What I gathered from some other threads was that you need USB 2.0 (or greater?). One guy solved his problem by installing a USB 2.0 card in his pc, if that's an indicator.
 

Tyto

Senior Member
Dec 3, 2008
58
2
I there i'm tryng to unninstall a app but i'm with problem's

# pm disable com.xendex.RedBullXFighters
# pm uninstall com.xendex.RedBullXFighters
pm uninstall com.xendex.RedBullXFighters
Failure

I have done a small test and i got sucess with this one, but what i realy want was to unnistall the above app

# pm uninstall com.kmagic.solitaire
pm uninstall com.kmagic.solitaire
Success
 
Last edited:

juangil

Senior Member
Jan 29, 2009
1,514
111
PhOeNiX ArIzOnA
I there i'm tryng to unninstall a app but i'm with problem's

# pm disable com.xendex.RedBullXFighters
# pm uninstall com.xendex.RedBullXFighters
pm uninstall com.xendex.RedBullXFighters
Failure

I have done a small test and i got sucess with this one, but what i realy want was to unnistall the above app

# pm uninstall com.kmagic.solitaire
pm uninstall com.kmagic.solitaire
Success

I would try:
mount -a
rm -r /<app location ie; system/app/<app name> (enter)
 

Top Liked Posts

  • There are no posts matching your filters.
  • 46
    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* [I](add -nc to the end for JFv1.5ADP)[/I]


    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
    6
    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.
    2
    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.
    1
    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
    1
    You will see your device with fastboot devices only if your phone is connected to your PC and it must be in *fastboot mode*.