Building for iOS Simulator

Step 1: Generate the Bundle File

Navigate to your React Native project and generate the iOS bundle:
cd /path/to/your/react-native-project

# Generate the bundle file for iOS
npx react-native bundle \
  --entry-file='index.js' \
  --bundle-output='./ios/main.jsbundle' \
  --dev=false \
  --platform='ios'

Step 2: Open Your Project in Xcode

  1. Launch Xcode and open your app’s workspace:
    open ios/YourApp.xcworkspace
    
  2. Wait for Xcode to finish loading and indexing your project

Step 3: Build the .app File

  1. In Xcode, select any iOS Simulator as your destination
  2. Build your project: Product > Build (⌘+B)
  3. Locate your build at: ios/build/Build/Products/Debug-iphonesimulator/YourApp.app

Step 4: Validate Your Build

  1. Open iOS Simulator
  2. Drag your .app file onto the simulator
  3. Launch the app to verify it works correctly

Building for Android Emulator

Step 1: Create Assets Directory

Ensure the assets directory exists:
mkdir -p android/app/src/main/assets

Step 2: Generate the Bundle File

Generate the Android bundle and assets:
# Generate the bundle file for Android
npx react-native bundle \
  --platform android \
  --dev false \
  --entry-file index.js \
  --bundle-output android/app/src/main/assets/index.android.bundle \
  --assets-dest android/app/src/main/res

Step 3: Build the APK File

Navigate to the Android directory and build:
# Go to the android folder
cd android

# Build the .apk file with Gradle
./gradlew assembleDebug

Step 4: Locate Your APK

The resulting APK will be at: android/app/build/outputs/apk/debug/app-debug.apk

Step 5: Validate Your Build

  1. Start your Android emulator
  2. Install the APK: adb install app/build/outputs/apk/debug/app-debug.apk
  3. Launch the app from the emulator to verify functionality

Troubleshooting

Next Steps

Once you have your build files:
  1. iOS: Locate your .app file in ios/build/Build/Products/Debug-iphonesimulator/
  2. Android: Locate your .apk file in android/app/build/outputs/apk/debug/
  3. Proceed to Uploading your app

Additional Resources

Need help? Contact our support team at [email protected].