react-native-test-app provides a test app for all supported platforms as a package
Перейти к файлу
Tommy Nguyen aa7ca5396c
docs: remove copyright header from all files (#667)
2022-01-05 13:15:59 +01:00
.github test(android): add tests for Gradle utility functions (#687) 2022-01-05 10:28:31 +01:00
.vscode feat: validate `app.json` at build time (#653) 2021-12-17 19:52:15 +01:00
.yarn/releases chore(deps): update yarn to v3.1.1 (#689) 2022-01-05 09:17:07 +01:00
android docs: remove copyright header from all files (#667) 2022-01-05 13:15:59 +01:00
common docs: remove copyright header from all files (#667) 2022-01-05 13:15:59 +01:00
example docs: remove copyright header from all files (#667) 2022-01-05 13:15:59 +01:00
ios docs: remove copyright header from all files (#667) 2022-01-05 13:15:59 +01:00
macos docs: remove copyright header from all files (#667) 2022-01-05 13:15:59 +01:00
scripts docs: remove copyright header from all files (#667) 2022-01-05 13:15:59 +01:00
test docs: remove copyright header from all files (#667) 2022-01-05 13:15:59 +01:00
windows docs: remove copyright header from all files (#667) 2022-01-05 13:15:59 +01:00
.clang-format fix(ios): replace QRCodeReader with custom implementation (#677) 2022-01-03 12:49:57 +01:00
.editorconfig Add EditorConfig and format all files (#70) 2020-04-18 14:26:52 +02:00
.gitattributes chore: upgrade to Yarn 3 (#429) 2021-09-17 12:32:27 +00:00
.gitignore test(android): add tests for Gradle utility functions (#687) 2022-01-05 10:28:31 +01:00
.rubocop.yml ci: fix CI failing on `bundle install` (#603) 2021-11-22 13:09:31 +00:00
.swiftlint.yml chore(Apple): Use SwiftFormat (#245) 2020-11-16 11:20:09 +01:00
.yarnrc.yml chore(deps): update yarn to v3.1.1 (#689) 2022-01-05 09:17:07 +01:00
Brewfile chore: start using Temurin OpenJDK 11 (#524) 2021-09-27 10:43:35 +02:00
CODE_OF_CONDUCT.md Initial CODE_OF_CONDUCT.md commit 2020-01-20 05:22:23 -08:00
CONTRIBUTING.md chore: add reference to the RNEU talk in the readme (#588) 2021-11-10 12:45:04 +00:00
Gemfile fix(macos): fix "no account for team" and missing provisioning profile (#558) 2021-10-18 10:15:35 +02:00
Gemfile.lock chore(deps): update dependency rubocop to v1.24.1 (#682) 2022-01-03 10:05:12 +01:00
LICENSE Initial LICENSE commit 2020-01-20 05:22:24 -08:00
README.md chore: add reference to the RNEU talk in the readme (#588) 2021-11-10 12:45:04 +00:00
ReactTestApp-DevSupport.podspec fix(apple): ensure deployment targets in ReactTestApp-DevSupport are in sync (#571) 2021-10-27 11:03:14 +02:00
SECURITY.md Initial SECURITY.md commit 2020-01-20 05:22:25 -08:00
package.json chore(deps): update yarn to v3.1.1 (#689) 2022-01-05 09:17:07 +01:00
react-native.config.js docs: remove copyright header from all files (#667) 2022-01-05 13:15:59 +01:00
schema.json feat: validate `app.json` at build time (#653) 2021-12-17 19:52:15 +01:00
test-app.gradle feat: validate `app.json` at build time (#653) 2021-12-17 19:52:15 +01:00
test_app.rb docs: remove copyright header from all files (#667) 2022-01-05 13:15:59 +01:00
tsconfig.json chore: enable more TypeScript checks (#494) 2021-09-16 01:00:26 +02:00
yarn.lock chore(deps): update yarn to v3.1.1 (#689) 2022-01-05 09:17:07 +01:00

README.md

React Native Test App

Open in Visual Studio Code build npm version

React Native Test App provides test apps for all platforms as a package. It handles the native bits for you so you can focus on what's important: your product.

If you want to learn how RNTA is used at Microsoft, and see a demo of how to add it to an existing library - you can watch the "Improve all the repos – exploring Microsofts DevExp" talk by @kelset and @tido64 from React Native Europe 2021.

For more about the motivation and the design of this tool, you can refer to the wiki.

Quick Start

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

yarn add react-native-test-app --dev
yarn init-test-app

In this example, we will create a project named "sample" in sample with test apps for all platforms:

✔ What is the name of your test app? … sample
? Which platforms do you need test apps for? 
Instructions:
    ↑/↓: Highlight option
    ←/→/[space]: Toggle selection
    a: Toggle all
    enter/return: Complete answer
◉   Android
◉   iOS
◉   macOS
◉   Windows
✔ Where should we create the new project?? … sample

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 code and assets by running:

yarn build:android

If you're going to use the development server, you can skip this step.

To start the Android app, run:

yarn android

Alternatively, you can also run the app within Android Studio by pointing it to the android folder.

iOS

Bundle the JS code and assets by running:

yarn build:ios

If you're going to use the development server, you can skip this step.

Before you can run the iOS app, you must first install its native dependencies:

pod install --project-directory=ios

This command is also responsible for generating the Xcode project. To start the iOS app, run:

yarn ios

Alternatively, you can also run the app within Xcode by opening the Xcode workspace:

open ios/Sample.xcworkspace

Note: If you made changes to app.json or any other assets, you should re-run pod install to make sure that the changes are included in the Xcode project.

macOS

Bundle the JS code and assets by running:

yarn build:ios

If you're going to use the development server, you can skip this step.

Before you can run the macOS app, you must first install its native dependencies:

pod install --project-directory=macos

This command is also responsible for generating the Xcode project. To start the macOS app, run:

yarn macos

Alternatively, you can also run the app within Xcode by opening the Xcode workspace:

open macos/Sample.xcworkspace

Note: If you made changes to app.json or any other assets, you should re-run pod install to make sure that the changes are included in the Xcode project.

Windows

Bundle the JS code and assets by running:

yarn build:ios

Before you can run the Windows app, you must first generate it:

yarn install-windows-test-app --use-nuget

To start the Windows app, run:

yarn windows

Alternatively, you can also run the app within Visual Studio by opening the solution file:

start windows/Sample.sln

If you choose to use Visual Studio, remember to first set the target platform to x64. It is set to ARM by default.

Note: If you made changes to app.json or any other assets, you should re-run install-windows-test-app to make sure that the changes are included in the Visual Studio project.

Configuring the Test App

All configuration of the test app is done via app.json (otherwise known as the manifest). You can learn more about that in the wiki.

Additionally, you can find platform specific documentation below:

Known Issues

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