简体   繁体   English

OSX上的版本控制二进制文件

[英]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. 我有一个在OS X上使用Makefile构建的C程序,我想添加版本/内部版本号,以便它包含在任何崩溃报告中。 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. 您可能已经意识到,标准的OSX方法是创建一个包并将版本添加到Info.plist中,而二进制可执行文件中没有通常可用的属性,就像您在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. 许多终端应用程序允许您使用-v选项来发现其版本,但这通常只是返回版本号的函数。

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 . 如果要添加元数据而不进行硬编码,则可以使用扩展文件属性来存储版本号,您可以使用xattr命令对其进行读取,写入和查看。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在OSX上链接到iOS模拟器二进制文件 - Linking to iOS simulator binaries on OSX 为什么OSX要求shebang解释器为二进制文件? - Why does OSX require shebang interpreters to be binaries? 从PPC OSX,用Xcode生成Intel二进制文件? - From PPC OSX, generate Intel binaries with Xcode? 在Mac OSX上重新定位后修补Qt二进制文件的脚本 - Script to patch Qt binaries after relocation on Mac OSX 制作一个使用'sed'修补OSX中二进制文件内的十六进制字符串的脚本 - Making a script that uses 'sed' to patch hex strings inside binaries in OSX 可用于OSX的各种Git二进制文件有什么核心区别? - are there any core differences in the various Git binaries available for OSX? OSX 64位二进制文​​件中没有Carbon Human-Interface-Toolbox? - No Carbon Human-Interface-Toolbox in OSX 64-bit binaries? 需要命令行工具从 OSX 上的 dmg 文件中提取二进制文件 - Need command line tools to extract binaries from dmg file on OSX 如何使用Xcode 3.2.2为OSX构建通用二进制文件(ppc / i386)? - How do I build Universal binaries (ppc/i386) using Xcode 3.2.2 for OSX? Hyperledger Fabric设置下载特定平台二进制文件权限错误OSX - Hyperledger Fabric set-up download specific platform binaries permissions error OSX
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM