Android/Adb: Difference between revisions

From OLPC
Jump to navigation Jump to search
No edit summary
No edit summary
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
Android Debug Bridge (adb) is a versatile command line tool that lets you communicate with an emulator instance or connected Android-powered device.
Android Debug Bridge (adb) is a versatile command line tool that lets you communicate with an emulator instance or connected Android-powered target.
It is a client-server program that includes three components:
It is a client-server program that includes three components:


A client, which runs on your development machine. You can invoke a client from a shell by issuing an adb command. Other Android tools such as the ADT plugin and DDMS also create adb clients.
*A client, which runs on your development machine. You can invoke a client from a shell by issuing an adb command. Other Android tools such as the ADT plugin and DDMS also create adb clients.
A server, which runs as a background process on your development machine. The server manages communication between the client and the adb daemon running on an emulator or device.
*A server, which runs as a background process on your development machine. The server manages communication between the client and the adb daemon running on an emulator or target.
A daemon, which runs as a background process on each emulator or device instance.
*A daemon, which runs as a background process on each emulator or target instance.


You can find the adb tool in <sdk>/platform-tools/. [http://developer.android.com/sdk/index.html Where to download Android SDK]
You can find the adb tool in <sdk>/platform-tools/. [http://developer.android.com/sdk/index.html Where to download Android SDK]


On Android phones and tablets (the target), connection between the server and the daemon is by USB cable, with the development machine in USB host mode, and the target in USB device mode. The target USB port meets the USB OTG specification, switching between master and slave configuration.
On XO-4 since we only has USB host port, the way of using ADB is a little different form topic Android device. We use ADB via WIFI instead of via USB.


The XO-4 does not have a USB port that meets the USB OTG specification.
First make sure the deamon on your XO-4 is enabled.

Settings->Developer options[/DeveloperOptions how to enable developer options]->USB debugging


On XO-4 since we only have a USB host port, the way of using ADB is a little different from a typical Android device. We use ADB via WiFi instead of via USB.


First, make sure the deamon on your XO-4 is enabled.


Settings->Developer options[[../DeveloperOptions|(How to enable developer options)]]->USB debugging


Then, enable WIFI on XO-4 and get the IP address.


Settings->Wi-Fi->Menu on top right corner(three points)->Advanced->IP address


Connect XO-4 using ADB tools on your development machine.
adb disconnect && adb connect 192.168.101.125
adb shell
shell@xo4:/ $ ls


See also
See also

Latest revision as of 00:07, 29 February 2016

Android Debug Bridge (adb) is a versatile command line tool that lets you communicate with an emulator instance or connected Android-powered target. It is a client-server program that includes three components:

  • A client, which runs on your development machine. You can invoke a client from a shell by issuing an adb command. Other Android tools such as the ADT plugin and DDMS also create adb clients.
  • A server, which runs as a background process on your development machine. The server manages communication between the client and the adb daemon running on an emulator or target.
  • A daemon, which runs as a background process on each emulator or target instance.

You can find the adb tool in <sdk>/platform-tools/. Where to download Android SDK

On Android phones and tablets (the target), connection between the server and the daemon is by USB cable, with the development machine in USB host mode, and the target in USB device mode. The target USB port meets the USB OTG specification, switching between master and slave configuration.

The XO-4 does not have a USB port that meets the USB OTG specification.

On XO-4 since we only have a USB host port, the way of using ADB is a little different from a typical Android device. We use ADB via WiFi instead of via USB.

First, make sure the deamon on your XO-4 is enabled.

  Settings->Developer options(How to enable developer options)->USB debugging

Then, enable WIFI on XO-4 and get the IP address.

  Settings->Wi-Fi->Menu on top right corner(three points)->Advanced->IP address

Connect XO-4 using ADB tools on your development machine.

  adb disconnect && adb connect 192.168.101.125
  adb shell
  shell@xo4:/ $ ls

See also