Android developer guide (1) -- Android Debug Bridge (adb)

Source: Internet
Author: User

Preface

This chapter contains the developer Guide/Developing/Tools/adb. This is an excellent translation from "Mobile cloud _ Wenbin". Welcome to its blog: "http://blog.csdn.net/caowenbin", thanks again "Mobile cloud _ Wen bin "! We look forward to your participation in translation of Android related information, contact me over140@gmail.com.

Body

  Android Debug Bridge

AndroidDebug the bridgeAdbIs a universal tool used to manage the status of simulators or real machines.-The server model consists of three parts:

*The client is running on a development computer and can be run in the command line.AdbCommand to call the client, suchADBPlug-ins andDDMSSuchAndroidTools can also be calledAdbClient.

*The server is a background process running on a development computer. It is used to manage the communication between a client and a daemon running on a simulator or a real machine.

*The daemon part runs on the background of the simulator or mobile phone.

  When startedAdbThe client first detectsAdbWhether the server process is running. If not, start the server. When the server is started, it is bound to a localTCP5037And listen fromAdbCommands sent from the client -- allAdbAll clients use5037Port andAdbServer Communication.

  Next, the server connects to all running simulators or mobile phones. It scans5555-5585To search for simulators or mobile phones.AdbThe daemon processes are connected through this port. It must be noted that each simulator or mobile phone uses an ordered port, an even port is used for console connection, and an odd port is usedAdbConnection, for example:

Emulator 1 , Console: 5554
Emulator 1 , Adb: 5555
Emulator 2 , Console: 5556
Emulator 2 , Adb: 5557 ...

That is, if the simulator andAdbIn5555Port connection, the connection to the console is5554Port.

After the server is connected to all simulators, you can useAdbCommand to control or access. Because the server manages connections and can receive multipleAdbClient commands, so any simulator or mobile phone device can be controlled from any client or script.

The following describes the functions that can be used to manage simulators or mobile phones.AdbCommand. IfEclipseAnd installedADTDevelopment in the plug-in EnvironmentAndroidApplication, you do not need to useAdbNow,ADTThe plug-in already provides transparent integration. However, it can still be used directly when debugging and other needs are required.Adb.

 

  UseAdbCommand

UseAdbCommand usage:

      adb [-d|-e|-s <serialNumber>] <command>

When used, the program callsAdbClient. BecauseAdbThe client does not need to be associated with any simulators. Therefore, if multiple simulators or mobile phones are running, you need to use-DThe parameter specifies which one to operate,

Related Article

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.