#1 27 Feb 2020 21:50

anchormansam
Member
Registered: 27 Feb 2020
Posts: 3

default read help

Hey Guys trying to get the CFBundleVersion from an Xcode Build's .plist via terminal.

 defaults read <Filepath/Info>

output is

{
    ApplicationProperties =     {
        ApplicationPath = "Applications/Name.app";
        CFBundleIdentifier = "com.name.Name";
        CFBundleShortVersionString = "4.2.16";
        CFBundleVersion = "4.2.16";
        SigningIdentity = "";
        Team = "";
    };
    ArchiveVersion = 2;
    CreationDate = "2020-02-27 15:00:31 +0000";
    Name = PT;
    SchemeName = PT;
}

If I run

defaults read <Filepath/Info> ApplicationProperties

output

{
        ApplicationPath = "Applications/Name.app";
        CFBundleIdentifier = "com.name.Name";
        CFBundleShortVersionString = "4.2.16";
        CFBundleVersion = "4.2.16";
        SigningIdentity = "";
        Team = "";
    };


I have tried to do defaults read <Filepath/Info> ApplicationProperties.CFBundleVersion but get this error:

The domain/default pair of (Filepath/Info, ApplicationProperties.CFBundleVersion) does not exist

but I can access the actual CFBundleVersion

any help?

Offline

#2 27 Feb 2020 23:19

Simon Sheppard
Super Administrator
Registered: 27 Aug 2005
Posts: 1,069
Website

Re: default read help

The defaults command can read any plist file with a path minus the .plist extension

e.g.
$ defaults read /Applications/Burn.app/Contents/Info CFBundleIdentifier
com.kiwifruitware.Burn

$ defaults read /Applications/Burn.app/Contents/Info CFBundleVersion
22

Offline

#3 28 Feb 2020 14:37

anchormansam
Member
Registered: 27 Feb 2020
Posts: 3

Re: default read help

This is the error I got when I ran that command:

The domain/default pair of (FilePath/Info, CFBundleVersion) does not exist

Running on OSX Mojave 10.14.6

Offline

#4 28 Feb 2020 17:39

anchormansam
Member
Registered: 27 Feb 2020
Posts: 3

Re: default read help

Just updated to Catalina 10.15.3 but still getting the same error.

Offline

#5 29 Feb 2020 11:18

Simon Sheppard
Super Administrator
Registered: 27 Aug 2005
Posts: 1,069
Website

Re: default read help

Can you post the full command line you are using, are you sure the plist file is in the correct place? can you list it with ls?

The example I posted above is using burn.app so it wont work unless you have burn installed.

Offline

Board footer

Powered by FluxBB