Ubuntu connection to the Android debugger with WiFi _android

Source: Internet
Author: User

Note: If you do not have root permission, you can try it, in general, you need root permission to connect successfully.

1. Make sure your PC and Android phone are connected to WiFi and under the same network segment;
2. Turn on USB debugging and connect the Android device to the development PC with USB;
3. Go to the Platform-tools directory of your Android SDK,
Perform the following command to restart the adbd daemon on the Android device to listen for TCP's specified port:
$./ADB TCPIP 5555
Note: 5555 is the default port, replaced by other is not necessary, and here must be set a port!

4. Perform the following command to establish a WiFi debugging connection:
$./ADB connect the actual IP address of the Android device [: Port number specified via./ADB TCPIP]
Note: There is a colon between the IP address and the port number, which can be omitted if the port number is 5555.

If you receive an error message such as "Unable to connect to IP address: Port number", then:
1 Enter the Android device terminal:
$./ADB Shell

2 Switch to the root user of the Android device:
$ Su-

3 Set the specified port number for the ADBD service:
# SetProp Service.adb.tcp.port 5555
Note: 5555 is the default, here also to set up, can also be customized, but what is necessary.

4) After setting up the ADBD service, rerun it:
# Start ADBD
Note: # The Stop adbd command will stop ADBD and only reboot the Android device.

5 Restart the adbd daemon in the Android device to listen for TCP's specified port:
$./adb Tcpip 5555

6) to establish a WiFi debugging connection:
$./ADB Connect IP Address [: Port number]

7) The following words appear to indicate success:
connected to IP address [: Port number]

8 Enter the Android device terminal:
$./ADB Shell

9 Execute the Netstat command, you can see the IP address: the state in which the port number has been established:

Copy Code code as follows:

Proto recv-q send-q Local addressforeign addressstate
tcp00 0.0.0.0:5555 0.0.0.0:*listen
Tcp00 0.0.0.0:110000.0.0.0:*listen
TCP 192.168.1.104:5555 192.168.1.102:40821established
---------------------------------------------
Proto recv-q send-q Local addressforeign addressstate
Tcp00 0.0.0.0:110000.0.0.0:*listen

Note: The Separator line (---) above is the established status display, the following is not a well established status display.

9 The results of viewing the device commands are also different from USB:
$./ADB Devices
List of devices attached
192.168.1.104:5555 Device
--------------------------
List of devices attached
android123456 Device

Note: The divider line (---) above is a TCP connection, and the following is a USB connection.

*. Perform the following command to reboot the ADBD daemon on the Android device to listen for USB:

Copy Code code as follows:

$./ADB USB

Note: After you execute this command, use the./ADB devices to see the device.
Execute $ sudo./adb kill-server and $ sudo/adb start-server also no,
You can only reboot the Android device!

So, the right thing to do is:
1 Enter the Android device terminal:
$./ADB Shell

2 Switch to the root user of the Android device:
$ Su-

3 Set the specified port number for the ADBD service:
# SetProp Service.adb.tcp.port-1
Note: Turn off WiFi debugging by simply setting the port number to minus one (-1).

4 after the above three steps are completed, you can perform./ADB USB failback USB connection debugging mode.

* Note: If you just disconnect the connection, simply run the following command:
$./ADB Disconnect

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.