Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run ADB shell on OS X

I want to enter a simple adb shell command, so I navigated to ...\sdk\platform-tools\adb.exe, and opened it. However, I am unable to type in it!

enter image description here

What is the solution?

like image 711
Ruchir Baronia Avatar asked Dec 15 '22 07:12

Ruchir Baronia


2 Answers

.exe files are executable files for the Windows OS. They will not work on OSX.

There is a program called Terminal that is installed in OSX that you can use to run the adb shell command. You must open up a Terminal and navigate to the directory that is shown in your screenshot, and then you can run the command ./adb shell and it should work.

Alternatively, you can use the Terminal in Android Studio to perform the same operation.

like image 77
colelemonz Avatar answered Jan 04 '23 17:01

colelemonz


Here is how I change my directory to platform-tools on a mac terminal: Search the finder for "platform-tools". Then right-click on it, and left-click on "get info". You'll see a little window pop up with all the info for that folder. Copy the "where", which is the file path.

Then paste into your terminal like this:

cd /Users/[user-name]/Library/Android/sdk/platform-tools

Be sure to add /platform tools on after pasting the path to the folder.

Then hit return. Your terminal should then be pointed to that folder and you can invoke the adb commands by using "./adb [whatever command]". Or you can invoke adb shell commands: for example let's say you want to enable Analytics Debug mode on an Android device. Use the following command:

adb shell setprop debug.firebase.analytics.app [your_package_name]
like image 35
rdmcbath Avatar answered Jan 04 '23 17:01

rdmcbath