N Kaushik

Important adb commands for React-Native development

April 12, 2021

Important adb commands for React-Native & Android development:

adb is a command line tools provided to interact with a connected android phone or emulator. It has many useful commands like apk installation, uninstallation, etc.

adb is installed with Android Studio. If you want to check if it is correctly installed or not, open one terminal and run the below command:

adb devices

It will show the list of devices or emulators currently connected/active.

adb and React-Native:

While developing react-native apps, hot reload is not an ideal way to work always. You might need to restart the app after each change. I find it easy to use adb to reload the app.

adb shell input text "RR"

Another important command that I find useful is:

adb shell input keyevent 82

It opens the developer menu in your phone.

Other important adb commands:

restart adb:

adb kill-server adb start-server

reboot device:

adb reboot

list of all devices:

adb devices -l

get all commands of adb:

adb help

install apk:

adb install <apk-path>

remove apk

adb uninstall <app-package-name>

clear logcat

adb logcat -c

show logcat logs:

adb logcat

save the log output to a file:

adb logcat -d > [file_name]

get all device information to a file:

adb bugreport > [file_name]

push file from device to phone:

adb push [source] [destination]

pull file from phone to device:

adb pull [file location on phone] [file path on device]

Subscribe to my Newsletter

© 2021, nkaushik