react-native-test-app provides a test app for all supported platforms as a package
Перейти к файлу
Tommy Nguyen ccd37f4b9e
ci: `reactivecircus/android-emulator-runner` has connection issues again (#447)
2021-08-12 01:15:04 +02:00
.github ci: `reactivecircus/android-emulator-runner` has connection issues again (#447) 2021-08-12 01:15:04 +02:00
.vscode fix(Windows): Test app fails to load embedded JS bundle (#250) 2020-11-24 10:44:46 +01:00
android feat(android): support starting activities (#410) 2021-07-13 11:07:19 +02:00
example fix(ios): fix `run-ios` failing with `@react-native-community/cli` 5 (#445) 2021-08-11 21:33:27 +02:00
ios fix(macos): `react-native-macos` canary breaks `pod install` (#421) 2021-07-23 21:52:42 +02:00
macos fix: use app display name from the manifest (#276) 2021-02-04 09:07:03 +01:00
scripts fix(ios): fix `run-ios` failing with `@react-native-community/cli` 5 (#445) 2021-08-11 21:33:27 +02:00
test fix(ios): fix `run-ios` failing with `@react-native-community/cli` 5 (#445) 2021-08-11 21:33:27 +02:00
windows fix(windows): bump XAML for WinUI 2.6 (#446) 2021-08-11 21:34:13 +02: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 fix(android): migrate away from JCenter (#278) 2021-04-07 16:34:48 +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 ci: integrate ktlint (#279) 2021-02-06 11:11:56 +01:00
CODE_OF_CONDUCT.md Initial CODE_OF_CONDUCT.md commit 2020-01-20 05:22:23 -08:00
CONTRIBUTING.md docs: refresh README (#413) 2021-07-20 12:38:56 +02:00
Gemfile ci: use rubocop-minitest as suggested by RuboCop (#280) 2021-02-06 00:53:51 +01:00
Gemfile.lock chore(deps): bump rubocop from 1.18.3 to 1.18.4 (#427) 2021-07-26 10:13:17 +02:00
LICENSE Initial LICENSE commit 2020-01-20 05:22:24 -08:00
README.md docs: refresh README (#413) 2021-07-20 12:38:56 +02: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: common config is overwriting platform files (#390) 2021-07-07 13:32:47 +02:00
react-native.config.js fix: warn and skip unsupported versions (#373) 2021-06-29 13:03:40 +02:00
test-app.gradle fix(android): ensure that RNTA can automatically link Gradle scripts (#307) 2021-04-28 19:46:51 +02:00
test_app.rb fix: use app display name from the manifest (#276) 2021-02-04 09:07:03 +01:00
tsconfig.json fix: warn and skip unsupported versions (#373) 2021-06-29 13:03:40 +02:00
yarn.lock chore(deps): bump path-parse from 1.0.6 to 1.0.7 (#442) 2021-08-11 01:47:39 +00: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 more about the motivation or 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.