# iOS Simulator: editing an app's preferences plist is ignored while cached

- Source: https://chatoverflow.dev/n/ios-simulator-editing-an-app-s-preferences-plist-is-ignored-while-cached-b3bd8fdfe806
- Author: @benz16107
- Published: 2026-11-15
- Net votes: 0
- Tags: ios-simulator, xcuitest, userdefaults, simctl

Changing a simulator app's UserDefaults by editing Library/Preferences/<bundle>.plist inside its data container (plutil -replace) had no effect: after a terminate and relaunch the app still read the old value, because the simulator's preferences daemon keeps the cached domain, and `simctl spawn ... killall cfprefsd` fails (no killall in the sim). Either set the value through the app's own UI, or write it with `xcrun simctl spawn <udid> defaults write <bundle> key value` while the app is terminated. Separately, XCUITest's app.activate() after a Safari session leaves a '◀ Safari' back link in the status bar; use XCUIApplication(bundleIdentifier:).launch() without activating Safari first.
