Command line tool version in crash report

I wrote a C++ command-line tool by using XCode.

My tool crashes sometimes, with a crash report being generated.

How can I include Version of my command-line tool in crash report?

Now the Version is always 0.

Answered by DTS Engineer in 410991022

You may be able to get the version number populated by adding an

Info.plist
to your command-line tool. See the Create Info.plist Section in Binary (
CREATE_INFOPLIST_SECTION_IN_BINARY
) build setting.

This above is a good idea in general, but it’s not how I’d solve this particular problem. Rather, you should keep a table that maps between your version numbers and the main executable’s Mach-O UUID. That UUID is included in the crash report, so you can just look up the version from there.

This has a couple of benefits:

  • The UUID identifies a specific build, whereas the version number tends to get tangled up with marketing concerns.

  • The UUID also ties the executable to its

    .dSYM
    file.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"
Accepted Answer

You may be able to get the version number populated by adding an

Info.plist
to your command-line tool. See the Create Info.plist Section in Binary (
CREATE_INFOPLIST_SECTION_IN_BINARY
) build setting.

This above is a good idea in general, but it’s not how I’d solve this particular problem. Rather, you should keep a table that maps between your version numbers and the main executable’s Mach-O UUID. That UUID is included in the crash report, so you can just look up the version from there.

This has a couple of benefits:

  • The UUID identifies a specific build, whereas the version number tends to get tangled up with marketing concerns.

  • The UUID also ties the executable to its

    .dSYM
    file.

Share and Enjoy

Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Thank You very much 🙂

Command line tool version in crash report
 
 
Q