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.