Adb over USB

From OMAPpedia

Revision as of 07:34, 23 January 2012 by Dorona (Talk | contribs)
Jump to: navigation, search

Android Gadget ADB: Linux PC Host


  1. OTG port is available and USB cable is connected to Target and Host
  2. Using Ubuntu on Host Machine


1. Boot the Android kernel with g_android built in and 'Android gadget adb' function selected

2. Connect one end of the cable to the MUSB port on the target and the other to the Linux HOST machine;

3. On the left hand top corner of the Android UI screen you should see a ‘USB Attached’ Notification.

4. Make sure on the target 'USB Debugging' is selected:

-On Android UI,
-Press F1 key,
-Goto Notifications
-Select USB debugging

5. To make ADB work for TI vendor ID, On your Host machine create the following file (if not already present):

$ sudo su
$ mkdir ~/.android
$ vi ~/.android/adb_usb.ini
$ echo "0x0451\n" > ~/.android/adb_usb.ini
$ cat /root/.android/adb_usb.ini

6. Mount the 'usbfs' filesystem on the Linux Host Machine (Note: optional step, ignore if usbfs is not present in Ubuntu 10.10)

$ sudo mount -t usbfs none /proc/bus/usb

7. Also, on the Host make sure adb server is running:

$ sudo su
$ cd <path>/mydroid/out/host/linux-x86/bin
$ ./adb kill-server
$ ./adb start-server

8. Verify that the gadget enumerated properly on the host (Linux PC) by running: (Note: optional step, ignore if usbfs is not present in Ubuntu 10.10)

$ cat  /proc/bus/usb/devices | grep “usbfs”

9. Now check that the device is connected:

$ cd <path>/mydroid/out/host/linux-x86/bin
$ ./adb devices

[output should be something like this] List of devices attached [serial number] device

$ ./adb shell

[This should take you to the console prompt of the board] to quit, type exit. 10. Write a file in to the FS on board:

$ ./adb push <path>/file ./

[This will transfer 'file' in to the / of the FS on the board, check using 'ls' on the console prompt of the board] 11. Read a file from the FS on board into the Host machine

$ ./adb pull ./file <path>/dir/

[This will copy 'file' from the FS into the Host machine]

NOTE: You can use locally built version that should just work on your boxes without the extra configurations.

 ADB Binary is here

NOTE: These instructions assume that you will always be running ADB operations in super user mode. To run ADB over USB as your normal user, create/edit adb_usb.ini in your home directory instead i.e step 5 would look this:

$ mkdir -p ~/.android
$ echo "0x0451" > ~/.android/adb_usb.ini
$ cat ~/.android/adb_usb.ini

However, you will have to start adb in sudo mode.

$ sudo <path>/mydroid/out/host/linux-x86/bin/adb kill-server
$ sudo <path>/mydroid/out/host/linux-x86/bin/adb devices
* daemon not running. starting it now *
* daemon started successfully *
List of devices attached
686A00011FF00000        device

Alternatively to allow specific user to have access without performing step above, follow the instructions on "Configuring USB Access" at

Create or update file /etc/udev/rules.d/51-android.rules

Add the following line to the file replacing username with actual username:

SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="d102", MODE="0666", OWNER="<username>"

Personal tools