Android ADB Introduction

Source: Internet
Author: User

1. What is ADB

An important command that contains the Android emulator operation under the Tools folder of the SDK Adb,adb is all called Android Debug Bridge, which is the role of debug bridges. With this tool, we can manage the status of the device or phone simulator and do the following:

(1) Quickly update the code in the device or phone simulator, such as app or Android system upgrade;

(2) Run the shell command on the device;

(3) Management equipment or mobile phone simulator on the predetermined port;

(4) Copy or paste the file on the device or phone simulator.

The official website reads as follows:

Android Debug Bridge (ADB) is a versatile command line tool this lets you communicate with an emulator instance or connect Ed android-powered device. It's a client-server program, 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 device.
    • A daemon, which runs as a background process on each emulator or device instance.

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

When you start a 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 is starts, it binds to local TCP ports 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 all Emulator/device instance acquires a pair of sequential Ports-an even-numbered port for console connection S 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 are the same as the instance whose console listens on port 55 54.

Once the server has a set up connections to all emulator instances and 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 CA N Control any Emulator/device instance from any client (or from a script).

2. Start adb

When I use ADB to install APK, I prompt:

ADB server is an out of date.  Killing ... ADB server didn ' t ack* failed to start daemon *

The reason is that the phone assistant installed on the computer occupies the ADB port 5037, so the ADB does not start up. If you can exit the phone assistant, and plug in the phone after the assistant will not occupy the port of ADB, it can be retained. Helpless, my PC's mobile helper can not do, I only unload it. After the uninstall is OK, the command line under the ADB operation will be able to start the ADB server. If you need to install an iOS package, you can use itools. Trial, will not cause the above problems.

When using ADB, you need to turn on Android debug mode.

Android ADB Introduction

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.