Installing and using Detox implies certain side effects: cloned devices, cache files, state files, temporary files, etc.
This checklist might come in handy whenever you have to make a clean uninstallation after using Detox.
Detox Framework Cache
Every install of Detox also triggers a
postinstall script in its
package.json, which builds (or unpacks)
You can either delete the folder manually:
rm -rf ~/Library/Detox
Test Session State
On every test run, Detox rewrites a few temporary files in
- The respective iOS and Android lockfiles to tell apart the busy and the available devices for use with multiple workers:
- A plain text file with the line-separated list of last failed test files to rerun via
-R <retries-count>CLI feature:
The location of
DETOX_LIBRARY_ROOT_PATH may vary depending on the operating system:
%USERPROFILE%\Application Data\Detox, otherwise.
Cloned Simulators (macOS)
To support the "multiple workers" feature on iOS, Detox clones simulator instances when there aren’t enough available ones.
The autogenerated simulators have names with
-Detox suffix appended, so you can easily spot them with:
xcrun simctl list | grep "-Detox"
To delete a simulator, you can use:
xcrun simctl delete <uuid>
Remnants of Artifacts
Forced exits may result in leaving some temporary files behind.
To ensure there are no temporary artifact files (logs, screenshots, etc.), you can run:
rm -rf $TMPDIR/*.detox.*
If you wish to clean up your iOS simulators from the installed apps and other customizations, just run the erase procedure for the relevant ones:
xcrun simctl erase <uuid>
The advice for iOS applies to the Android virtual devices as well. To wipe user files on a specific AVD, run:
emulator -avd <your_AVD> -wipe-data
If you have to clean temporary Detox files from an individual booted device, look out for files like
You can try deleting them using a simple wildcard like below or use your own:
adb -s <emulator-port> shell rm -rf /sdcard/*_*.*
If you have installed the official CLI wrapper for Detox, then make sure to uninstall it as well:
npm uninstall detox-cli --global
yarn global remove detox-cli