The little thing about adb--remote ADB commissioning

Source: Internet
Author: User


1. Preface1.1. write it in front.


TV assistant implementation of the study "in the LAN directly through the adb Installation application, this article continues to introduce the adb adb adb principle " adb How to use "



To the extent that this article describes: in the LAN, if the adb remote debugging, i.e., how to use the LAN in the case of no data cable CD development.


1.2. background of this article


android programmer, the most touch of the day is eclipse adb . In the process of development, we should not be unfamiliar with these scenarios:



a.           mobile phone is testing the hands of students, But we want to catch log



a)            Let the students of the test help catch log



b)            Let the test students send their mobile phone, or go to fetch them, but need to waste at least 10 a few minutes.



b.           The computer connects to a machine that the other classmate (develops or tests) brought over the phone.



C. Long-time use,adb data cable is damaged or not very sensitive .



So is there a good way to solve these problems? This article will then do a discussion.




2. Technology Implementation Research2.1. the principle of remote debugging

to understand why you can debug remotely, first of all, it is simple to sayadbthe principle. What we usually say.adbin theAndroidis implemented as aC/Sstructure, in whichServerEnd is calledADBD, which isadbDaemon, which runs on the phone. ForC/Sstructure of the command of the execution response process, everyone should be more familiar with, no longer do the introduction. Here, go ahead.ADBD,ADBDprovides two ways to listen for client requests:USBand theTCP/IP, whereUSBmode is the default listening mode for the system.


So, combined with the the The introduction of the TV Assistant Implementation study, what we should do next is more obvious:



1. First, set the phone's adbd tcp/ip Span style= "font-family: Song body" > way;



2. second, set Span lang= "en-US" >adbd Listening to a specific port;



3. Finally, on the remote (computer) through ADB Connect connect to your phone.



with the above three, we can remotely CD Debug and Print Log up. The next step is to introduce specific implementations and some issues to be aware of.




2.2. Specific Technology Implementation


to implement adb remote debugging, the first need to have a mobile phone Root permissions can be easily judged by the following code:







in judging the phone has a temporary Root permissions, the next step is to set ADBD Listen for ports and reboots ADBD make the port effective, the code is as follows:



in the default case ADBD The listening port is "5555" , which can be tailored to your needs (e.g. 5555 whether or not it is occupied) to modify.







After you complete the previous operation, you can go to the phone " Set ->wlan-> is currently in use WiFi information on hotspots " View in IP information can also be obtained using the following methods:





 



Next you can cmd "ADB connect" Connect just the ip adb debugging, if successful will show "connected to xxxxx" "Unable to connect to xxxxx"







Finally, after the remote debugging is complete, remember to put the phone adb revert to USB mode:







Well, here, this article is finished, there is a problem environment exchange discussion.



The little thing about adb--remote ADB commissioning


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.