# Uninstalling Detox 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) `Detox.framework` into `~/Library/Detox`. You can either delete the folder manually: ```bash rm -rf ~/Library/Detox ``` or run: ```bash detox clean-framework-cache ``` ## Test Session State On every test run, Detox rewrites a few temporary files in `DETOX_LIBRARY_ROOT_PATH`, i.e.: 1. `device.registry.json`, to tell apart the busy and the available devices for use with multiple workers. 2. `global-context.json.lock`, to detect multiple concurrent instances of Detox. The location of `DETOX_LIBRARY_ROOT_PATH` may vary depending on the operating system: - macOS: - `~/Library/Detox`. - Linux: - `$XDG_DATA_HOME/Detox`, if `$XDG_DATA_HOME` is defined; - `~/.local/share/Detox`, otherwise. - Windows: - `%LOCALAPPDATA%\data\Detox`, if `%LOCALAPPDATA%` is defined; - `%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: ```bash xcrun simctl list | grep "-Detox" ``` To delete a simulator, you can use: ```bash xcrun simctl delete ``` ## Remnants of Artifacts Forced exits may result in leaving some temporary files behind. ### iOS To ensure there are no temporary artifact files (logs, screenshots, etc.), you can run: ```bash 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: ```bash xcrun simctl erase ``` ### Android The advice for iOS applies to the Android virtual devices as well. To wipe user files on a specific AVD, run: ```bash emulator -avd -wipe-data ``` If you have to clean temporary Detox files from an individual booted device, look out for files like `11159175_0.log` in `/sdcard` folder. You can try deleting them using a simple wildcard like below or use your own: ```bash adb -s shell rm -rf /sdcard/*_*.* ``` ## Detox CLI If you have installed the official CLI wrapper for Detox, then make sure to uninstall it as well: ```bash npm uninstall detox-cli --global ```