Difference between revisions of "Android Debug Bridge - adb shell guide"

From thelinuxwiki
Jump to: navigation, search
Line 28: Line 28:
 
at this point you are connected to your device.  You can move around the phone file system, list files, etc..
 
at this point you are connected to your device.  You can move around the phone file system, list files, etc..
  
'''copy files off the device'''
+
copy files off the device
 
   $ adb pull /pathtofileondevice localfilename
 
   $ adb pull /pathtofileondevice localfilename
 
'''
 
'''
 
copy files to the device'''
 
copy files to the device'''
 
   $ adb push localfilename /pathtofileondevice
 
   $ adb push localfilename /pathtofileondevice
 +
 +
backup a device
 +
 +
I attempted the below procedure but the backup would hang at the shared storage (sdcard).
 +
 +
$adb backup -shared -all -f my_backup_file
 +
Now unlock your device and confirm the backup operation.
 +
 +
You will be promped on screed at the device to confirm the backup by selecting "Back up my data".  You can also choose to encrypt the backup file and lock it with a password.  (android 4.2.2)
 +
  
 
[http://developer.android.com/tools/help/adb.html Full Android Debug Bridge reference at android.com]
 
[http://developer.android.com/tools/help/adb.html Full Android Debug Bridge reference at android.com]

Revision as of 12:50, 3 February 2014

Android Debug Bridge

connecting to a physical phone using adb

enable developer usb debugging

go to and enable: Settings > Applications > Development > USB debugging

enabling app installation

go to and enable: Settings > Applications > Unknown sources


command line

The adb command line utility is installed as part of the Android SDK

list locally attached devices

$ adb devices
List of devices attached 
c7b5b844        device

run shell interactively

$ adb shell
shell@android:/ $ 

at this point you are connected to your device. You can move around the phone file system, list files, etc..

copy files off the device

 $ adb pull /pathtofileondevice localfilename

copy files to the device

 $ adb push localfilename /pathtofileondevice

backup a device

I attempted the below procedure but the backup would hang at the shared storage (sdcard).

$adb backup -shared -all -f my_backup_file
Now unlock your device and confirm the backup operation.

You will be promped on screed at the device to confirm the backup by selecting "Back up my data". You can also choose to encrypt the backup file and lock it with a password. (android 4.2.2)


Full Android Debug Bridge reference at android.com