Android Studio Using ADB with Android Emulators Estimated reading: 2 minutes 500 views Previously, we covered installing APK apps on your emulator. Now, let’s delve into using ADB (Android Debug Bridge) with Android emulators. ADB is a powerful command-line tool that enables communication with your emulator or device. Get Access to the Test App & FrameworkPro Members unlock hands-on access to our expertly crafted frameworks. PRO MEMBER Device Info: Pixel 8 | API 33 Tip: Please ensure you have an emulator created and running before hand.Connecting ADB to an EmulatorOnce your emulator is running, you need to connect ADB to it.Open Terminal: Launch the Terminal App on your on your Mac. Launch TerminalNavigate to ADB Directory: Navigate to the directory where ADB is installed. This is typically in the platform-tools directory of your Android SDK.bashcd /Users/{UserName}/Library/Android/sdk/platform-tools Changing Directory To Platform ToolsCheck Connected Devices: Run the following command to list connected devices and emulators.bashadb devices List of Running Devices Displayed You should see your emulator listed. If not, restart the ADB server. In Terminal paste the command below:bashadb kill-server adb start-serverCommon ADB CommandsHere are some essential ADB commands for quality testing:Installing an APK: To Install an application on the emulator. Use this command.bashadb install /Users/{UserName}/Desktop/test-apps/app-debug.apk Installing An APK Using ADB CommandGet Android Package Name: Get the name of the Android app’s package name in order to use the uninstall command later. With the test app lauched on the emulator, open a new terminal and enter this command below:bashadb shell dumpsys window | grep 'mCurrentFocus' Name of App Package & Main ActivityUninstall an APK: Remove an application from the emulator.bashadb uninstall com.example.yourapp Uninstalling APK Using ADB CommandConclusionThe ADB is an essential tool for Android development and debugging. Mastering its commands will enhance your ability to manage and debug your applications effectively. Up next, we’ll cover automating UI tests on Android emulators, a crucial step for ensuring your app’s usability. Continue to Automating UI Tests on Android Emulators for detailed instructions.Tagged:Android Studio Android Studio - Previous Installing an APK app on an Android Emulator Next - Android Studio Automating UI Tests on Android Emulators