# Build iOS app for simulator and deploy to Appetize.io

**URL:** <https://discuss.bitrise.io/t/build-ios-app-for-simulator-and-deploy-to-appetize-io/5622>\
**Category:** iOS\
**Created:** [July 10, 2018, 3:10pm UTC](https://discuss.bitrise.io/t/build-ios-app-for-simulator-and-deploy-to-appetize-io/5622 "2018-07-10T15:10:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![BirmacherAkos](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.bitrise.io/birmacherakos/32/1319_2.png) [@BirmacherAkos](https://discuss.bitrise.io/u/BirmacherAkos)\
**Post date:** [July 10, 2018, 3:10pm UTC](https://discuss.bitrise.io/t/build-ios-app-for-simulator-and-deploy-to-appetize-io/5622/1 "2018-07-10T15:10:32Z")

</div>

# Build iOS app for simulator via xcodebuild and deploy it to [Appetize.io](http://Appetize.io) for demos, customer support, testing etc.

## Steps

### Scipt step - To create the iOS .app for simulator:

- Script content if you have a workspace:

```auto
#!/usr/bin/env bash
set -e
set -x

xcodebuild "-workspace" "$BITRISE_SOURCE_DIR/$BITRISE_PROJECT_PATH" "-scheme" "$BITRISE_SCHEME" "-configuration" "$CONFIGURATION" "CODE_SIGN_IDENTITY=" "build" "-destination" "$SIMULATOR_IDENTITY" "PROVISIONING_PROFILE_SPECIFIER=" -derivedDataPath $BITRISE_SOURCE_DIR/ddata  

```

* * *

- Script content if you have just a project:

```auto
#!/usr/bin/env bash
set -e
set -x

xcodebuild "-project" "$BITRISE_SOURCE_DIR/$BITRISE_PROJECT_PATH" "-scheme" "$BITRISE_SCHEME" "-configuration" "$CONFIGURATION" "CODE_SIGN_IDENTITY=" "build" "-destination" "$SIMULATOR_IDENTITY" "PROVISIONING_PROFILE_SPECIFIER=" -derivedDataPath $BITRISE_SOURCE_DIR/ddata  

```

### Create ZIP step - To export the builded .app to the _deploy dir_:

- Source directory path:  
`$BITRISE_SOURCE_DIR/ddata/Build/Products/Debug-iphonesimulator/$BITRISE_SCHEME.app`

- Target directory path:  
`$BITRISE_DEPLOY_DIR/$BITRISE_SCHEME.zip`

### Deploy to [Bitrise.io](http://Bitrise.io) - Apps, Logs, Artifacts

- Just put this step there so you will have the .apps under the APPS & ARTIFACTS tab.

### [Appetize.io](http://Appetize.io) deploy

- Application path:  
`$BITRISE_DEPLOY_DIR/$BITRISE_SCHEME.zip`

* * *

## Create secrets:

- `APPETIZE_TOKEN`: The token provided by [Appetize.io](http://Appetize.io)  
**NOTE:** You can request an API token for [Appetioze.io](http://Appetioze.io) here: [Appetize.io/request-api-token](https://appetize.io/docs#request-api-token)

## Create envs:

- **SIMULATOR\_IDENTITY** : `platform=iOS Simulator,name=iPhone 6,OS=11.3`  
**NOTE** : This is only an example

- **CONFIGURATION** : `Debug`  
**NOTE** : This is only an example

* * *

## Bitrise.yml:

It should look like this:

```auto
---
format_version: '5'
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git
project_type: ios
trigger_map:
- push_branch: "*"
  workflow: primary
- pull_request_source_branch: "*"
  workflow: primary
workflows:
  xcodebuild_simulator_script:
    steps:
    - activate-ssh-key:
        run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
    - git-clone: {}
    - cocoapods-install@1.7.2: {}
    - script@1.1.5:
        inputs:
        - content: |-
            #!/usr/bin/env bash
            set -e
            set -x

            xcodebuild "-workspace" "$BITRISE_SOURCE_DIR/$BITRISE_PROJECT_PATH" "-scheme" "$BITRISE_SCHEME" "-configuration" "$CONFIGURATION" "CODE_SIGN_IDENTITY=" "build" "-destination" "$SIMULATOR_IDENTITY" "PROVISIONING_PROFILE_SPECIFIER=" -derivedDataPath $BITRISE_SOURCE_DIR/ddata
    - create-zip@0.9.0:
        inputs:
        - destination: "$BITRISE_DEPLOY_DIR/$BITRISE_SCHEME.zip"
        - source_path: "$BITRISE_SOURCE_DIR/ddata/Build/Products/Debug-iphonesimulator/$BITRISE_SCHEME.app"
    - deploy-to-bitrise-io@1.3.12: {}
    - appetize-deploy@0.9.0:
        inputs:
        - appetize_token: "$APPETIZE_TOKEN"
        - app_path: "$BITRISE_DEPLOY_DIR/$BITRISE_SCHEME.zip"
app:
  envs:
  - opts:
      is_expand: false
    BITRISE_PROJECT_PATH: XcodeArchiveTest.xcworkspace
  - opts:
      is_expand: false
    BITRISE_SCHEME: XcodeArchiveTest
  - opts:
      is_expand: false
    BITRISE_EXPORT_METHOD: development
    SIMULATOR_IDENTITY: platform=iOS Simulator,name=iPhone 6,OS=11.3
  - opts:
      is_expand: false
    CONFIGURATION: Debug

```

* * *

 ![](https://sea2.discourse-cdn.com/flex016/uploads/bitrise/original/2X/4/4e578116bc356b4a833a56d237f1f973cdf224b8.png)

---

<div class="post-metadata">

**Author:** ![johnwright](https://avatars.discourse-cdn.com/v4/letter/j/a88e4f/32.png) [@johnwright](https://discuss.bitrise.io/u/johnwright)\
**Post date:** [October 6, 2018, 7:20pm UTC](https://discuss.bitrise.io/t/build-ios-app-for-simulator-and-deploy-to-appetize-io/5622/2 "2018-10-06T19:20:39Z")

</div>

The given process can be very useful for those who are going to make the ios app through this and this will really help them. I have also made the app for the ios platform by this process with the help of [Apple iPad support](https://applesupportnumber.net/apple-ipad-support/).
