react-native-macos/packages/rn-tester
Saad Najmi 71b8286341 Merge commit '143f1ad29874c1e8e9561abae263cb08f4859407' into 0.76-merge 2024-10-24 15:04:49 -07:00
..
.maestro Create first test flow (#45574) 2024-07-26 09:57:46 -07:00
IntegrationTests Merge commit 'c99d96b7a1a4dc905ce642966633b4d3c78bd3c9' into main 2024-08-06 17:17:13 -07:00
NativeComponentExample Merge commit '143f1ad29874c1e8e9561abae263cb08f4859407' into 0.76-merge 2024-10-24 15:04:49 -07:00
NativeCxxModuleExample Add C++ Turbo Module enum Event Emitter example (#46049) 2024-08-19 08:26:20 -07:00
NativeModuleExample Merge commit '143f1ad29874c1e8e9561abae263cb08f4859407' into 0.76-merge 2024-10-24 15:04:49 -07:00
RCTTest Merge commit '143f1ad29874c1e8e9561abae263cb08f4859407' into 0.76-merge 2024-10-24 15:04:49 -07:00
RNTester Merge commit '143f1ad29874c1e8e9561abae263cb08f4859407' into 0.76-merge 2024-10-24 15:04:49 -07:00
RNTester-macOS [CI] Update Build Matrix (#2104) 2024-05-21 11:18:38 -07:00
RNTester-macOSIntegrationTests
RNTester-macOSUnitTests
RNTester-visionOS Add RNTester-visionOS (#2056) 2024-01-26 06:34:18 -08:00
RNTesterIntegrationTests Merge commit '6f7eae5c583090bd62ca60a4c3170445e5a0a751' into main 2024-08-22 23:08:52 -07:00
RNTesterPods.xcodeproj Merge commit '143f1ad29874c1e8e9561abae263cb08f4859407' into 0.76-merge 2024-10-24 15:04:49 -07:00
RNTesterPods.xcworkspace
RNTesterUnitTests Merge commit '143f1ad29874c1e8e9561abae263cb08f4859407' into 0.76-merge 2024-10-24 15:04:49 -07:00
RNTesterbundle
android/app set inset based padding to RNTester (#46354) 2024-09-05 15:56:54 -07:00
js Merge commit '143f1ad29874c1e8e9561abae263cb08f4859407' into 0.76-merge 2024-10-24 15:04:49 -07:00
.babelrc Move react-native-babel-transformer and react-native-babel-preset from Metro to React Native repo (#38228) 2023-07-27 11:48:16 -07:00
.eslintrc
.gitignore add .gitignore for rn-tester build artifacts (#44041) 2024-04-11 04:53:08 -07:00
.xcode.env
Gemfile feat: remove upper limit for Cocoapods version (allow for 1.15.2) (#45099) 2024-06-21 04:12:26 -07:00
Podfile Merge commit '6f7eae5c583090bd62ca60a4c3170445e5a0a751' into main 2024-08-22 23:08:52 -07:00
Podfile.lock Merge commit '143f1ad29874c1e8e9561abae263cb08f4859407' into 0.76-merge 2024-10-24 15:04:49 -07:00
PrivacyInfo.xcprivacy add privacy manifest to pod install 2024-04-02 21:38:52 -07:00
README.md Cleanup BUCK artifacts (#42990) 2024-02-13 05:07:54 -08:00
metro.config.js Merge commit '6f7eae5c583090bd62ca60a4c3170445e5a0a751' into main 2024-08-22 23:08:52 -07:00
package.json Merge commit '143f1ad29874c1e8e9561abae263cb08f4859407' into 0.76-merge 2024-10-24 15:04:49 -07:00
react-native.config.js Revert D59170923 (#45447) 2024-07-15 13:44:09 -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, search for and modify the fabric_enabled flag in RNTester's Podfile.

fabric_enabled = false

Also, if you previously built RNTester with fabric enabled, you might need to clean up the build files and Pods.

# Clean the generated files and folders to clean install RNTester
cd packages/rn-tester
yarn clean-ios

If you are still having a problem after doing the clean up (which can happen if you have built RNTester with older React Native versions where files were generated inside the react-native folder.), the best way might be to clean-install react-native (e.g. remove node_modules and yarn install).

Both macOS and Xcode are required.

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

Note for Apple Silicon users

If you own a Mac laptop with Apple Silicon, you need to run some different commands to install and run cocoapods.

  • sudo arch -x86_64 gem install ffi: this installs the ffi package to load dynamically-linked libraries.
  • arch -x86_64 pod install: this run pod install with the right architecture.

Running on Android

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

You can build and run RN-Tester by using this command from the root of the repo:

yarn android

If you wish to use JSC instead you should invoke:

cd packages/rn-tester
yarn install-android-jsc
yarn start

[!NOTE] Building for the first time can take a while.

If you're using a physical device, run adb reverse tcp:8081 tcp:8081 to make sure the device can access Metro.

See Running on Device for additional instructions on using a physical device.

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).