Android Studio always prompts to restart ADB solution!

Source: Internet
Author: User

Sometimes when you connect your phone to a computer for debugging, Android Studio always prompts you to restart ADB, but after you restart it, you immediately jump out of the dialog box that prompts you to restart. You will be prompted again because your adb restart is unsuccessful. At this point we can reboot by the command line.

The ADB kill-server is executed first and then the ADB start-server is executed. But sometimes when you do the ADB start-server you will find that the boot is not up, this is because the ADB port is occupied.

Solutions such as:


The first box is the command line that looks at the port of ADB

The second box-up command line is to find out which PID of the ADB uses the port to occupy the process

Find out after the task Manager, kill the corresponding PID process can be.

Many people may not understand how the port is allocated, but also some people will ask 5037 is occupied, then start the ADB when the time to reassign a free port is not OK?

Below for everyone to popularize the knowledge of the lower mouth, understand these, you naturally understand why

--------------------------------------------------------------------------------------------------------------- ----

The port number can be divided into three ranges: known ports, registered ports, and dynamic and/or private ports.

    • "Known Port" is a port from 0 to 1023.
    • The "Registered port" is a port from 1024 to 49151.
    • The "dynamic and/or private port" is a port from 49152 to 65535.
Known port number "Known ports" are allocated by the IANA and can only be used by systems (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 a logical connection for a long-term conversation. To provide services to unknown callers, the system defines a service contact port.

the contact port is sometimes referred to as a "known port". To make the best use of these ports, UDP [RFC768] uses the same port assignment. The allocated port uses only a small subset of the available port numbers. For many years, the allocated port has been in the range of 0-255. Recently, the range of allocated ports managed by the IANA has expanded to 0-1023. Register Port numberThe "Registration port" is listed by the IANA and can be used by ordinary user processes or programs executed by ordinary users on most systems. The port used in TCP [RFC793] is used to name the end of a logical connection for a long-term conversation. To provide services to unknown callers, the system defines a service contact port.

The IANA registers the use of these ports to make it easier for the community. To make the best use of these ports, UDP [RFC768] uses the same port assignment. The range of "registered ports" is 1024-49151.

For specific information about port allocation please poke this: http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml

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.