44# This source code is licensed under the MIT license found in the
55# LICENSE file in the root directory of this source tree.
66
7- JAVA_VERSION=" 1.7"
8-
97RED=" \033[0;31m"
108GREEN=" \033[0;32m"
119BLUE=" \033[0;35m"
@@ -49,28 +47,55 @@ lsof -i :8081 | grep LISTEN | /usr/bin/awk '{print $2}' | xargs kill
4947info " Start the packager in another terminal by running 'npm start' from the root"
5048info " and then press any key."
5149info " "
52- read -n 1
50+ read -r - n 1
5351
5452./gradlew :packages:rn-tester:android:app:installJscDebug || error " Couldn't build RNTester Android"
5553
5654info " Press any key to run RNTester in an already running Android emulator/device"
5755info " "
58- read -n 1
56+ read -r - n 1
5957adb shell am start -n com.facebook.react.uiapp/.RNTesterActivity
6058
61- success " Installing CocoaPods dependencies"
59+
60+ info " Once done testing, keep emulator running"
61+ info " Press any key to run RNTester on Android with Hermes enabled"
62+ read -r -n 1
63+
64+ ./gradlew :packages:rn-tester:android:app:installHermesDebug || error " Couldn't build RNTester Android"
65+ adb shell am start -n com.facebook.react.uiapp/.RNTesterActivity
66+
67+ info " When done testing RNTester on Android,"
68+ info " Press any key to start testing RNTester in iOS"
69+ read -r -n 1
70+
71+ success " About to test iOS JSC... "
72+ success " Installing CocoaPods dependencies..."
6273rm -rf packages/rn-tester/Pods
6374(cd packages/rn-tester && pod install)
6475
6576info " Press any key to open the workspace in Xcode, then build and test manually."
6677info " "
67- read -n 1
78+ read -r -n 1
79+
80+ open " packages/rn-tester/RNTesterPods.xcworkspace"
81+
82+ info " When done testing iOS JSC, press any key to test iOS Hermes"
83+ read -r -n 1
84+
85+ success " About to test iOS Hermes... "
86+ success " Installing CocoaPods dependencies..."
87+ rm -rf packages/rn-tester/Pods
88+ (cd packages/rn-tester && USE_HERMES=1 pod install)
89+
90+ info " Press any key to open the workspace in Xcode, then build and test manually."
91+ info " "
92+ read -r -n 1
6893
6994open " packages/rn-tester/RNTesterPods.xcworkspace"
7095
7196info " When done testing RNTester app on iOS and Android press any key to continue."
7297info " "
73- read -n 1
98+ read -r - n 1
7499
75100success " Killing packager"
76101lsof -i :8081 | grep LISTEN
@@ -86,7 +111,7 @@ success "React Native version changed in the template"
86111
87112project_name=" RNTestProject"
88113
89- cd /tmp/
114+ cd /tmp/ || exit
90115rm -rf " $project_name "
91116node " $repo_root /cli.js" init " $project_name " --template " $repo_root "
92117
@@ -102,7 +127,7 @@ info " - Verify 'Reload JS' works"
102127info " "
103128info " Press any key to run the sample in Android emulator/device"
104129info " "
105- read -n 1
130+ read -r - n 1
106131cd " /tmp/${project_name} " && npx react-native run-android
107132
108133info " Test the following on iOS:"
@@ -115,10 +140,10 @@ info " - Disable Fast Refresh."
115140info " "
116141info " Press any key to open the project in Xcode"
117142info " "
118- read -n 1
143+ read -r - n 1
119144open " /tmp/${project_name} /ios/${project_name} .xcworkspace"
120145
121- cd " $repo_root "
146+ cd " $repo_root " || exit
122147
123148info " Next steps:"
124149info " - https://github.com/facebook/react-native/blob/HEAD/Releases.md"
0 commit comments