Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 6 iOS Simulator does not remember app settings

I just installed Xcode 6.0.1 (coming from Xcode 5.1.1) and tried to run my iOS app on iPhone 6 simulator for the first time. It builds and runs, but I cannot change its settings. I use NSUserDefaults for my settings. Each time I change settings, go back to the list of settings and then select my app's settings again, they are set according to the default settings.

When I tried to figure out why this could happen I noticed that changing settings of the standard iOS app Maps does not work either. I cannot change the distance setting from miles to kilometers. This happens with fresh iOS Simulator settings (I "Reset Content and Settings" several times) when simulating iPhone 6 and iPhone 6 plus.

Any ideas?

like image 479
Dirk Avatar asked Sep 19 '14 11:09

Dirk


2 Answers

This is a known bug in iOS 8.0 in the simulator. The only workaround at this time is to set the preferences from the command line using the defaults command line tool.

defaults write ˜/Library/Developer/CoreSimulator/Devices/<UDID>/data/Containers/Data/Application/<App UUID>/Library/Preferences/...

You also need to find the relevant UDID.

like image 60
Jeremy Huddleston Sequoia Avatar answered Sep 30 '22 01:09

Jeremy Huddleston Sequoia


This appears to have been fixed in Xcode 6.1 so consider updating.

like image 27
Tiago Avatar answered Sep 30 '22 03:09

Tiago