Difference between revisions of "ADB Guide"

From odroid US
Jump to: navigation, search
(Created page with "<p style='color:red'>'''THIS GUIDE IS NOT YET COMPLETE, PLEASE BE PATIENT'''</p> This is a Guide on how to use ADB on all major Platforms (Windows, Linux, Mac) Windows users...")
 
 
(5 intermediate revisions by the same user not shown)
Line 3: Line 3:
 
This is a Guide on how to use ADB on all major Platforms (Windows, Linux, Mac)
 
This is a Guide on how to use ADB on all major Platforms (Windows, Linux, Mac)
  
Windows users should get the drivers first.
 
  
You can get them either by following this link:
+
=== Prerequisites ===
 +
 
 +
 
 +
'''Windows users should get the drivers first, otherwise nothing will work as expected'''.
 +
 
 +
'''You can get them either by following this link:'''
  
 
[http://com.odroid.com/sigong/nf_file_board/nfile_board.php Hardkernel Download Page]
 
[http://com.odroid.com/sigong/nf_file_board/nfile_board.php Hardkernel Download Page]
Line 11: Line 15:
 
or here (might get outdated):
 
or here (might get outdated):
  
[https://dl.dropbox.com/u/154183/odroid_xp_composite_driver.zip Dropbox Download Link]
+
[https://dl.dropbox.com/u/154183/odroid_xp_composite_driver.zip Dropbox Download Link from 2011-03-09]
  
Windows 8 Users MUST disable "Signed drivers only" installation, following this guide:
+
 
 +
Windows 8 Users '''MUST''' disable "Signed drivers only" installation, following this guide:
  
 
[http://dhakshinamoorthy.wordpress.com/2012/05/14/installing-an-unsigned-driver-in-windows-8-x64/ Installing unsigned Windows Drivers in Windows 8]
 
[http://dhakshinamoorthy.wordpress.com/2012/05/14/installing-an-unsigned-driver-in-windows-8-x64/ Installing unsigned Windows Drivers in Windows 8]
  
Linux and Mac users dont have to do anything from this.
+
Linux + Mac users dont have to do anything from the above.
  
  
Line 24: Line 29:
 
add adb command to your PATH variable:
 
add adb command to your PATH variable:
  
'''Linux + Mac:'''
+
 
 +
=== ADB Installation for Linux and Mac Users ===
  
 
<pre>export PATH=$PATH:/your/path/to/sdk/platform-tools</pre>
 
<pre>export PATH=$PATH:/your/path/to/sdk/platform-tools</pre>
Line 34: Line 40:
  
 
<pre>export PATH=$PATH:/your/path/to/sdk/platform-tools</pre>
 
<pre>export PATH=$PATH:/your/path/to/sdk/platform-tools</pre>
press <code>ESCAPE KEY :wq</code>
+
press <code>ESCAPE KEY :wq</code> to get into command mode, write the file and quit the editor
 +
 
 +
 
 +
=== ADB Installation for Windows 7/8 Users ===
 +
 
 +
#open the folder of your sdk and navigate to sdk\platform-tools [http://imageshack.us/a/img248/424/parallelspicture.png Screenshot]
 +
#rightclick the navigation bar and copy the selected path [http://imageshack.us/a/img11/9828/parallelspicture2.png Screenshot]
 +
#rightclick your computer on the desktop and click Properties [http://imageshack.us/a/img255/9387/parallelspicture6.png Screenshot]
 +
#click on Advanced system settings [http://imageshack.us/a/img600/6171/parallelspicture3.png Screenshot]
 +
#click on Environment Variables... [http://imageshack.us/a/img6/7647/parallelspicture4.png Screenshot]
 +
#in the System variables group search for Path and click on Edit... [http://imageshack.us/a/img14/9630/parallelspicture5.png Screenshot]
 +
#add a semicolon at the end of the line and then paste your path of the platform-tools folder [http://img59.imageshack.us/img59/2712/parallelspicture7.png Screenshot]
 +
#click ok
 +
#click ok again
 +
#click ok once again
 +
#open a cmd prompt (Win+R cmd)
 +
#type echo %PATH% to see whether it got applied well
 +
#type adb. if you get a very looooong output then everything should be well and you can use adb (dont forget to install drivers if you havent already)
 +
 
 +
 
 +
=== Listing connected devices ===
 +
 
 +
<pre>adb devices</pre>
 +
 
 +
=== Remounting System Partition RW ===
 +
 
 +
<pre>adb remount</pre>
 +
 
 +
=== Copying files to an adb Device ===
 +
 
 +
<pre>adb push local/file/or/folder /destination</pre>
 +
 
 +
=== Copying files from an adb Device ===
 +
 
 +
<pre>adb pull /remote/file/or/folder destination/file/or/folder</pre>
 +
 
 +
destination is optional here
 +
 
 +
=== Getting shell access ===
 +
 
 +
<pre>adb shell</pre>
 +
 
 +
=== Running a shell command ===
 +
<pre>adb shell ls</pre>
 +
 
 +
ls is the command here
 +
 
 +
=== Getting device logs ===
 +
 
 +
<pre>adb logcat</pre>
 +
 
 +
=== Installing apps ===
 +
 
 +
<pre>adb install your_app.apk</pre>
 +
 
 +
=== Uninstalling apps ===
 +
 
 +
<pre>adb uninstall your_app.apk</pre>
 +
-k switch can be used to keep data and caches
 +
 
 +
=== Full device backup ===
 +
 
 +
<pre>adb backup -apk -shared -all -nosystem</pre>
 +
 
 +
write backup file to backup.ab of specify -f file.ab to write it to file.ab
  
'''Listing connected devices:'''
+
=== Restoring a backup ===
  
<pre>adb list</pre>
+
<pre>adb restore backup.ab</pre>

Latest revision as of 16:24, 11 January 2013

THIS GUIDE IS NOT YET COMPLETE, PLEASE BE PATIENT

This is a Guide on how to use ADB on all major Platforms (Windows, Linux, Mac)


Prerequisites

Windows users should get the drivers first, otherwise nothing will work as expected.

You can get them either by following this link:

Hardkernel Download Page

or here (might get outdated):

Dropbox Download Link from 2011-03-09


Windows 8 Users MUST disable "Signed drivers only" installation, following this guide:

Installing unsigned Windows Drivers in Windows 8

Linux + Mac users dont have to do anything from the above.


Install the SDK via Android SDK Link

add adb command to your PATH variable:


ADB Installation for Linux and Mac Users

export PATH=$PATH:/your/path/to/sdk/platform-tools

or make it survice the exit of your terminal window:

vi ~/.bash_rc

press :i to get to insert mode and type:

export PATH=$PATH:/your/path/to/sdk/platform-tools

press ESCAPE KEY :wq to get into command mode, write the file and quit the editor


ADB Installation for Windows 7/8 Users

  1. open the folder of your sdk and navigate to sdk\platform-tools Screenshot
  2. rightclick the navigation bar and copy the selected path Screenshot
  3. rightclick your computer on the desktop and click Properties Screenshot
  4. click on Advanced system settings Screenshot
  5. click on Environment Variables... Screenshot
  6. in the System variables group search for Path and click on Edit... Screenshot
  7. add a semicolon at the end of the line and then paste your path of the platform-tools folder Screenshot
  8. click ok
  9. click ok again
  10. click ok once again
  11. open a cmd prompt (Win+R cmd)
  12. type echo %PATH% to see whether it got applied well
  13. type adb. if you get a very looooong output then everything should be well and you can use adb (dont forget to install drivers if you havent already)


Listing connected devices

adb devices

Remounting System Partition RW

adb remount

Copying files to an adb Device

adb push local/file/or/folder /destination

Copying files from an adb Device

adb pull /remote/file/or/folder destination/file/or/folder

destination is optional here

Getting shell access

adb shell

Running a shell command

adb shell ls

ls is the command here

Getting device logs

adb logcat

Installing apps

adb install your_app.apk

Uninstalling apps

adb uninstall your_app.apk

-k switch can be used to keep data and caches

Full device backup

adb backup -apk -shared -all -nosystem

write backup file to backup.ab of specify -f file.ab to write it to file.ab

Restoring a backup

adb restore backup.ab