Override info.plist value at runtime

I'm testing my user interface in light and dark mode settings and I have the "NSRequiresAquaSystemAppearance" set in my info.plist file and I was wondering if there is a way to override that setting at runtime, rather than having to constantly go to my info.plist and setting it manually between runs?

I'm searching for something like

NSApp.effectiveAppearance.setValue(true, forKey: "NSRequiresAquaSystemAppearance")
Answered by ForumsContributor in
Accepted Answer

You cannot do that. info.plist is part of bundle and cannot be changed at runtime.

See details here for instance:

https://stackoverflow.com/questions/40214673/setting-value-to-info-plist-file-from-swift?noredirect=1&lq=1

But why change the info.plist and not directly the appearance ?

https://developer.apple.com/documentation/appkit/nsappearancecustomization/choosing_a_specific_appearance_for_your_macos_app

Override info.plist value at runtime
 
 
Q