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

# Flutter Builds

> Create iOS and Android builds for Flutter apps

Generate simulator builds for your Flutter app.

## Build Guidance

To use the [Dev Loop](../../develop/dev-loop-overview), a build is required **on every code change**. Dart compiles into the native binary — see [Dev Loop: Hot reload and rebuild configuration](../../develop/dev-loop-overview#hot-reload-and-rebuild-configuration) for the full breakdown.

## Build via the Revyl CLI

### Prerequisites

* Flutter SDK installed (`flutter doctor` passes)
* Xcode (for iOS) or Android SDK (for Android)
* Revyl CLI installed and authenticated (`revyl auth login`)

### Setup

Initialize the project using the Revyl CLI:

```bash theme={null}
revyl init
```

This creates an app, generates the necessary Revyl configuration files, runs a build, and uploads it to Revyl.

## Run Build

Run a build using:
`revyl build --platform [ios|android|<config-key>]`

Platform config keys are automatically generated and defined in the `.revyl/config.yaml` file. See the [Configuration](/cli/command-reference#section-reference) page for more details.

This command automatically builds and uploads the app to Revyl, where you can use it to start sessions.

## Advanced Configuration

When you run `revyl init`, Revyl makes a best-effort guess at your configuration. This section covers configuration in more detail.

If the build does not complete successfully modify the build commands manually in the [config.yaml file](/cli/command-reference#config-yaml).

Note: For flutter apps, use **debug builds** for better test reliability.

Debug builds provide an accurate view hierarchy extraction, better element identification, and faster execution.

Here are example commands of how to build your flutter app as a debug configuration:

```bash theme={null}
# iOS debug build
flutter build ios --debug --simulator

# Android debug build
flutter build apk --debug
```

## Troubleshooting

<AccordionGroup>
  <Accordion title="iOS build fails">
    Check Xcode configuration:

    ```bash theme={null}
    flutter doctor
    sudo xcode-select --switch /Applications/Xcode.app
    ```
  </Accordion>

  <Accordion title="Android build fails">
    Clean and rebuild:

    ```bash theme={null}
    flutter clean
    flutter pub get
    flutter build apk --debug
    ```
  </Accordion>

  <Accordion title="Can't find build file">
    Check build output directory:

    ```bash theme={null}
    # iOS
    open build/ios/iphonesimulator/

    # Android
    open build/app/outputs/flutter-apk/
    ```
  </Accordion>
</AccordionGroup>

## Resources

* [Flutter Build Modes](https://docs.flutter.dev/testing/build-modes)
* [Flutter Debugging](https://docs.flutter.dev/testing/debugging)
