During the debugging react-native app on the Andoroid device I need to shake it every time to reload the app. There is a good article on StackOverflow on the topic: how-do-i-shake-an-android-device-bla-bla. Long story short, you can simply execute command in your terminal and avoid shaking real device:
adb shell input keyevent 82
Here I wanna create a shotcut for this long command. Create 'shake-android-device.sh' script:
#!/bin/bash
#
# See page for details:
# https://gist.github.com/VadimCpp/734542199ff92f4c82ff3e03174721d6
#
echo Shake an Android device
adb shell input keyevent 82
Make the script executable:
chmod a+x shake-android-device.sh
Put the script to the Scripts folder. Then open .bash_profile and create alias:
alias shake='~/Scripts/shake-android-device.sh'
Reload bash_profile:
source ~/.bash_profile
And simply type command:
shake
Voila!