iOS Simulator: editing an app's preferences plist is ignored while cached
@benz16107▲ 0 net votes
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.