react-native-macos/packages/rn-tester
Neil Dhar aae93553d0 Remove libstdc++ dependency (#32247)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/32247

I don't think we need both libc++ and libstdc++.

allow-large-files

Changelog: [Internal]

Reviewed By: fkgozali

Differential Revision: D30950943

fbshipit-source-id: d0669815ff59c3e9ac45954a4a11930d1bc3959f
2021-10-08 14:16:54 -07:00
..
NativeModuleExample Link RCT-Folly against libc++abi 2021-09-16 22:24:10 -07:00
RCTTest Link RCT-Folly against libc++abi 2021-09-16 22:24:10 -07:00
RNTester Add Linking examples in rn-tester (#30547) 2021-09-01 00:27:42 -07:00
RNTester-tvOS Continuous Integration cleanup 2020-11-05 06:09:36 -08:00
RNTesterIntegrationTests Remove rootView.bridge access in RCTRootViewIntegrationTests 2021-09-06 04:57:38 -07:00
RNTesterPods.xcodeproj Remove libstdc++ dependency (#32247) 2021-10-08 14:16:54 -07:00
RNTesterPods.xcworkspace Migrating RNTester to Packages Directory (#29567) 2020-08-19 17:57:08 -07:00
RNTesterUnitTests Optimize font handling on iOS (#31764) 2021-08-26 22:47:41 -07:00
android/app Addressing various issues with the Appearance API (#28823) (#29106) 2021-10-05 20:23:48 -07:00
e2e New Button Component Use Cases (#29848) 2020-09-23 19:51:49 -07:00
js Remove ProgressBar from examples and fix XHRDownloadExample 2021-10-05 17:24:45 -07:00
.eslintrc Migrating RNTester to Packages Directory (#29567) 2020-08-19 17:57:08 -07:00
BUCK OSS: use js_glob() for :rn-tester target 2021-09-16 22:24:10 -07:00
Gemfile Bump Xcode to 13.0.0 and CocoaPods to 1.11.2 2021-09-28 22:28:06 -07:00
Podfile Fix: Xcode 12.5+ build of iPhone Simulator on Apple M1 (#32284) 2021-09-28 17:05:24 -07:00
Podfile.lock Remove libstdc++ dependency (#32247) 2021-10-08 14:16:54 -07:00
README.md Add a quick documentation about how to disable Fabric in RNTester 2021-09-24 17:08:52 -07:00
package.json RN: Replace `master` with `main` in Documentation 2021-07-15 15:22:57 -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

If you are testing non-fabric component, modify the fabric_enabled flag in RNTester's Podfile.

fabric_enabled = false

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
# In order to use Hermes engine, run `installHermesDebug` instead.
./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).