Reload a React Native app on an Android device manually via command line
Just posting it here in case you didn't know this trick
long press the menu button in your android device. Then you'll get this menu
tap the reload option and you are good to go
Using the cmd line you can send a command to the Android device.
adb shell input text "RR"
This command tells the Android device to type the character "R" twice which is the React Native command to Reload on Android.
The adb shell
command has many useful features many of which are described here:
ADB Shell Input Events
To open the developer menu:
adb shell input keyevent 82
Add the following script to your package.json:
"android-shake": "adb shell input keyevent 82"
Then you will be able to call
yarn android-shake
If you are looking for ios then checkout my answer on this link
I use the following command. It doesn't reload the app, but it brings up the developper menu on the device, so I can then press the "Reload" option:
adb shell input keyevent KEYCODE_MENU
I develop with a real device (not the emulator) and sending the "double-R" through adb doesn't work (it just shows the keyboard and types 2 Rs).