Skip to content

Simulator not lauching on CI workflow with ExpoΒ #4357

@brpinto

Description

@brpinto

Description

Hello there,

I am working on a mobile application with expo SDK 50, react-native@0.73.3 and I am using Detox for my e2e tests. It used to work well on Github Actions, but it seems that my action these days has trouble to find a simulator to run the tests.

NB: tests run perfectly locally, the issue occurs on CI only.

  DetoxRuntimeError: Failed to find a device by type = "iPhone 15 Pro Max"

    HINT: Run 'applesimutils --list' to list your supported devices. It is advised only to specify a device type, e.g., "iPhone XΚ€" and avoid explicit search by OS version.

I took a look to the react-native example on wix/detox repo to have an idea of the right configuration for my .detoxrc.js and ended to this chunk for iOS sim :

devices: {
  simulator: {
    type: 'ios.simulator',
    device: {
      type: 'iPhone 15 Pro Max',
      os: '17.2'
    },
  },
},

My yml file is as code below. I am not giving any configuration for the simulator, but I don't know if it's needed as long as I never saw something like that on Detox documentation or examples.

name: e2e-ios
on:
  push:
    branches:
      - main
      - 'SPA-**'
      - 'FEATURE-**'

jobs:
  e2e-ios:
    runs-on: macos-latest
    steps:
      - name: Checkout repository
        uses: actions/checkout@v3

      - name: Setup Node.js
        uses: actions/setup-node@v3

      - name: Install Yarn dependencies
        run: yarn --frozen-lockfile --prefer-offline

      - name: Install macOS dependencies
        run: |
          brew tap wix/brew
          brew install applesimutils
        env:
          HOMEBREW_NO_AUTO_UPDATE: 1
          HOMEBREW_NO_INSTALL_CLEANUP: 1

      - name: Setup Ruby
        uses: ruby/setup-ruby@v1
        with:
          ruby-version: 3.2
          bundler-cache: true

      - name: Expo pre-build
        run: npx expo prebuild -p ios

      - name: Install Detox
        run: |
          yarn global add detox-cli
          yarn add detox

      - name: Detox rebuild framework cache
        run: yarn detox rebuild-framework-cache

      # - name: Cache Detox build # needed ?
      #   id: cache-detox-build
      #   uses: actions/cache@v3
      #   with:
      #     path: ios/build # WARNING : right here ??
      #     key: ${{ runner.os }}-detox-build
      #     restore-keys: |
      #       ${{ runner.os }}-detox-build

      - name: Detox build
        run: MY_APP_MODE=mocked detox build -c ios.sim.release

      - name: Detox test
        run: MY_APP_MODE=mocked detox test -c ios.sim.release --cleanup

      - name: Upload artifacts # what are those ?
        if: failure()
        uses: actions/upload-artifact@v3
        with:
          name: detox-artifacts
          path: artifacts

Maybe I am missing something obvious here, but please tell me if you need more information or details about my code.

Thank your for your help, I'll be pleased to discuss further with you on this subject.

Your environment

Detox version: 20.13.5
React Native version: 0.73.3
Node version: 20.7.0
Device model: Macbook Air M1, 2020
OS: Sonoma 14.0
Test-runner (select one): jest

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions