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

# Bitrise

> Jalankan tes end-to-end iOS dan Android di Bitrise dengan satu workflow e2e untuk setiap platform dalam sebuah pipeline, dan simpan laporannya sebagai artefak.

export const setupPrompt = `Tambahkan pipeline Bitrise yang menjalankan tes e2e proyek ini di iOS dan Android. Dokumentasi: \`https://e2e.com/docs/ci/bitrise.md\` dan \`https://e2e.com/docs/ci.md\`

1. Baca kedua halaman.
2. Tambahkan workflow ke \`bitrise.yml\`. Sesuaikan jalur proyek, scheme, stack, dan versi Node dengan proyek ini.
3. Minta saya menambahkan kunci model di bawah Secrets pada editor workflow Bitrise.
4. Setelah saya memulai build, baca log build dan perbaiki error sampai kedua workflow berhasil.`;

Penyiapan ini menjalankan satu workflow untuk setiap platform dalam satu
pipeline, mengikuti aturan di [Job mobile](https://e2e.com/docs/id/ci#mobile-jobs).

<SetupPrompt>

<Prompt description={setupPrompt} children={setupPrompt} actions={["copy", "cursor"]} />

</SetupPrompt>

## Workflow

Step Bitrise menjalankan perangkat: `xcode-start-simulator` di macOS, dan
`avd-manager` dengan `wait-for-android-emulator` di Linux. Workflow Android
memulai emulator sebelum build Gradle, sehingga emulator menyala selagi APK
dikompilasi. APK rilis harus ditandatangani; template React Native dan Expo
menandatanganinya dengan debug keystore.

```yaml title="bitrise.yml" expandable
format_version: '25'
default_step_lib_source: https://github.com/bitrise-io/bitrise-steplib.git

tools:
  nodejs: 24:latest

pipelines:
  e2e:
    triggers:
      push:
      - branch: main
      pull_request:
      - target_branch: main
    workflows:
      e2e-ios: {}
      e2e-android: {}

workflows:
  e2e-ios:
    meta:
      bitrise.io:
        stack: osx-xcode-26.6.x
    steps:
    - git-clone@8: {}
    - script@1:
        title: Install dependencies
        inputs:
        - content: |-
            #!/usr/bin/env bash
            set -euo pipefail
            npm ci
            cd ios && pod install
    - xcode-build-for-simulator@3:
        inputs:
        - project_path: ios/MyApp.xcworkspace
        - scheme: MyApp
        - configuration: Release
    - xcode-start-simulator@0:
        inputs:
        - destination: platform=iOS Simulator,name=iPhone 17,OS=26.5
    - script@1:
        title: Run e2e
        inputs:
        - content: |-
            #!/usr/bin/env bash
            set -euo pipefail
            xcrun simctl install booted "$BITRISE_APP_DIR_PATH"
            npx e2e run --target ios --reporter list,junit
    - script@1:
        title: Package the e2e output
        is_always_run: true
        inputs:
        - content: |-
            #!/usr/bin/env bash
            if [ -d .e2e ]; then (cd .e2e && zip -qr "$BITRISE_DEPLOY_DIR/e2e-ios.zip" .); fi
    - custom-test-results-export@1:
        inputs:
        - test_name: e2e-ios
        - base_path: $BITRISE_SOURCE_DIR/.e2e/junit.xml
        - search_pattern: '*'
    - deploy-to-bitrise-io@2: {}

  e2e-android:
    meta:
      bitrise.io:
        stack: ubuntu-noble-24.04-bitrise-2025-android
    steps:
    - git-clone@8: {}
    - script@1:
        title: Install dependencies
        inputs:
        - content: npm ci
    - avd-manager@2:
        inputs:
        - api_level: 35
        - tag: google_apis
        - abi: x86_64
    - android-build@1:
        inputs:
        - project_location: $BITRISE_SOURCE_DIR/android
        - module: app
        - variant: release
        - build_type: apk
    - wait-for-android-emulator@1: {}
    - script@1:
        title: Run e2e
        inputs:
        - content: |-
            #!/usr/bin/env bash
            set -euo pipefail
            adb install -r "$BITRISE_APK_PATH"
            npx e2e run --target android --reporter list,junit
    - script@1:
        title: Package the e2e output
        is_always_run: true
        inputs:
        - content: |-
            #!/usr/bin/env bash
            if [ -d .e2e ]; then (cd .e2e && zip -qr "$BITRISE_DEPLOY_DIR/e2e-android.zip" .); fi
    - custom-test-results-export@1:
        inputs:
        - test_name: e2e-android
        - base_path: $BITRISE_SOURCE_DIR/.e2e/junit.xml
        - search_pattern: '*'
    - deploy-to-bitrise-io@2: {}
```

## Artefak dan laporan tes

`deploy-to-bitrise-io` hanya mengunggah tingkat teratas `$BITRISE_DEPLOY_DIR`,
sehingga setiap workflow men-zip `.e2e/` ke direktori itu.
`custom-test-results-export` mengirim `junit.xml` ke tab Test Reports. Step-step
ini juga berjalan setelah sebuah step gagal.

## Kunci model

Tambahkan kunci model di bawah Secrets pada editor workflow aplikasi. Build
pull request mendapatkannya hanya ketika **Expose for Pull Requests** aktif,
dan build aplikasi publik tidak pernah mendapatkannya. Tanpa kunci, tes
deterministik tetap berjalan, tetapi penilaian agent dan langkah `agent.act`
yang belum direkam gagal. Lihat [Kredensial model](https://e2e.com/docs/id/ci#model-credentials).

## Selanjutnya

<CardGroup cols={2}>
  <Card title="Integrasi berkelanjutan" icon="rotate" href="/ci">
    Bawaan CI, sharding, eksekusi ulang, dan exit code.
  </Card>
  <Card title="Perangkat cloud" icon="cloud" href="/mobile#hosted-devices">
    Sewa perangkat dari sebuah layanan. Dengan begitu runner tidak menjalankan perangkat apa pun.
  </Card>
</CardGroup>
