![Forrest logo](/images/logo.png)
adb
ADB stands for Android Debug Bridge, which is a command-line tool that is included in the Android software development kit (SDK). It is primarily used to communicate with Android devices connected to a computer via USB or over a network.
ADB enables various operations on an Android device, such as installing and debugging applications, accessing the device's shell for executing commands, transferring files between the device and the computer, capturing device screenshots, profiling system performance, and many more.
With ADB, developers can test and troubleshoot their applications on real devices or virtual emulators, allowing them to interact with the device's hardware and software components directly from the command line. It provides a bridge between the computer and Android device, facilitating communication and control for developers and power users alike.
ADB commands are executed by typing "adb" followed by the desired command in the command prompt or terminal window. The tool offers a wide range of options and features, making it an essential utility for Android development and device management.
List of commands for adb:
-
adb-install:tldr:19609 adb-install: Grant all permissions listed in the app manifest.$ adb install -g ${filename-apk}try on your machineexplain this command
-
adb-install:tldr:b18c8 adb-install: Push an Android application allowing version code downgrade (debuggable packages only).$ adb install -d ${filename-apk}try on your machineexplain this command
-
adb-install:tldr:bced3 adb-install: Push an Android application to an emulator/device.$ adb install ${filename-apk}try on your machineexplain this command
-
adb-install:tldr:ce880 adb-install: Push an Android application to a specific emulator/device (overrides `$ANDROID_SERIAL`).$ adb -s ${serial_number} install ${filename-apk}try on your machineexplain this command
-
adb-install:tldr:ec882 adb-install: Quickly update an installed package by only updating the parts of the APK that changed.$ adb install --fastdeploy ${filename-apk}try on your machineexplain this command
-
adb-install:tldr:f1231 adb-install: Reinstall an existing app, keeping its data.$ adb install -r ${filename-apk}try on your machineexplain this command
-
adb-logcat:tldr:00e24 adb-logcat: Display logs for a tag in a specific mode ([V]erbose, [D]ebug, [I]nfo, [W]arning, [E]rror, [F]atal, [S]ilent), filtering other tags.$ adb logcat ${tag}:${mode} *:Stry on your machineexplain this command
-
adb-logcat:tldr:15c92 adb-logcat: Display logs for the process of a specific package.$ adb logcat --pid=$(adb shell pidof -s ${package})try on your machineexplain this command
-
adb-logcat:tldr:1af2b adb-logcat: Display logs for React Native applications in [V]erbose mode [S]ilencing other tags.$ adb logcat ReactNative:V ReactNativeJS:V *:Stry on your machineexplain this command
-
adb-logcat:tldr:468f7 adb-logcat: Display logs for all tags with priority level [W]arning and higher.$ adb logcat *:Wtry on your machineexplain this command
-
adb-logcat:tldr:4d82f adb-logcat: Display logs for a specific PID.$ adb logcat --pid=${pid}try on your machineexplain this command
-
adb-logcat:tldr:59af5 adb-logcat: Color the log (usually use with filters).$ adb logcat -v colortry on your machineexplain this command
-
adb-logcat:tldr:a367e adb-logcat: Display lines that match a regular expression.$ adb logcat -e ${regular_expression}try on your machineexplain this command
-
adb-logcat:tldr:bbfad adb-logcat: Display system logs.$ adb logcattry on your machineexplain this command
-
adb-reverse:tldr:a6a98 adb-reverse: Remove a reverse socket connections from an emulator or device.$ adb reverse --remove tcp:${remote_port}try on your machineexplain this command
-
adb-reverse:tldr:cc517 adb-reverse: List all reverse socket connections from emulators and devices.$ adb reverse --listtry on your machineexplain this command
-
adb-reverse:tldr:d62c8 adb-reverse: Reverse a TCP port from an emulator or device to localhost.$ adb reverse tcp:${remote_port} tcp:${local_port}try on your machineexplain this command
-
adb-reverse:tldr:db8dc adb-reverse: Remove all reverse socket connections from all emulators and devices.$ adb reverse --remove-alltry on your machineexplain this command
-
adb-shell:tldr:365cd adb-shell: Revert all runtime permissions to their default.$ adb shell pm reset-permissionstry on your machineexplain this command
-
adb-shell:tldr:3a7d0 adb-shell: Start the home activity on an emulator or device.$ adb shell am start -W -c android.intent.category.HOME -a android.intent.action.MAINtry on your machineexplain this command
-
adb-shell:tldr:82218 adb-shell: Revoke a dangerous permission for an application.$ adb shell pm revoke ${package} ${permission}try on your machineexplain this command
-
adb-shell:tldr:8c3fd adb-shell: Start an activity on emulator or device.$ adb shell am start -n ${package}/${activity}try on your machineexplain this command
-
adb-shell:tldr:92364 adb-shell: Trigger a key event.$ adb shell input keyevent ${keycode}try on your machineexplain this command
-
adb-shell:tldr:a783e adb-shell: Start a remote interactive shell on the emulator or device.$ adb shelltry on your machineexplain this command
-
adb-shell:tldr:c81c5 adb-shell: Get all the properties from emulator or device.$ adb shell getproptry on your machineexplain this command
-
adb-shell:tldr:e1627 adb-shell: Clear the data of an application on an emulator or device.$ adb shell pm clear ${package}try on your machineexplain this command
-
adb:tldr:066e3 adb: Check whether the adb server process is running and start it.$ adb start-servertry on your machineexplain this command
-
adb:tldr:44eb4 adb: Copy a file/directory to the target device.$ adb push ${path-to-local_file_or_directory} ${path-to-device_destination_directory}try on your machineexplain this command
-
adb:tldr:9dc74 adb: Terminate the adb server process.$ adb kill-servertry on your machineexplain this command
-
adb:tldr:ce065 adb: Copy a file/directory from the target device.$ adb pull ${path-to-device_file_or_directory} ${path-to-local_destination_directory}try on your machineexplain this command
-
adb:tldr:ebac5 adb: Get a list of connected devices.$ adb devicestry on your machineexplain this command
-
android:warp:6867887bb7e615accb38b63aec067d0d Push a deeplink to your Android device$ adb shell am start -W -a android.intent.action.VIEW -d "${deeplink}" ${your_app_package_name}try on your machineexplain this command
-
android:warp:700c2b877fbeac68738be49aee4df0db Search for a package on a Android device$ adb shell pm list packages | grep "${query}"try on your machineexplain this command
-
android:warp:78136066142856e941b738bf00fdc37e Start an Android application using Android ADB tools$ adb shell am start -n ${package_name}/${package_name}.${activity_name}try on your machineexplain this command
-
android:warp:87566cb0607135c0e0136768e657f292 Stop an Android app$ adb shell am force-stop ${package_name}try on your machineexplain this command
-
android:warp:a77af8b4a7bc6e80de78a1432607e381 Clear the Android logcat buffer$ adb logcat -ctry on your machineexplain this command
-
android:warp:ee60086b3db8b82fd15183502fca6d7f Send a Firebase push notification to a local Android emulator$ adb shell am broadcast \ -n ${your_app_package_name}/com.google.firebase.iid.FirebaseInstanceIdReceiver \ -a "com.google.android.c2dm.intent.RECEIVE" \ --es "title" "${notification_title}" \ --es "body" "${notification_body}" \ --es "deeplink" "${deeplink}"try on your machineexplain this command
-
android:warp:fb1721d560f303b73c9a501e5fbec584 Root your emulator$ adb roottry on your machineexplain this command