-
Notifications
You must be signed in to change notification settings - Fork 95
Quick Start
You can generate a new project using npx:
npx --package react-native-test-app@latest initIn this example, we will create a project named "sample" in sample with 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
◯ visionOS (Experimental)
◉ Windows
✔ Where should we create the new project? … sampleInstall npm dependencies inside the new project folder:
Yarn:
cd sample
yarnnpm:
cd sample
npm installOnce the dependencies are installed, follow the platform specific instructions below.
Bundle the JS code and assets by running:
Yarn:
yarn build:androidnpm:
npm run build:androidIf you're going to use the development server, you can skip this step.
To start the Android app, run:
Yarn:
yarn androidnpm:
npm run androidAlternatively, you can also run the app within Android Studio by pointing it to
the android folder.
Bundle the JS code and assets by running:
Yarn:
yarn build:iosnpm:
npm run build:iosIf 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=iosThis command is also responsible for generating the Xcode project. To start the iOS app, run:
Yarn:
yarn iosnpm:
npm run iosAlternatively, you can also run the app within Xcode by opening the Xcode workspace:
open ios/Sample.xcworkspaceNote
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.
Bundle the JS code and assets by running:
Yarn:
yarn build:macosnpm:
npm run build:macosIf 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=macosThis command is also responsible for generating the Xcode project. To start the macOS app, run:
Yarn:
yarn macosnpm:
npm run macosAlternatively, you can also run the app within Xcode by opening the Xcode workspace:
open macos/Sample.xcworkspaceNote
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.
Bundle the JS code and assets by running:
Yarn:
yarn build:windowsnpm:
npm run build:windowsBefore you can run the Windows app, you must first generate the project:
npx install-windows-test-app --use-nugetTo start the Windows app, run:
Yarn:
yarn windowsnpm:
npm run windowsAlternatively, 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, make sure the target platform is set to
x64. It is usually 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.