How do you get the equivalent of the Version: below for a file on OS X?
Seems like the result should be: 1.9.2.56 (BuildVersion: 1.9; BuildDate: Wed Nov 04 2015 01:13:06 ), Copyright 2009-2015 Adobe Systems Incorporated. All rights reserved.
The part I really care about in this case is 1.9.2.56
I’d be interested in how to get this info from the command line in general, and how this info is stored, but hopefully with relevance as well.
I’ve thought about this many times. The only thing I’ve figured would work is an analysis that captures needed binaries’ version output, munges the strings as needed, then saves in a result.
For non-bundle apps, like the one in the example, you’d want the command line dev tools installed (which shouldn’t require all of xcode). Then you can use otool to grab the data:
otool -P /Applications/Utilities/Adobe\ Application\ Manager/core/RemoveAAM |grep -A
1 CFBundleVersion
!!! This is exactly what I was looking for as far as getting this info on the command line.
Now hopefully I can figure out how to do the same with relevance, or an inspector added to do the same.
The otool -P option lists this in the help: -P print the info plist section as strings
There seems to be an embedded info plist section within the file itself where this data comes from.
###Get the plist info using otool
command:otool -P RemoteUpdateManager
Output:
RemoteUpdateManager:
(__TEXT,__info_plist) section
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleIdentifier</key>
<string>com.adobe.PDApp.Enterprise.RemoteUpdateManager</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>RemoteUpdateManager</string>
<key>CFBundlePackageType</key>
<string></string>
<key>CFBundleShortVersionString</key>
<string>1.9.2.56 (BuildVersion: 1.9; BuildDate: Wed Nov 04 2015 01:13:06 ), Copyright 2009-2015 Adobe Systems Incorporated. All rights reserved.</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.9.2.56 (BuildVersion: 1.9; BuildDate: Wed Nov 04 2015 01:13:06 ), Copyright 2009-2015 Adobe Systems Incorporated. All rights reserved.</string>
</dict>
</plist>
It seems like the hard part is getting the (__TEXT,__info_plist) section string, and then the plist inspectors should be able to do the rest from there, though I don’t know if they can work from strings instead of files like the XML inspectors can. Yet another need for XML inspectors on the Mac AND potentially improvements to the plist inspectors.
get the file section info for __info_plist using otool