From cccff220bdb8c5beeb23b0f0cc4aea1311742255 Mon Sep 17 00:00:00 2001 From: Steve Penrod Date: Fri, 13 Mar 2020 00:13:20 -0500 Subject: [PATCH] Add helper scripts and update help messages Adds two scripts to make it easy to start the react system and (re)run the application within the emulator. Simply run: 1_start_react.sh To install packages and start the react ecosystem, then run 2_start_android_app.sh To launch the application within the Android emulator (launching the emulator automatically if necessary). --- 1_start_react.sh | 6 ++++++ 2_start_android_app.sh | 6 ++++++ dev_setup.sh | 8 ++++---- 3 files changed, 16 insertions(+), 4 deletions(-) create mode 100755 1_start_react.sh create mode 100755 2_start_android_app.sh diff --git a/1_start_react.sh b/1_start_react.sh new file mode 100755 index 0000000000..7c6f161eb6 --- /dev/null +++ b/1_start_react.sh @@ -0,0 +1,6 @@ +TOP="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" + +cd $TOP + +npm install +react-native start diff --git a/2_start_android_app.sh b/2_start_android_app.sh new file mode 100755 index 0000000000..fb7b236541 --- /dev/null +++ b/2_start_android_app.sh @@ -0,0 +1,6 @@ +TOP="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" + +cd $TOP + +npx react-native run-android + diff --git a/dev_setup.sh b/dev_setup.sh index 01c38573de..64f8f330b9 100644 --- a/dev_setup.sh +++ b/dev_setup.sh @@ -168,9 +168,9 @@ echo echo " Run Android Studio then:" echo " * Select 'Configure > AVD Manager' at the bottom" echo " * Create and run a virtula device, such as a Pixel 2" +echo echo " In a terminal run:" -echo " $ cd ~/mobileapp/" -echo " $ react-native start" +echo " $ ~/mobileapp/1_start_react.sh" echo " In a second terminal:" -echo " $ cd ~/mobileapp/" -echo " $ npx react-native run-android" +echo " $ ~/mobileapp/2_start_android_app.sh" +echo " You can edit files and repeat step 2 again as necessary to debug."