I have an application that I can't modify (although I have the source code) that uses values from the user default's system ([NSUserDefaults standardUserDefaults]) to configure some settings from the app.
I'm trying to create a command line script that builds the app with xcodebuild, and then launches the app directly into the iPhone simulator or a device. I'd like to be able to modify a value of the "user default's system" so when I lunch the app in either the iPhone simulator or an iPhone device, it'll start with the configuration that I want. How can I do that?
Things I've tried:
xcrun simctl spawn
<
simulator-device-id>
defaults read but the settings from my app doesn't appear there.Modifying ~/Library/Developer/CoreSimulator/Devices//data/Containers/Data/Application/
<
app-id>
/Library/Preferences/<
app-name>
.plist with /usr/libexec/PlistBuddy: This one seems to work partially, but I only can find this folder after I've run the app for the first time, and I haven't find any easy way to know what's the app-id of my app from my command line before actually running the app in the iphone simulator. Ideally, I'd like my app to run for the first time with the settings that I want to use, if I use the PlistBuddy options it seems I'll have to run it once to find the folder, and a second time to actually set the setting before running it.
Is there any easy way to accomplish this?