# Producing an iOS Build

Moropo supports running tests on iOS using a `.app` simulator build file.

Please note: real iOS device builds with the file extension `.ipa` are currently **not supported**.

{% hint style="info" %}
**Important: ensure your zip your `.app`**

Because of the way that some operating systems handle `.app` files, it's essential that you zip your build before uploading it to Moropo.

The file you upload will look like this: **`myapp.app.zip`**\
How to zip on [MacOS](https://support.apple.com/en-gb/guide/mac-help/mchlp2528/mac), [Windows](https://support.microsoft.com/en-us/windows/zip-and-unzip-files-8d28fa72-f2f9-712f-67df-f80cf89fd4e5).&#x20;
{% endhint %}

## Which build type should I use?

You can use any backend environment so long as your build target is `simulator`.

Many Moropo users configure different test setups for different build types. For example:

* a simulator build using your Dev Environment that runs a regression suite on each pull request for a single device
* a simulator build using your Staging Environment that runs a full test suite before each production release across a wide range of devices

## Using XCode Command Line to produce a `.app`

If you're comfortable with the terminal and have a natively-built iOS app, you can use `xcrun` to produce your build file.

For example, to build an app called "Classy Mall":

```bash
xcrun xcodebuild -scheme 'Classy Mall' \
-project 'Class Mall.xcodeproj' \
-sdk 'iphonesimulator' \
-configuration Debug \
-destination 'generic/platform=iOS Simulator' \
-derivedDataPath \
build
```

Once successful, your `.app` simulator build will be found in the `./build` folder.<br>

## Using XCode UI to produce a `.app`

If you prefer a user interface, you can use [XCode](https://developer.apple.com/xcode/) to produce your build file:

1. Launch XCode.
2. Open your project.
3. Set your target to **simulator**.\
   \
   ![](https://1849561984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNrvYDqka9qiakmPqT4am%2Fuploads%2FCfzorCNMxeGb9t8dZdKV%2FScreenshot%202023-07-28%20at%2013.08.06.png?alt=media\&token=3b0b0e4a-a0e8-4dbb-83af-80dafe8d016b)<br>
4. Click on the **Product** menu in the top bar, then select **Build**.
5. Wait for your build to complete.\
   \
   ![](https://1849561984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNrvYDqka9qiakmPqT4am%2Fuploads%2FVvM0LujTgirXGHQ1Ufbf%2FScreenshot%202023-07-28%20at%2013.08.35.png?alt=media\&token=53ed9c47-d61c-4b46-ad96-1efc89fb1358)<br>
6. Click on the **Product** menu in the top bar, then select **Show Build Folder in Finder** to open the file system on the newly exported `.app` file.\
   \
   ![](https://1849561984-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNrvYDqka9qiakmPqT4am%2Fuploads%2FUy4J6N8uNXDzulVsDBSm%2FScreenshot%202023-07-28%20at%2013.09.49.png?alt=media\&token=1c26c455-2fa1-470f-9af5-ca073c0e05c0)

## \[React Native] Using Expo EAS to produce a `.app`&#x20;

If your app is built using React Native, you can use [Expo Application Services](https://expo.dev/eas) to build your app.

Ensure your `eas.config` includes the correct setting:

```json
{
  "build": {
    "myProfile": {
      "ios": {
        "simulator": true
      }
    }
  }  
}    
```

*Note: EAS allows a `.app` to be produced using various config options; read the* [*official docs*](https://docs.expo.dev/build-reference/simulators/)*.*

Run EAS via your terminal to trigger the build:&#x20;

```
eas build -p ios --profile myProfile
```

## Using Flutter to produce a `.app`

If your app is built using Flutter, you can use the `flutter` command line inside your terminal.

To produce an iOS simulator build, run `flutter build ios --debug --simulator`

Your `.app` will appear in the `./build/ios/iphonesimulator/` folder.
