Xiaomi mobile phone via wifi connection adb debug Android app

Source: Internet
Author: User



Statement


Welcome reprint, but please keep the original source of the article →_→



Life One number: http://www.cnblogs.com/smyhvae/



Article Source: http://www.cnblogs.com/smyhvae/p/3824988.html









Body


The ADB remote debugging method for Android developers to bring convenience, the following describes my pro-measurement of effective WiFi connection to the ADB method. First of all to ensure that the computer and mobile phone in the same LAN , and mobile phone to be connected via WiFi is normal.



"Beta version"



Phone Model: Xiaomi 2S



System version: MIUI 4.6.27 (development version)




1, the Phone settings:

(1) To ensure that the phone has been rooted (MIUI stable version can not get root privileges, even through the third party implementation, the phone will also cause some damage, the MIUI system can be upgraded to the development version)



(2) Turn on the phone "USB debugging". In "System settings" → "All settings" → "Developer Options" → "Open developer Options", then enable "USB debugging" mode:






(3) Connect the computer with the data cable and authorize the mobile phone. After the data cable is connected, the following dialog box pops up, make sure to tick "allow this computer to be used for debugging"and then click "OK". Then unplug the data cable.






2, the mobile phone input command:


By default, ADB connects to USB, so you need to change the way ADB connects. Open the terminal emulator on your phone (if not, you can download the software)



(1) Enter the following command: (command line root permission)



$ su# SetProp Service.adb.tcp.port 5555


The above command changes the connection mode of ADB to TCP and listens on port 5555.



(2) Restart the ADB service on the phone and continue to enter the following two commands on the phone's terminal emulator:



 # Start ADBD


The above two commands will restart the ADB service on your phone.



(3) then enter it on the phone's terminal emulator



# netcfg


The following results will appear:






show that my phone's IP address is: 192.168.1.58, of course, each person's phone IP address may be different.




3, computer-side operation:

The operation on the phone is complete, now let's open the command line Cmd.exe on the computer (if the computer must already have the ADB and ADB drivers installed, the Android SDK development environment, the ADT plugin)



(1) in the command line of the computer, enter the following command:



# adb Connect 192.168.1.58


The above command 192.168.1.58 is the address we see through netcfg on the phone, and port 5555 is the port at the beginning of the setup. The following results appear:



Connected to 192.168.1.58:5555



Indicates a successful connection.



(2) To view connected devices:



The associated device process information is also displayed in Eclipse's Ddms. Just like you connect via USB.



On the computer command line, enter the following command:



# ADB devices




Of the three devices, the first one is the ADT emulator, the second is a wired connection to the phone, and the third (the arrow) is the one we need to connect to the WiFi device.



If you want to disconnect, you can use the following command:



# adb Disconnect 192.168.1.58


"Special statement"



If the error results appear as follows:



List of devices attached



192.168.1.58:5555 Unauthorized



The problem is: there is no authorization for the phone.



Workaround: Check the success of the operation in step (3) .



That is: Connect the real machine with the USB cable, the long-lost dialog box appears, check, click "Confirm". Then unplug the USB cable and use WiFi to debug the ADB connection.








Alibaba Cloud Hot Products

Elastic Compute Service (ECS) Dedicated Host (DDH) ApsaraDB RDS for MySQL (RDS) ApsaraDB for PolarDB(PolarDB) AnalyticDB for PostgreSQL (ADB for PG)
AnalyticDB for MySQL(ADB for MySQL) Data Transmission Service (DTS) Server Load Balancer (SLB) Global Accelerator (GA) Cloud Enterprise Network (CEN)
Object Storage Service (OSS) Content Delivery Network (CDN) Short Message Service (SMS) Container Service for Kubernetes (ACK) Data Lake Analytics (DLA)

ApsaraDB for Redis (Redis)

ApsaraDB for MongoDB (MongoDB) NAT Gateway VPN Gateway Cloud Firewall
Anti-DDoS Web Application Firewall (WAF) Log Service DataWorks MaxCompute
Elastic MapReduce (EMR) Elasticsearch

Alibaba Cloud Free Trail

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.