Editing (augmenting) info.plist

[quote=203397:@Jason King]Ok, for anyone else who may need this, the following works properly:

Dim App As String = CurrentBuildLocation + "/" + CurrentBuildAppName call DoShellCommand("/usr/libexec/PlistBuddy -c ""Add :UIRequiredDeviceCapabilities:0 string gamekit"" " + App + "/Info.plist" )[/quote]
Shouldn’t that be App + “/Contents/Info.plist” ?

For OSX yes. But iOS doesn’t have a contents folder inside of the bundle to organize everything so it’s not needed here.

[quote=203397:@Jason King]Ok, for anyone else who may need this, the following works properly:

Dim App As String = CurrentBuildLocation + "/" + CurrentBuildAppName call DoShellCommand("/usr/libexec/PlistBuddy -c ""Add :UIRequiredDeviceCapabilities:0 string gamekit"" " + App + "/Info.plist" )[/quote]

Well, it appears it no longer works :frowning:

I created a script with exactly the above, placed it after the build, info.plist is not modified.

For the time being, I have extracted info.plist from a debug build, and from a build, and will use a copyfile to place the modified versions in the bundle.

I was using the information in this thread to try to make my own mods to my app’s plist file, and discovered a couple of gotchas along the way which may possibly be of interest to others following in the same footsteps:

(1) My app’s name had spaces in it, and looking at the Xojo build step command, whilst CurrentBuildLocation produces an escaped path, it looks as though CurrentBuildAppName is not escaped. So I had to do it myself, with the crude but seems to work addition of

CurrentBuildAppName.ReplaceAll( " ", "\ " )

(2) As pointed out above, if using this on OSX, don’t forget to add the Contents folder to your path.

(3) I had to add in the “.app” extension to the path

Putting these together with the example GameKit command above, I found this worked for me (on OSX):

Dim App As String = CurrentBuildLocation + “/” + CurrentBuildAppName.ReplaceAll( " ", "\ " )

call DoShellCommand("/usr/libexec/PlistBuddy -c ““Add :UIRequiredDeviceCapabilities:0 string gamekit”” " + App + “.app/Contents/Info.plist” )