【Mac/Android Studio】What is the adb command? How to make it available
What you will learn from this article
- What is the adbcommand in Android Studio/Kotlin?
- How to make it available on your Mac
index
[open]
\ アプリをリリースしました /
Official Reference: Viewing logs with Logcat
Environment
- Android Studio:Meerkat
- Kotlin:2.0.21
What is adb?
adb (Android Debug Bridge) is one of the command line tools for operating and debugging Android devices in conjunction with a PC.Using the adb command makes it easy to transfer files and install apps.
How to enable adb commands on a Mac
For those developing Android apps on a Mac, we will introduce how to enable adb commands.
$ which adb
adb not found
From this↑, we aim for this↓.
$ which adb
/Users/username/Library/Android/sdk/platform-tools/adb
Steps
- Find the location of the Android SDK
- Set the path to zsh
- Done
Check the Android SDK Location
First, find out where the Android SDK is currently stored on your Mac. Open “Android Studio” > “Preferences” from the top menu, then click “System Settings” > “Android SDK”, and copy the path shown under “Android SDK Location”.
Set PATH in zsh
Next, launch the terminal and use Vim to add the path to .zshrc, appending platform-tools to the previously copied Android SDK path.
$ vi .zshrc
$ i // Enter insert mode
// Add the following line
export PATH=$PATH:/Users/your-username/Library/Android/sdk/platform-tools
$ ESC // Exit insert mode
$ :wq // Save and close
$ source ~/.zshrc // Apply the changes
Now the path has been set, and the adb command should be available.
Recommended article: 【Linux】Introduction to vi(Vim) Editor
Try confirming that the path was added correctly:
$ which adb
/Users/your-username/Library/Android/sdk/platform-tools/adb
Install an App Using adb Command
By running the adb install command, you can install an app on a connected device.
$ adb install [path to your APK file]
This is useful for testing a release APK on a physical device. Make sure to stop any running emulators and connect only the actual device via USB before executing the command to avoid failures.
For more details, please refer to the following article:
Recommended article: 【Android】How to Install APK/AAB Files on Device or Emulator
I'm still learning, so if you find any mistakes or improvements, I would really appreciate your feedback.
Thank you for reading.






