简体   繁体   中英

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!

在此处输入图片说明

What is the solution?

.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.

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]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM