Created
September 27, 2016 03:58
-
-
Save baurine/0f68e2e21b21ab909f50966403157cee to your computer and use it in GitHub Desktop.
shell helper for run react-native app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
usage() { | |
echo "Usage:" | |
echo " run_app android" | |
echo " run_app ios" | |
} | |
arg=$1 | |
if [ -z "$arg" ]; then | |
arg="android" | |
fi | |
emulator=$(ps aux | grep "emulator" | wc -l) | |
#echo $emulator | |
if [ $arg == "android" ]; then | |
if [ $emulator == "1" ]; then | |
echo "starting emulator..." | |
nohup ~/Developments/android-sdk-macosx/tools/emulator @Nexus_4_API_23 & | |
else | |
echo "emulator has already run" | |
fi | |
react-native run-android | |
elif [ $arg == "ios" ]; then | |
react-native run-ios | |
else | |
usage | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment