Basic adb/shell commands for noobs

Search This thread

8526WM6

Senior Member
Aug 4, 2008
157
3
Daegu, South Korea
Help!!! I just Began flashing GR-10 but could not get into recovery mode to flash the ROM. I'm able get ADB working but don't know the commands to get the phone into recovery mode to flash the ROM with CWM...Really need some help here. Also when send the command recovery to the phone, the phone display goes haywire. Please help. Thanks in advance!!!
 

schreibman

Senior Member
Nov 13, 2011
88
18
Plano
ADB sees my device but not FASTBOOT device?

SO this is strange, I think I have something mucked up with all the flashing between GB and ICS on my NS4g, but I'm having iissues getting CWM to stick through rom manager, so I wanted to flash the recovery from fastboot.

Fastboot devices -> no devices
Adb Devices -> lists the device
adb shell -> no problem , root prompt

questions:
1) Why would ADB see the device but not fastboot?

2) I am a little unclear on how to flash a recovery image from adb shell, can someone assist? I have lots of bits and pieces, but I don't want to make a bigger mess.


adb push *filename* /sdcard/recovery.img
then? need to mount? chmod? uggh, sorry I am such a n00b.
 

mahroze

Senior Member
Aug 22, 2010
292
14
Lahore
i know this is kind of a noob question but hey this is a thread for noobs anyway. so i cant seem to run fastboot it say adbwinapi.dll not found please help
 
Last edited:

thaiyo8

Member
Apr 24, 2012
24
0
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

hi i am tring to restore using fastboot . but always waiting for device , mu devices is adb connected , does it take very long time ?
 

TheDarkDefender

Senior Member
Aug 5, 2012
4,092
6,434
33
Reston, VA
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.
how to make a nandroid backup?
 

tenjou_89

Senior Member
Mar 7, 2014
185
26
noob questions u.u

what are the commands to delete folders, not files or apks, inside the sdcard?

how can i partition the internal emulated sdcard of my phone, so that i have another separate partition in fat23 (or ntfs if possible)?
 

bartolinio

Senior Member
Dec 22, 2008
1,143
407
Koszalin (Poland)
I refresh ;)
command "rm -rf /system/app/folderX" deletes the entire folder and its contents? yes?
which command deletes all files in the folder, but does not delete the folder?
for example, I would like to delete all the files in the "folder/system/media/audio/alarms" but without removing the "alarms" folder
 

Gopher-TM-

Member
Jun 13, 2008
8
0
Fix NO SIM / MODEM after Recovery with TWRP

Hello,

I´m looking for the ADB command to fix the bug that after a revocery with TWRP the SIM card and / or the modem is not working correctly. I did this once before, unfortunately I lost that bookmark of this specific page with the solution.

There is a ADB command to fix this problem. Something with ADB SHELL /auto or like that. Anybody know what I´m talking about ?

Thanks,

regards, Gopher.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 47
    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*.