(Expo) Issue with Detox Tests Failing on Bitrise (Works Locally) (appsimutils failed)

Hi everyone!
I’m actually new with Bitrise and I am experiencing an issue with my Detox tests that are failing when run on Bitrise.io, despite working correctly on my local machine. I’ve ensured that the environment settings, including engine versions, Xcode version, and simulators, are consistent between my local setup and the Bitrise workflow, but the issue persists.

  • Local Environment:
    Node 19.9,
    xcode 15.0.1,
    simulator iPhone 12 Pro Max (for Bitrise I actually used 14 Pro Max, cuz this simulator was listed on the description of xcode on Bitrise), iOS 16.4,
    macOS Sonoma 14.1.1 M1

  • Bitrise Workflow:
    Xcode 15.0 (Xcode 15.0 | Bitrise Stacks)
    macOS virtual machines (Apple Silicon) - M1 Medium
    simulator defined in .detoxrc as

    “simulator”: {
    “type”: “ios.simulator”,
    “device”: {
    “type”: “iPhone 14 Pro Max”,
    “os”: “iOS 16.4”
    }
    }

  • Error Message:

ChildProcessError: Command failed: applesimutils --byId 7E38606E-0033-48B6-A7B8-ED93F589F86F --bundle com.myaic.aicon --restartSB --setPermissions location=inuse,camera=YES
*** -[__NSPlaceholderArray initWithObjects:count:]: attempt to insert nil object from objects[5]. See “applesimutils --help” for usage.
applesimutils --byId 7E38606E-0033-48B6-A7B8-ED93F589F86F --bundle com.myaic.aicon --restartSB --setPermissions location=inuse,camera=YES (exited with error code 255)
at callback (node_modules/child-process-promise/lib/index.js:33:27)

Attempts to Resolve:

  • Double-checked .detoxrc and other configuration files for discrepancies.
  • Verified versions of dependencies and tools in both environments.
  • Reviewed full Bitrise logs for any additional clues or earlier indications of the root cause.

I am looking for guidance on how to resolve this issue. Specifically:

  • Are there known issues with Detox or applesimutils in the Bitrise environment that might be causing this?
  • Could there be differences in the Bitrise setup that I might have overlooked?
  • Any suggestions or best practices for running Detox tests on Bitrise that could help in this situation?

Best regards