React Native (bare)

Configure buildtree build

{
  "buildtree": {
    "builds": {
      "ios": {
        "command": "cd ios && fastlane build_adhoc",
        "artifact": "ios/build/MyApp.ipa"
      },
      "android": {
        "command": "cd android && ./gradlew assembleRelease",
        "artifact": "android/app/build/outputs/apk/release/app-release.apk"
      }
    }
  }
}
buildtree publish ios --env dev
buildtree publish android --env dev

Fastlane on iOS

lane :build_adhoc do
  build_app(
    workspace: "MyApp.xcworkspace",
    scheme: "MyApp",
    export_method: "ad-hoc",
    output_directory: "./build",
    output_name: "MyApp.ipa",
    clean: true
  )
end

export_method: "ad-hoc" is load-bearing. Ad-hoc IPAs are the kind that work with the UDID-based device flow.

Gradle on Android

assembleRelease produces an APK at android/app/build/outputs/apk/release/app-release.apk. Configure signing in android/app/build.gradle:

signingConfigs {
    release {
        storeFile file('release.keystore')
        storePassword System.getenv('STORE_PASSWORD')
        keyAlias 'release'
        keyPassword System.getenv('KEY_PASSWORD')
    }
}
buildTypes {
    release {
        signingConfig signingConfigs.release
    }
}

Parallel branch installs

Different feature-branch builds overwrite each other on a test device when they share a bundle id. Use a Fastlane lane that takes a branch suffix:

lane :build_adhoc do |options|
  suffix = options[:suffix] || ""
  update_app_identifier(
    xcodeproj: "MyApp.xcodeproj",
    plist_path: "MyApp/Info.plist",
    app_identifier: "com.acme.app#{suffix}"
  )
  build_app(...)
end
fastlane build_adhoc suffix:.preview
React Native (bare) · Framework guide | buildtree docs