ADB debug Android device says a relatively clear article

Source: Internet
Author: User
Tags root access

ADB supports two ways to connect to the Android system, USB mode and network mode. Normal phone and tablet are set to USB by default.
The Android system has a service (ADBD) running on the bottom, which is used to connect and manage everyone's computer-side ADB commands.
This service will listen to one of the USB connections or networks depending on the configuration of the phone at startup.
The properties of the configuration are:
Service.adb.tcp.port <-Listening Network port
The value of the above attribute > 0:adbd will listen to the network corresponding port (typically 5555)
The value of the above attribute <=-1:ADBD will listen for USB

So by default our Android device opens the developer option and after USB debugging, the default is to be able to see the device ADB devices, see the device directly after the ADB shell can

But if we want to turn on WiFi for ADB debugging, we have to do the following:

1. Turn off the firewall on the PC side

2. Configure the phone-side service.adb.tcp.port =0 (Configuration tool can be used adbwireless or AIRDB), so the following article

Introduction to the use of the Android Development Wireless debugging tool adbwireless (attached airadb)Janrisun Attention 2017.01.11 16:22* words 1534 Read 4506 comments 4 likes

Adbwireless allows mobile phones to replace USB connections with wireless and use ADB tools
The phone needs root and is in the same LAN as the computer (it can be connected to a mobile phone with a router or a computer)
ADB (Android Debug Bridge) is a generic debugging tool provided by Android, and with this tool we can manage devices or phones
The state of the emulator. You can also do the following:
1. Quickly update the code in the device or phone simulator, such as app or Android system upgrade;
2. Run the shell command on the device;
3, management equipment or mobile phone simulator on the predetermined port;
4. Copy or paste files on the device or phone simulator;
Note: This reference will be noted at the end of the article. The shortcomings of the text, welcome criticism!

Objective

The phone was not upgraded before it was a 5.0 system, and was being debugged with the adbwireless tool. Mobile phone upgrade to the 6.0 system, the rights management has changed, adbwireless and long-term no update, resulting in the phone even after the root still can not be unlimited debugging, error: Unable to connect to 192.168.1.131:5555:cannot Connect to 192.168.1.131:5555: Unable to connect because the target computer is actively rejecting. (10061). At first thought is the authority problem, went to GitHub on the project Clon to local, added 6.0 permissions, after running the error unchanged. Multi-Quest, by setting the default ADB connection mode of the phone can solve the problem (discussed later). After the decision to share a wave of code, write to the end, in other relevant information found a better use of wireless Debugging tools (manual capitalization awkward), I will share it, hindering hindering ... (White busy Orz). Interested in looking down, just looking for a wireless debugging tools, tools to download the good, wireless Tune Up bar (XX, can not stop)! For the first time, more advice!

Adbwireless
Adbwireless (write 6.0 permission) extract password: mwb1
Airadb

Configuration of ADB

Phone download After installing adbwireless, configure ADB on your computer (you can skip this step)

    1. Locate the Adb.exe in the SDK and copy the path C:\Users\Maven\AppData\Local\Android\Sdk\platform-tools
ADB path. png

If you do not remember the SDK file directory, you can view it in the settings of Android Studio
File>>settings>>appearance&behavior>>system settings>>android SDK

SDK path. png
    1. Configuring ADB environment variables
      Right-click My Computer >> Properties >> advanced system settings >> environment variables
      Locate the patch in the system variable (s) and select Edit. Copy the directory where the ADB resides, and note that the ";" is separated from the other variables.
Environment variables. png
    1. Detect if ADB is configured successfully
      Open a command-line window (Windows key +r)
      Input instruction ' adb devices '
      As shown, the configuration is successful
Cmd.png Wireless Debugging

Next is the time to witness the miracle.

    1. Open adbwireless (Root permission has been obtained), the interface displays the current device IP address;
Adbison.png
    1. Open the Android Studio console terminal, enter the instructions displayed in the Adbwireless interface
      ADB Connect 192.168.8.101,
      The output connected to 192.168.8.101:5555 indicates a successful connection. Next start the wireless debugging journey, with the USB connection no difference.
      The same can be done directly in the Command Line window to enter the above instructions, but also can be connected successfully.
Terminal.png

Note: The next time only need to put the phone and computer together with a local area network, mobile phone open adbwireless, the computer at the command prompt to perform "ADB connect xxx.xxx.xxx.xxx" (xxx.xxx.xxx.xxx is the IP address shown for adbwireless).

Handling of exceptions
    1. Error:cannot Parse Version string:kg01
      This error occurs first in the environment to see the ADB's path right, if it is right in the Task manager to end the Adb.exe, or Kadb.exe, and then re-execute the ADB connect xxx.xxx.xxx.xxx command on the line

    2. If the IP address on the adbwireless is ADB connect 0.0.0.0, turn off the adbwireless and restart

    3. Unable to connect to 192.168.1.131:5555:cannot connect to 192.168.1.131:5555: Unable to connect because the target computer is actively rejecting. (10061)
      This error is estimated to be the root of the phone, but not authorized to adbwireless, download the root of the authorization management. Then give adbwireless authorization. and reconnect it.
      If the above method does not solve the problem, try to switch the way ADB connects the phone

ADB supports two ways to connect to the Android system, USB mode and network mode. Normal phone and tablet are set to USB by default.
The Android system has a service (ADBD) running on the bottom, which is used to connect and manage everyone's computer-side ADB commands.
This service will listen to one of the USB connections or networks depending on the configuration of the phone at startup.
The properties of the configuration are:
Service.adb.tcp.port <-Listening Network port
The value of the above attribute > 0:adbd will listen to the network corresponding port (typically 5555)
The value of the above attribute <=-1:ADBD will listen for USB

How to set it up (the phone needs to be connected to the computer)

    1. Enable ADB over WiFi:
      ADB tcpip 5555//on a computer connected to a mobile phone

    2. Reconnect to it.

Note: Turn off the wireless debugging instructions for ' adb disconnect xxx.xxx.xxx.xxx ' need to manually switch the ADB connection mode (more than 6.0), if not lazy every time on the phone to knock commands, you can use this tool airadb, direct one-click Settings, and support automatic setting!! Root access Required! Attach Airadb's homepage

Airadb.png Reference

Slightlywobbly/github
Android Studio uses adbwireless for WiFi debugging
Two ways ADB connects to a phone
Android Network debug adb tcpip open method

ADB debug Android device says a relatively clear article

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.