I have a CLI executable(running in root context).It's sole purpose is to writeUserDefaults and read UserDefaults, and its working fine as it supposed to but I am unable to find the plist file created/modified by this process. I tried running same process in user context and was able to find the plist file created by it in ~/Library/Preference/ServiceCheckOne.plist
UserDefaults.init(suiteName: 'ServiceCheckOne')?.set(100, forKey: 'check1')
let value = UserDefaults.init(suiteName: suiteName)?.integer(forKey: key)!
After using this functions i am getting value = 100
I searched for plist from all the locations mentioned in these answer and the build
Where is a Mac Application's NSUserDefaults Data Stored?
locate command didn't help either.
I checked recently modified files still not able to find file.
In short
Need help locating the ServiceCheckOne.plist file when u userDefaults.set is used by root process.\
Or am I getting value back because of caching of defaults and file actually didn't exist? Thank you Xcode 12.3 MacOs 10.15 Tried defaults read | grep ServiceCheckOne got no hits here too