Android Studio always prompts you to restart ADB !, Androidadb

Source: Internet
Author: User

Android Studio always prompts you to restart ADB !, Androidadb

Sometimes when you connect your phone to your computer for debugging, Android Studio always prompts you to restart ADB. But after you click restart, the dialog box prompting you to restart is displayed immediately. The prompt dialog box is displayed because your ADB instance fails to be restarted. At this time, we can restart through the command line.

Run adb kill-server first, and then adb start-server. However, when you run the adb start-server command, you will find that the startup fails because the adb port is occupied.

Solution:


The command line in the first frame is to view the adb port.

The command line in the second frame is to find out which PID processes occupy the port used by adb.

Go to the task manager and kill the PID process.

Many may not understand how ports are allocated, and some may ask if 5037 is occupied. Then, when adb is started, can I re-allocate an idle port?

The following is a general knowledge of ports. After learning about these ports, you will naturally understand why.

Bytes -------------------------------------------------------------------------------------------------------------------

The port number can be divided into "known port", "registered port", and "dynamic and/or dedicated port ".

  • "Known ports" are ports from 0 to 1023.
  • "Registered port" is the port from 1024 to 49151.
  • "Dynamic and/or dedicated ports" are ports from 49152 to 65535.
The known port number "known port" is assigned by IANA and can only be used by system (or root) processes or programs executed by privileged users in most systems. The port used in TCP [RFC793] is used to name the end Of the logical connection for a long-term conversation. To provide services to an unknown caller, the system defines a service contact port.

The contact port is also known as a known port ". To make full use of these ports, UDP [RFC768] uses the same port allocation. The allocated port only uses a small part of the available port number. For many years, the allocated port has been in the range of 0-255. Recently, the range of allocated ports managed by IANA has been expanded to 0-1023. The registered port number "registered port" is listed by IANA and can be used by common user processes or programs executed by common users on most systems. The port used in TCP [RFC793] is used to name the end Of the logical connection for a long-term conversation. To provide services to an unknown caller, the system defines a service contact port.

IANA registers the usage of these ports to facilitate the community. To make full use of these ports, UDP [RFC768] uses the same port allocation. The range of "registered port" is 1024-49151.

To learn more about port allocation, stamp this: http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml


When an Android phone is connected to a computer, there is always an ADB error. How can this problem be solved?

Hello, driver problems. We recommend that you restart your computer and check the connection. If not, we recommend that you download the driver from Baidu search. Hope to adopt it and have a good time

Connection to adb is reduced and a serious error has occurred. You must restart adb with Eclipse to ensure that the correct adb is located

Run adb.exe from the command line to see if it can be used. It cannot be executed. Such problems are rare. Unless the OS version is incorrect.

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.