Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to restart android adb using terminal on macOS?

Tags:

android

I keep having an issue with the Android Studio ADB not recognizing my devices. So far, the only solution I've found is to do a complete reboot of my entire computer, which isn't practical. I'd like to be able to restart the ADB from terminal, because I have seen other posts on here that claim it will fix the issue. However, I can't figure out where to use the commands "adb kill-server", because doing it at the base directory returns a "command not recognized". Can somebody help me figure out how to navigate into Android from terminal and use the command? Or, does anybody have another solution to the original problem of Android Studio not recognizing my devices?

Thanks in advance! Sorry for the wordiness.

like image 229
AceInventor Avatar asked Oct 12 '15 15:10

AceInventor


People also ask

How do I open adb in terminal?

Open a command window in the folder by holding shift and right-clicking in an empty spot in the folder and selecting "Open command prompt/PowerShell here" in the menu. Then you can start using ADB — connect your phone and try . ADB devices to see if it's working. A list with attached devices should show up.


1 Answers

blackbelt:~ blackbelt$ adb kill-server
blackbelt:~ blackbelt$ adb start-server

works on Linux as well as on Mac. In my machine, adb is in PATH

"command not recognized". Can somebody help me figure out how to navigate into Android from terminal and use the command? Or, does anybody have another solution to the original problem of Android Studio not recognizing my devices?

In your case adb is not declared in PATH. You can either export the PATH, or specify the full qualified path to adb in the command line. E.g.

 blackbelt:~ blackbelt$ /path/to/platform-tools/adb kill-server
 blackbelt:~ blackbelt$ /path/to/platform-tools/adb start-server

or

 blackbelt:~ blackbelt$ ./adb kill-server
 blackbelt:~ blackbelt$ ./adb start-server 

if you are inside platform-tools

like image 79
Blackbelt Avatar answered Oct 18 '22 12:10

Blackbelt