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

# Mobile App Testing

> Test your app on real devices using the a0 app or Expo Go

## Getting Started

Click **View on your Phone** in your a0 project to generate a QR code that works with:

<CardGroup cols={2}>
  <Card title="a0.dev App" icon="apple">
    **iOS Testing**

    * Opens directly if installed
    * Shows install option if not
    * Hot reloading enabled
  </Card>

  <Card title="Expo Go v52" icon="android">
    **Android Testing**

    * Must use version 52
    * Same QR code works
    * Full hot reload support
  </Card>
</CardGroup>

<Tip>
  Once scanned, the connection persists across different apps. You won't need to rescan unless you refresh the page.
</Tip>

## Testing with the a0 App (iOS)

### Quick Setup

<Steps>
  <Step title="Get the QR Code">
    Click **View on your Phone** in your a0 project.
  </Step>

  <Step title="Scan with iPhone Camera">
    * If you have a0 app → Opens immediately
    * If not → Shows App Store install link
  </Step>

  <Step title="Start Testing">
    Your app loads with hot reloading enabled. Save changes in the editor and they appear instantly.
  </Step>
</Steps>

## Testing with Expo Go v52 (Android)

### Setup

<Steps>
  <Step title="Install Expo Go v52">
    Download from the [Expo Website](https://expo.dev/go?sdkVersion=52\&platform=android\&device=false) and verify version 52 in app settings.
  </Step>

  <Step title="Scan the QR Code">
    Use the same QR code from **View on your Phone** - it works for both a0 app and Expo Go.
  </Step>

  <Step title="Test Your App">
    App loads with full hot reloading support.
  </Step>
</Steps>

## Limitations

**Important**: The a0 app does NOT support:

* ❌ Payment processing (UI shows but transactions fail)
* ❌ Ad networks
* ❌ Some custom native modules

For testing payments or ads, you must [test a native build](/development/testing/native-build-testing).

## Hot Reloading

Both a0 app and Expo Go provide seamless hot reloading:

1. **Instant Updates**: Save in editor → See changes immediately
2. **Persistent Connection**: Switch between apps without rescanning
3. **State Preservation**: Component state maintained during updates
4. **Error Recovery**: Clear errors shown with stack traces

<Info>
  The hot reload connection stays active even when switching between different apps on your phone. Only a page refresh breaks the connection.
</Info>

## Development Workflow

### Rapid Testing Cycle

```mermaid theme={null}
flowchart LR
    A[Edit Code] --> B[Save File]
    B --> C[Auto Updates]
    C --> D[Test on Device]
    D --> A
```

### Testing Multiple Devices

You can test on multiple devices simultaneously:

* Each device scans the same QR code
* All devices update together
* Test iOS and Android side-by-side

## Debugging

### Developer Menu

Shake your device or tap the screen with three fingers to access:

* **Reload** - Refresh the app
* **Debug** - Connect to debugger
* **Inspector** - View component tree
* **Perf Monitor** - See performance metrics

### Console Logs

```javascript theme={null}
// Logs appear in:
// 1. Browser console (if connected)
// 2. Device logs

console.log('Debug message');
console.warn('Warning');
console.error('Error details');
```

## Troubleshooting

<AccordionGroup>
  <Accordion title="App is loading forever">
    * Ensure that all your code is correct, this usually happens when there is an error
    * For Android, verify Expo Go is v52
    * Try refreshing and generating new QR
    * Open the project directly within the app instead of with the QR
  </Accordion>

  <Accordion title="App crashes on device">
    * Check error messages in console
    * Verify all imports are correct
    * Some web-only code may not work
    * Review device logs for details
  </Accordion>

  <Accordion title="Payments showing errors">
    This is expected behavior:

    * a0 app and Expo Go can't process payments
    * UI will show but transactions fail
    * Build IPA/APK for payment testing
  </Accordion>
</AccordionGroup>

## Next Steps

<CardGroup cols={2}>
  <Card title="Build for Production" icon="hammer" href="/development/testing/native-build-testing">
    Ready to test payments or ads? Build an IPA or APK with full native support.
  </Card>

  <Card title="Deploy Updates" icon="cloud-arrow-up" href="/publishing/ota-updates/overview">
    Learn how to push updates to all your users instantly.
  </Card>
</CardGroup>
