Where i am android

Android Debug Bridge

In this document

Android Debug Bridge (adb) is a versatile command line tool that lets you communicate with an emulator instance or connected Android-powered device. 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 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 daemon, which runs as a background process on each emulator or device instance.

ads

Where i am android

You can find the adb tool in <sdk>/platform-tools/ .

When you start an adb client, the client first checks whether there is an adb server process already running. If there isn't, it starts the server process. When the server starts, it binds to local TCP port 5037 and listens for commands sent from adb clients—all adb clients use port 5037 to communicate with the adb server.

The server then sets up connections to all running emulator/device instances. It locates emulator/device instances by scanning odd-numbered ports in the range 5555 to 5585, the range used by emulators/devices. Where the server finds an adb daemon, it sets up a connection to that port. Note that each emulator/device instance acquires a pair of sequential ports — an even-numbered port for console connections and an odd-numbered port for adb connections. For example:

Emulator 1, console: 5554

Emulator 1, adb: 5555

Emulator 2, console: 5556

Emulator 2, adb: 5557

and so on.

As shown, the emulator instance connected to adb on port 5555 is the same as the instance whose console listens on port 5554.

Once the server has set up connections to all emulator instances, you can use adb commands to access those instances. Because the server manages connections to emulator/device instances and handles commands from multiple adb clients, you can control any emulator/device instance from any client (or from a script).

Where i am android

Enabling adb Debugging

In order to use adb with a device connected over USB, you must enable USB debugging in the device system settings, under Developer options .

On Android 4.2 and higher, the Developer options screen is hidden by default. To make it visible, go to Settings > About phone and tap Build number seven times. Return to the previous screen to find Developer options at the bottom.

On some devices, the Developer options screen may be located or named differently.

Note: When you connect a device running Android 4.2.2 or higher to your computer, the system shows a dialog asking whether to accept an RSA key that allows debugging through this computer. This security mechanism protects user devices because it ensures that USB debugging and other adb commands cannot be executed unless you're able to unlock the device and acknowledge the dialog. This requires that you have adb version 1.0.31 (available with SDK Platform-tools r16.0.1 and higher) in order to debug on a device running Android 4.2.2 or higher.

For more information about connecting to a device over USB, read Using Hardware Devices .

You can issue adb commands from a command line on your development machine or from a script. The usage is:

If there's only one emulator running or only one device connected, the adb command is sent to that device by default. If multiple emulators are running and/or multiple devices are attached, you need to use the -d. -e. or -s option to specify the target device to which the command should be directed.

Related posts

  • The Best Ereader for Android Reading ebooks on Android used to be just okay. Now it's awesome. While there are plenty of sweet apps for reading books on your phone or tablet, Play Books has...

  • Video: Hands-on With New Instagram Video on Android Not that it was much of a surprise after a couple of reports broke the news in the days leading up to today’s Facebook event, but yes, they...

  • 4 Pics 1 Word Answers & Cheats 4 Pics 1 Word answers, cheats, and hints will show you how to beat all levels and letters of the game for iPhone, iPod, iPad, and Android. Guess the word that the...

  • Minecraft: Pocket Edition (for Android) Solid mining and crafting experience. Looks and plays great. Dead simple multiplayer. Continuous development. Not as deep as the PC version. Some touch...

  • [Android] What Is Superuser Gaining root on an Android device is not attained by unlocking the bootloader, or installing a custom recovery, but by flashing a small file called superuser....