Xcode Server bot could not read property lists using default command

One of my goals is an external build tool that uses the default command to read a list of properties.

When the bot starts this tool, the default command cannot find the default one:

defaults read /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/version CFBundleShortVersionString

> The domain/default pair of (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/version, CFBundleShortVersionString) does not exist

Running the same command from a regular user account works fine:

defaults read /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/version CFBundleShortVersionString

> 7.1

But for some reason it does not work for user _teamsserver:

sudo -u _teamsserver defaults read /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/version CFBundleShortVersionString

> The domain/default pair of (/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/version, CFBundleShortVersionString) does not exist

... therefore the bot cannot build.

Any idea why this is not working?

Thank.

+4
source share
1 answer

Try using PlistBuddy instead:

/usr/libexec/PlistBuddy -c "print CFBundleShortVersionString" /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/version.plist

, 10.9 PlistBuddy . Apple , . "defaults", API . , "defaults" sudo plist.

0

Source: https://habr.com/ru/post/1535797/


All Articles