> ## Documentation Index
> Fetch the complete documentation index at: https://docs.soundchecklive.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Local Testing Guide

> Testing strategies for local development and debugging

This guide provides multiple ways to test your React Native app locally to debug issues.

## Testing Methods

> [card] Development Server
>
> Fastest iteration with hot reloading

> [card] Local Production Build
>
> Most similar to TestFlight builds

> [card] iOS Simulator
>
> No physical device needed

> [card] Preview Builds
>
> Internal distribution builds

***

## Method 1: Development Server (Fastest)

```bash theme={null}
# Start development server
npm run dev

# Or with specific port
npx expo start --port 8084
```

### Benefits

* ⚡ Fastest iteration
* 🔄 Hot reloading
* 🐛 Easy debugging with React DevTools
* 📱 Works with Expo Go

### Limitations

* Not production-like environment
* Some native features may not work in Expo Go

***

## Method 2: Local Production Builds (Recommended for TestFlight Debugging)

```bash theme={null}
# Build iOS locally (production profile)
npx eas build --local --platform ios --profile production --non-interactive

# Build Android locally (production profile)
npx eas build --local --platform android --profile production --non-interactive
```

### Benefits

* 🎯 Most similar to TestFlight builds
* 🔧 Production optimizations enabled
* 📦 Same bundle as TestFlight
* ⚡ Faster than cloud builds

### Installing Local Builds

**iOS:**

1. Open the generated `.app` file in Xcode
2. Connect your iOS device
3. Select your device in Xcode
4. Click "Run" to install

**Android:**

```bash theme={null}
adb install path/to/your-app.apk
```

***

## Method 3: iOS Simulator

### Prerequisites

1. Install Xcode from App Store
2. Install Command Line Tools: `xcode-select --install`

### Running on Simulator

```bash theme={null}
# List available simulators
xcrun simctl list devices available

# Run on specific simulator
npx expo run:ios --device "iPhone 15 Pro"
```

### Benefits

* 🖥️ No physical device needed
* 🔄 Fast iteration
* 🐛 Full debugging capabilities

***

## Method 4: Preview Builds (EAS)

```bash theme={null}
# Build for internal testing
npx eas build --platform ios --profile preview
npx eas build --platform android --profile preview
```

### Benefits

* 📱 Install without App Store
* 🔗 Shareable via TestFlight or direct download
* 🎯 Good for team testing

***

## Debugging TestFlight Issues

### Step-by-Step Workflow

**1. Identify the Issue**

Check TestFlight crash logs for specific error messages. Note iOS version and device type.

**2. Reproduce Locally**

```bash theme={null}
npx eas build --local --platform ios --profile production --non-interactive
```

**3. Test on Physical Device**

Install the local build on the same device type as the failing report.

**4. Compare Environments**

* Development vs Production builds
* Different iOS versions
* Different device types

***

## Common Issues & Solutions

> [accordion] Code Signing Issues
>
> ```bash theme={null}
> # Check your certificates
> npx eas credentials
>
> # Update certificates if needed
> npx eas credentials --platform ios
> ```

> [accordion] Bundle Size Issues
>
> ```bash theme={null}
> # Analyze bundle size
> npx expo export --platform ios
> npx @expo/bundle-analyzer dist/ios/index.bundle
> ```

> [accordion] Environment Variable Issues
>
> ```bash theme={null}
> # Check environment variables in EAS
> npx eas env:list
>
> # Compare with local .env file
> cat .env
> ```

> [accordion] Native Module Issues
>
> ```bash theme={null}
> # Check for missing native modules
> npx expo install --check
>
> # Rebuild native code
> npx expo prebuild --clean
> ```

> [accordion] Disk Space Issues (ENOSPC)
>
> ```bash theme={null}
> # Quick cleanup
> ./cleanup-disk-space.sh
>
> # Manual cleanup
> rm -rf ~/Library/Developer/Xcode/DerivedData/*
> xcrun simctl delete unavailable
> rm -rf ~/Library/Caches/*
>
> # Alternative: Use cloud builds
> npx eas build --platform ios --profile production
> ```

***

## Quick Commands Reference

### Development

```bash theme={null}
npm run dev                    # Start development server
npm run ios                    # Run on iOS simulator
npm run android                # Run on Android emulator
```

### Local Production Builds

```bash theme={null}
npx eas build --local --platform ios --profile production --non-interactive
npx eas build --local --platform android --profile production --non-interactive
```

### Cloud Builds

```bash theme={null}
npx eas build --platform ios --profile production
npx eas build --platform android --profile production
```

### Debugging

```bash theme={null}
npx expo doctor                # Check for issues
npx expo install --check       # Check dependencies
npm run check-all              # Type check + lint
```

***

## Troubleshooting Checklist

### Before Building

* [ ] Run `npm run check-all` (no errors)
* [ ] Check environment variables are set
* [ ] Verify all dependencies are installed
* [ ] Test in development mode first

### During Build

* [ ] Monitor build logs for errors
* [ ] Check for missing certificates
* [ ] Verify bundle identifier matches
* [ ] Ensure version numbers are correct

### After Build

* [ ] Test on physical device
* [ ] Check crash logs
* [ ] Verify all features work
* [ ] Test with different user accounts

***

## Recommended Testing Strategy

**1. Start with Development**

```bash theme={null}
npm run dev
```

**2. Test Core Features**

Ensure basic functionality works in development.

**3. Build Locally**

```bash theme={null}
npx eas build --local --platform ios --profile production
```

**4. Test on Device**

Install and test the local build.

**5. Compare with TestFlight**

Identify differences between local and TestFlight builds.

**6. Fix and Repeat**

Make changes, rebuild, and test again.

***

## Resources

* [EAS Build Documentation](https://docs.expo.dev/build/introduction/)
* [Local Builds Guide](https://docs.expo.dev/build/local-builds/)
* [iOS Code Signing](https://docs.expo.dev/app-signing/app-signing/)
* [Expo Debugging](https://docs.expo.dev/debugging/runtime-issues/)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.