react-native-macos/packages/rn-tester
Héctor Ramos 73ae12bc24 Update rn-tester project settings
Summary:
Adjustments to ensure RNTester compiles successfully.

[Internal] - RNTester Xcode project adjustments

Reviewed By: RSNara

Differential Revision: D29525295

fbshipit-source-id: df532bd66d50471c4baf63629eb90b4ca4105127
2021-07-13 14:10:03 -07:00
..
NativeModuleExample Remove "use strict" directive from ES Modules 2021-02-02 11:12:56 -08:00
RCTTest Bump Flipper-Folly to 2.5.3 and RCT-Folly to 2021.04.26.00 2021-04-29 10:39:25 -07:00
RNTester Support user-defined PlatformColors on iOS (#31258) 2021-06-10 12:15:12 -07:00
RNTester-tvOS Continuous Integration cleanup 2020-11-05 06:09:36 -08:00
RNTesterIntegrationTests Continuous Integration cleanup 2020-11-05 06:09:36 -08:00
RNTesterPods.xcodeproj Update rn-tester project settings 2021-07-13 14:10:03 -07:00
RNTesterPods.xcworkspace Migrating RNTester to Packages Directory (#29567) 2020-08-19 17:57:08 -07:00
RNTesterUnitTests Migrate NativeModules to initialize 2021-05-21 14:49:51 -07:00
android/app Allow configuring ndk build architectures (#31232) 2021-07-12 09:53:30 -07:00
e2e New Button Component Use Cases (#29848) 2020-09-23 19:51:49 -07:00
js RN: Unify Typeface Logic (Android) 2021-07-12 22:17:12 -07:00
.eslintrc Migrating RNTester to Packages Directory (#29567) 2020-08-19 17:57:08 -07:00
BUCK Migrating RNTester to Packages Directory (#29567) 2020-08-19 17:57:08 -07:00
Gemfile Remove iOS10/tvOS10 support from remaining podfiles 2021-02-19 13:47:25 -08:00
Podfile Update flipper in RNTester and template (#31010) 2021-02-24 12:23:27 -08:00
Podfile.lock Remove Picker from OSS (#31772) 2021-07-08 13:23:49 -07:00
README.md feat: Enable Hermes to work on iOS (#29914) 2020-11-03 01:14:38 -08:00
package.json React Native sync for revisions 6d3ecb7...c9aab1c 2021-04-06 12:42:37 -07:00

README.md

RNTester

The RNTester showcases React Native views and modules.

Running this app

Before running the app, make sure you ran:

git clone https://github.com/facebook/react-native.git
cd react-native
yarn install

Running on iOS

Both macOS and Xcode are required.

  • cd packages/rn-tester
  • Install Bundler: gem install bundler. We use bundler to install the right version of CocoaPods locally.
  • Install Bundler and CocoaPods dependencies: bundle install && bundle exec pod install. In order to use Hermes engine instead of JSC, run: USE_HERMES=1 bundle exec pod install instead.
  • Open the generated RNTesterPods.xcworkspace. This is not checked in, as it is generated by CocoaPods. Do not open RNTesterPods.xcodeproj directly.

Running on Android

You'll need to have all the prerequisites (SDK, NDK) for Building React Native installed.

Start an Android emulator.

cd react-native
./gradlew :packages:rn-tester:android:app:installJscDebug
./scripts/packager.sh

Note: Building for the first time can take a while.

Open the RNTester app in your emulator. If you want to use a physical device, run adb devices, then adb -s <device name> reverse tcp:8081 tcp:8081. See Running on Device for additional instructions on using a physical device.

Running with Buck

Follow the same setup as running with gradle.

Install Buck from here.

Run the following commands from the react-native folder:

./gradlew :ReactAndroid:packageReactNdkLibsForBuck
buck fetch rntester
buck install -r rntester
./scripts/packager.sh

Note: The native libs are still built using gradle. Full build with buck is coming soon(tm).

Running Detox Tests on iOS

Install Detox from here.

To run the e2e tests locally, run the following commands from the react-native folder:

yarn build-ios-e2e
yarn test-ios-e2e

These are the equivalent of running:

detox build -c ios.sim.release
detox test -c ios.sim.release --cleanup

These build the app in Release mode, so the production code is bundled and included in the built app.

When developing E2E tests, you may want to run in development mode, so that changes to the production code show up immediately. To do this, run:

detox build -c ios.sim.debug
detox test -c ios.sim.debug

You will also need to have Metro running in another terminal. Note that if you've previously run the E2E tests in release mode, you may need to delete the RNTester/build folder before rerunning detox build.

Building from source

Building the app on both iOS and Android means building the React Native framework from source. This way you're running the latest native and JS code the way you see it in your clone of the github repo.

This is different from apps created using react-native init which have a dependency on a specific version of React Native JS and native code, declared in a package.json file (and build.gradle for Android apps).