开发者

How to force application Settings bundle get updated?

开发者 https://www.devze.com 2022-12-18 05:11 出处:网络
Application Settings.bundle contains a version number, which is automatically generated during build. From build log I can see that new value is written there, also when looking inside the file itself

Application Settings.bundle contains a version number, which is automatically generated during build. From build log I can see that new value is written there, also when looking inside the file itself in MacOS X Finder I see correct updated value.

Settings in iPhone simulator or in real iPhone shows me the old value. Removing application and reinstalling is so far the only way 开发者_Go百科I've managed to get the new updated value visible.

Question: how can I force iPhone Settings application to read my new latest updated bundle file?

Some background info, which might or might not be related: I install application only via Xcode into both simulator and iPhone. Is this the problem? Just found this in Apple docs, not sure what it actually says. Seems to contradict itself (last chapter)...

Each time you reinstall your application, iPhone OS performs a clean install, which deletes any previous preferences. In other words, building or running your application from Xcode always installs a new version, replacing any old contents. To test preference changes between successive executions, you must run your application directly from the simulator interface and not from Xcode.

So Xcode always replaces old content, but to test changes I cannot use Xcode? What was that? Done both (after installation via Xcode) and didn't see new values in settings. Any ideas how does it actually work? Do I always have to make non-Xcode installation?


Try cleaning and building. It seems that xcode caches dates and doesn't notice the change that your script is making. I've had similar things happen, clean always fixes it, but it is indeed a nuisance.


Make sure to shut down the Settings app running in the background on device. It looks like Settings caches settings while it's running - but pulls the updated values when the Settings app is re-launched.


In my case, it seems that my modified root.plist, created/edited via the Xcode property list editor, just wasn't being saved.

There was no problem at all with the Settings Bundle being copied over to the iPad. A quick cmd-S followed by a rebuild and go/debug updated Settings on the iPad straight away - no app uninstall/reinstall even needed. You'd think there'd at least be a haven't-saved-it warning from Xcode, as there always is for code source files.


I just tried this and it worked. In Xcode go to : Window->Organizer, then view installed apps on the connected iPad/iPhone, remove the app, then recompile and run your app on the device. I think the issue has something to do with the iPad's cache.

0

精彩评论

暂无评论...
验证码 换一张
取 消