react-native-test-app provides a test app for all supported platforms as a package
Перейти к файлу
Tommy Nguyen 6f64e208e0
fix: Reopen last component from previous session (#262)
2021-01-04 22:13:50 +01:00
.github ci: Use the automatically generated access token (#257) 2020-12-12 11:52:39 +01:00
.vscode fix(Windows): Test app fails to load embedded JS bundle (#250) 2020-11-24 10:44:46 +01:00
android fix: Reopen last component from previous session (#262) 2021-01-04 22:13:50 +01:00
example fix: Reopen last component from previous session (#262) 2021-01-04 22:13:50 +01:00
ios fix: Reopen last component from previous session (#262) 2021-01-04 22:13:50 +01:00
macos fix: Reopen last component from previous session (#262) 2021-01-04 22:13:50 +01:00
scripts fix(Apple): Allow passing options to use_react_native! (#266) 2021-01-04 11:57:12 +01:00
test fix(Apple): Also create an xcscheme to match app name (#240) 2020-11-04 11:54:14 +01:00
windows fix: Reopen last component from previous session (#262) 2021-01-04 22:13:50 +01:00
.clang-format fix(Windows): Load React components (#166) 2020-09-07 11:05:39 +02:00
.editorconfig Add EditorConfig and format all files (#70) 2020-04-18 14:26:52 +02:00
.gitattributes iOS: Set up example project and build CI (#8) 2020-03-03 12:25:03 -08:00
.gitignore feat: Bump react-native to 0.63 (#248) 2020-11-23 15:16:30 +01:00
.npmignore ci: Fix node_modules cache sometimes getting stale (#217) 2020-09-14 09:27:39 +02:00
.rubocop.yml fix(Apple): Allow passing options to use_react_native! (#266) 2021-01-04 11:57:12 +01:00
.swiftlint.yml chore(Apple): Use SwiftFormat (#245) 2020-11-16 11:20:09 +01:00
.yarnrc ci: Fix node_modules cache sometimes getting stale (#217) 2020-09-14 09:27:39 +02:00
.yarnrc-offline ci: Fix node_modules cache sometimes getting stale (#217) 2020-09-14 09:27:39 +02:00
Brewfile chore(Apple): Use SwiftFormat (#245) 2020-11-16 11:20:09 +01:00
CODE_OF_CONDUCT.md Initial CODE_OF_CONDUCT.md commit 2020-01-20 05:22:23 -08:00
Gemfile Run RuboCop on CI (#28) 2020-03-26 23:39:34 +01:00
Gemfile.lock fix: Allow users to enable Flipper (#121) 2020-06-18 12:42:50 +02:00
LICENSE Initial LICENSE commit 2020-01-20 05:22:24 -08:00
README.md fix(Windows): Cannot install release build (#241) 2020-11-09 14:28:16 +01:00
ReactTestApp-DevSupport.podspec fix(Apple): Fix tests depending on ReactTestApp-DevSupport not building (#181) 2020-08-04 21:30:50 +02:00
SECURITY.md Initial SECURITY.md commit 2020-01-20 05:22:25 -08:00
package.json fix(Apple): Allow passing options to use_react_native! (#266) 2021-01-04 11:57:12 +01:00
plopfile.js fix(Windows): Fix build failing on 0.63.13+ (#261) 2021-01-04 11:00:59 +01:00
react-native.config.js fix: Add `init-test-app` command to React Native CLI (#232) 2020-10-06 11:43:59 +02:00
test-app.gradle ci: configuring RNTA on Android for running instrumented tests (#187) 2020-08-12 17:21:39 +02:00
test_app.rb fix(Apple): Allow passing options to use_react_native! (#266) 2021-01-04 11:57:12 +01:00
tsconfig.json fix(Windows): Include user projects in the generated solution (#220) 2020-09-17 16:10:34 +02:00
yarn.lock fix(Windows): Fix build failing on 0.63.13+ (#261) 2021-01-04 11:00:59 +01:00

README.md

React Native Test App

build npm version

React Native Test App provides test apps for all platforms as a package. Bring your own JS bundle, and let us manage the native bits.

This is a work in progress. You can read and discuss the RFC at React Native: Discussions and Proposals.

For more details, please refer to the wiki.

Dependencies

react-native-test-app is published with source code only. You will still need to compile the test apps yourself.

  • Android:
    • Android Studio 3.6 or later
      • Android SDK Platform 29
      • Android SDK Build-Tools 29.0.3
      • To install the required SDKs, go into PreferencesAppearance & BehaviorSystem SettingsAndroid SDK.
  • iOS/macOS:
  • Windows:

Quick Start

Install react-native-test-app as a dev dependency. We will use Plop to generate the test app:

yarn add react-native-test-app --dev
yarn plop --plopfile node_modules/react-native-test-app/plopfile.js --dest sample

--dest tells Plop where to generate the files. In this example, it will generate files under sample folder. Choose the appropriate place to store your test app, then answer a couple of questions:

? What is the name of your test app? Sample
? Which platforms do you need test apps for? all

Run yarn inside the new project folder:

cd sample
yarn

Once the dependencies are installed, follow the platform specific instructions below.

Android

# Bundle the JS first so Gradle can find
# the assets.
yarn build:android
yarn android

# Instead of `yarn android`, you can
# also build and run `sample/android` in
# Android Studio.

# On macOS, you can open the project from
# the terminal:
open -a "Android Studio" android

iOS

# Bundle the JS first so CocoaPods can
# find the assets.
yarn build:ios
pod install --project-directory=ios
yarn ios

# Instead of `yarn ios`, you can also
# build and run in Xcode.
open ios/Sample.xcworkspace

macOS

# Bundle the JS first so CocoaPods can
# find the assets.
yarn build:macos
pod install --project-directory=macos
yarn macos

# Instead of `yarn macos`, you can also
# build and run in Xcode.
open macos/Sample.xcworkspace

Windows

# Bundle the JS first so the assets can
# be included in the project.
yarn build:windows
yarn install-windows-test-app
yarn windows

# Instead of `yarn windows`, you can
# also build and run 'windows/Sample.sln'
# in Visual Studio.

# To run test app on your local machine,
# remember to set platform to x64 (it is
# set to ARM by default)

Developing React Native Test App

Additional dependencies:

We'll be using the Example app for all development of the React Native Test App. Some platforms may require extra steps for the initial set up. Please follow the steps below, then jump to the appropriate section(s) for the final steps.

Open a terminal and navigate to your clone of this repository:

cd react-native-test-app

# This step only needs to be done once,
# before we can install the Example app's
# dependencies. It is stored in
# `~/.config/yarn/link/react-native-test-app`.
# You can run `unlink` if you need to
# remove it later.
yarn link

# Install Example app's dependencies.
cd example
yarn

# Now we use the link we created earlier.
# This step needs to be run _after_
# `yarn` otherwise it will be
# overwritten.
yarn link "react-native-test-app"

Android

# Bundle the JS first so Gradle can find
# the assets.
yarn build:android

# Finally, open the `android` folder in
# Android Studio.

# On macOS, you can open the project from
# the terminal:
open -a "Android Studio" android

iOS

# Bundle the JS first so CocoaPods can
# find the assets.
yarn build:ios
pod install --project-directory=ios

# Finally, open the Xcode workspace.
open ios/Example.xcworkspace

macOS

# Bundle the JS first so CocoaPods can
# find the assets.
yarn build:macos
pod install --project-directory=macos

# Finally, open the Xcode workspace.
open macos/Example.xcworkspace

Windows

# Bundle the JS first so the assets can
# be included in the project.
yarn build:windows
yarn install-windows-test-app

# Finally, open 'Example.sln' in Visual
# Studio.

# To run test app on your local machine,
# remember to set platform to x64 (it is
# set to ARM by default)

Known Issues

For a list of known issues and workarounds, please go to the Troubleshooting page in the wiki.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repositories using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.