简体   繁体   中英

Versioning Binaries on OSX

I have a C program that I build using Makefiles on OS X and I'd like to add the version/build number so that it is included in any crash reports. How can this be done without putting the binary as part of an app bundle?

As you may have realised, the standard OSX method is to create a bundle and add the version in the Info.plist and there isn't the usual attributes available within the binary executable, as you'd find in Windows.

Many terminal apps will allow you to discover their version with a -v option, but this is usuallly just a function returning the version number.

If you want to add meta data without hard coding it, you could use the extended file attributes to store the version number, which you can read, write and view with the xattr command .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM