Skip to content

Migrate an Existing Test App

Tommy Nguyen edited this page Jul 10, 2020 · 13 revisions

Contents

Add/Edit the Manifest

If it doesn't already exist, create app.json at the root of your project.

{
  "name": "Example",
  "displayName": "Example",
  "components": [
    {
      "appKey": "Example",
      "displayName": "App"
    }
  ],
  "resources": [
    "dist/res",
    "dist/main.jsbundle"
  ]
}

For more details, see Manifest (app.json).

Android

Keep the following files:

android
├── gradle
│   └── wrapper
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
└── settings.gradle

Enable Jetpack and AndroidX in gradle.properties:

android.useAndroidX=true
android.enableJetifier=true

Take a look at Android Specifics to further customize the test app.

Finally, change settings.gradle to the following (adjust the name and the path to test-app.gradle accordingly):

rootProject.name='example'

apply from: file("../node_modules/react-native-test-app/test-app.gradle")
applyTestAppSettings(settings)

iOS

Keep the following files:

ios
├── Podfile
└── Podfile.lock

Change Podfile to the following (adjust the workspace name and the path to test_app.rb accordingly):

require_relative '../node_modules/react-native-test-app/test_app.rb'

workspace 'Example.xcworkspace'

use_test_app!

If you need to further customize the test app or additional pods, please see iOS and macOS Specifics.

macOS

Keep the following files:

macos
├── Podfile
└── Podfile.lock

Change Podfile to the following (adjust the workspace name and the path to test_app.rb accordingly):

require_relative '../node_modules/react-native-test-app/macos/test_app.rb'

workspace 'Example.xcworkspace'

use_test_app!

If you need to further customize the test app or additional pods, please see iOS and macOS Specifics.

Clone this wiki locally