2 Replies
      Latest reply on Mar 22, 2020 4:46 AM by DanilKorotenko
      DanilKorotenko Level 1 Level 1 (0 points)

        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.

        • Re: Command line tool version in crash report
          eskimo Apple Staff Apple Staff (13,905 points)

          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"