The OnePlus 6 is officially on sale! Buy now →
Remove All Ads from XDA
OnePlus 6 On Sale

Basic adb/shell commands for noobs

1,146 posts
Thanks Meter: 79
By brandenk, Senior Member on 22nd May 2009, 08:11 PM
Post Reply Email Thread
18th May 2012, 10:43 AM |#51  
Junior Member
Thanks Meter: 0
Originally Posted by brandenk

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

adb pull /system/sd/app app
adb pull /system/sd/app-private app-private
Push apps back to phone from the computer
adb push app /system/sd/app
adb push app-private /system/sd/app-private
Delete existing apps on SD
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)
$  su
# cd /data
# wget
# 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:
adb shell mount /sdcard
adb shell rm /sdcard/
adb push *filename* /sdcard/

From Fastboot

Restoring a nandroid backup - Start command-prompt/terminal cd to the nandroid folder and enter following commands
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 ?
6th August 2012, 09:20 PM |#52  
ri123's Avatar
Senior Member
Thanks Meter: 30
What about /data directory???
9th August 2012, 02:51 PM |#53  
ri123's Avatar
Senior Member
Thanks Meter: 30
Do I need root to pull installed apps?
15th August 2012, 08:07 AM |#54  
TheDarkDefender's Avatar
Senior Member
Flag Reston, VA
Thanks Meter: 6,524
Originally Posted by Pinesal

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?
3rd July 2013, 08:24 PM |#55  
Senior Member
Thanks Meter: 22
Sorry wrong forum...
6th May 2014, 10:00 PM |#56  
Senior Member
Thanks Meter: 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)?
14th January 2015, 10:31 AM |#57  
bartolinio's Avatar
Senior Member
Flag Koszalin (Poland)
Thanks Meter: 377
Donate to Me
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
4th March 2015, 06:15 PM |#58  
Junior Member
Thanks Meter: 0
This comes in handy as well when trying to modify system files:

mount -o remount rw /system
14th February 2017, 11:27 AM |#59  
Junior Member
Thanks Meter: 0
Fix NO SIM / MODEM after Recovery with TWRP

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 ?


regards, Gopher.
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