Skip to content
Latchkey

Detox "The app has crashed" during a test in CI

The application process exited unexpectedly while the test was running. Detox detects the lost connection and reports "The app has crashed". The cause is a native or JS crash in the app itself, visible in the device logs Detox captures.

What this error means

A test fails with "The app has crashed, see the logs for details" or "Detox can't seem to connect to the test app". Screens that worked a moment earlier suddenly become unreachable.

Detox
DetoxRuntimeError: The app has crashed, see the logs for details.
> Fatal Exception: NSInvalidArgumentException
> unrecognized selector sent to instance

Common causes

A native or JavaScript crash in the app

An unhandled exception, a null native call, or a release-only crash terminates the process, which Detox reports as a crash.

A memory-starved CI device kills the app

A low-memory CI emulator or simulator can have the OS terminate the app, which looks like a crash to Detox.

How to fix it

Read the captured device log

  1. Open the Detox artifacts / device log to find the crash stack.
  2. Fix the native or JS exception it names.
  3. Re-run the test against the fixed build.
Terminal
detox test --configuration ios.sim.debug --record-logs all

Give the device enough resources

Use an emulator/simulator profile with adequate memory so the OS does not kill the app under test on a constrained runner.

How to prevent it

  • Record device logs so crashes are diagnosable from CI artifacts.
  • Reproduce release-config crashes locally before they reach CI.
  • Provision adequate memory for the emulator/simulator profile.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →