Detox "Failed to run application on the device" in CI
Detox found a device but could not get the app running on it: the binary path is wrong, the build was never produced, or install/launch failed on the device. The config binaryPath and the build step are the first things to check.
What this error means
The Detox run aborts early with "Failed to run application on the device" or "Cannot find app binary at path ...". No tests execute because the app never launched.
DetoxRuntimeError: Failed to run application on the device
HINT: Most likely, your app has crashed prematurely during launch.
Cannot boot the app, the app binary at .../Build/Products/Debug-iphonesimulator/app.app
does not exist.Common causes
The app binary was not built for this configuration
The detox build step did not run, or built a different configuration than binaryPath in .detoxrc points to, so there is nothing to install.
Install or launch failed on the device
An architecture mismatch or a crash on launch prevents the app from starting even though the binary exists.
How to fix it
Build before test and match binaryPath
- Run
detox build --configuration <cfg>in the job beforedetox test. - Confirm
binaryPathfor that configuration points at the produced.app/.apk. - Use the same configuration name for build and test.
detox build --configuration ios.sim.debug
detox test --configuration ios.sim.debug --cleanupVerify the binary exists at the configured path
Check .detoxrc.js apps[].binaryPath against the actual build output directory; a stale path is the most common cause.
apps: {
'ios.debug': {
type: 'ios.app',
binaryPath: 'ios/build/Build/Products/Debug-iphonesimulator/App.app',
},
}How to prevent it
- Always
detox buildbeforedetox testin CI. - Keep
binaryPathin sync with the build output directory. - Use one configuration name across build and test steps.