# Build Expo apps with turtle-cli

**URL:** <https://discuss.bitrise.io/t/build-expo-apps-with-turtle-cli/7916>\
**Category:** Question & Answer\
**Tags:** react-native\
**Created:** [January 30, 2019, 3:33pm UTC](https://discuss.bitrise.io/t/build-expo-apps-with-turtle-cli/7916 "2019-01-30T15:33:08Z")\
**Posts on this page:** 1\
**Showing post:** 2

<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:** [January 30, 2019, 4:42pm UTC](https://discuss.bitrise.io/t/build-expo-apps-with-turtle-cli/7916/2 "2019-01-30T16:42:09Z")

</div>

Hi!

Currently we don’t have step for the Turtle-CLI but you can still use it on Bitrise:

- In the first option you will need to upload the Code Signing files to Bitrise under the Generic file storage  
[https://devcenter.bitrise.io/tutorials/how-to-use-the-generic-file-storage/#uploading-files-to-generic-file-storage-on-bitriseio](https://devcenter.bitrise.io/tutorials/how-to-use-the-generic-file-storage/#uploading-files-to-generic-file-storage-on-bitriseio)
- You can use the second option if you have already already generated an IPA via the Expo CLI on your local machine.

## via Turtle CLI & Generic file Storage

“If you prefer to not rely on our builders stability and you don’t like waiting in the queue to get your standalone app build then you can build your Expo project on your own. The only thing you need is Turtle CLI. Turtle CLI is a command line interface for building Expo standalone apps. You can use it both on your CI and your private computer.”

### iOS

1. Prepare the following unless you’re building only for the iOS simulator:

2. Set the `EXPO_IOS_DIST_P12_PASSWORD` and the `EXPO_IOS_PUSH_P12_PASSWORD` environment variables with the values of the Distribution Certificate password and Push Notification Certificate password, respectively.\

3. 

```auto
$ turtle build:ios \
  --team-id YOUR_TEAM_ID \
  --dist-p12-path /path/to/your/dist/cert.p12 \
  --push-p12-path /path/to/your/push/cert.p12 \
  --provisioning-profile-path /path/to/your/provisioning/profile.mobileprovision
  

```

4. If the build finishes successfully, you will find the path to the build artifact in the last line of the logs.\

### Bitrise sample:

```auto
turtle_ipa:
    steps:
    - activate-ssh-key@4.0.3:
        run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
    - generic-file-storage@0.9.0: {}
    - git-clone: {}
    - npm@1.0.1:
        inputs:
        - command: install -g turtle-cli
        title: Install Turtle CLI
    - script@1.1.5:
        inputs:
        - content: |-
            #!/usr/bin/env bash
            set -e
            set -x

            turtle build:ios --team-id $APPLE_TEAM_ID --dist-p12-path $GENERIC_FILE_STORAGE/dist.p12 --push-p12-path $GENERIC_FILE_STORAGE/push.p12 --provisioning-profile-path $GENERIC_FILE_STORAGE/sample_Project_Expo_dist.mobileprovision
        title: Turtle Build iOS
    - deploy-to-bitrise-io: {}

```

* * *

## via Turtle CLI and Expo fetch

### iOS

If you already generated an IPA via the Expo CLI on your local machine, then you can fetch the code signing files for the Turtle CLI from the Expo server:

You can obtain these values from Expo servers by running `expo fetch:ios:certs` in your Expo project’s directory.

- `EXPO_APPLE_TEAM_ID` - Apple Team ID - (a 10-character string like “Q2DBWS92CA”)
- `EXPO_IOS_DIST_P12_BASE64` - **base64-encoded** iOS Distribution Certificate
- `EXPO_IOS_DIST_P12_PASSWORD` - iOS Distribution Certificate password
- `EXPO_IOS_PUSH_P12_BASE64` - **base64-encoded** iOS Push Notifications Certificate
- `EXPO_IOS_PUSH_P12_PASSWORD` - iOS Push Notifications Certificate password
- `EXPO_IOS_PROVISIONING_PROFILE_BASE64` - **base64-encoded** iOS Provisioning Profile

## Bitrise sample:

```auto
turtle_ipa_with_expo_fetch:
    steps:
    - activate-ssh-key@4.0.3:
        run_if: '{{getenv "SSH_RSA_PRIVATE_KEY" | ne ""}}'
    - git-clone: {}
    - npm@1.0.1:
        inputs:
        - command: install -g expo-cli
        title: Install Expo CLI
    - npm@1.0.1:
        inputs:
        - command: install
        title: Install node modules
    - script@1.1.5:
        title: Expo CLI login - Script
        inputs:
        - content: |-
            #!/usr/bin/env bash
            set -e
            set -x

            expo login --non-interactive -u $EXPO_USERNAME -p $EXPO_PASSWORD
    - script@1.1.5:
        title: Expo CLI iOS certs fetch
        inputs:
        - content: |-
            #!/usr/bin/env bash
            set -e
            set -x

            expo fetch:ios:certs
    - npm@1.0.1:
        inputs:
        - command: install -g turtle-cli
        title: Install Turtle CLI
    - script@1.1.5:
        inputs:
        - content: |-
            #!/usr/bin/env bash
            set -e
            set -x

            turtle build:ios --team-id $TEAM_ID --dist-p12-path ./sample-project-expo_dist.p12 --push-p12-path ./sample-project-expo_push.p12 --provisioning-profile-path ./sample-project-expo.mobileprovision
        title: Turtle Build iOS
    - deploy-to-bitrise-io: {}

```

---

_[View the full topic](https://discuss.bitrise.io/t/build-expo-apps-with-turtle-cli/7916)._
