简体   繁体   中英

Get the UUID that the dSYM have when archive in runtime for the application

Is there any way to get the UUID the dSYM file has from the application in runtime?

I tried with a sample code I found but it returns a different UUID than the dSYM's one.

Thank you.

dwarfdump -u <PathToYourAppsDsym>

这将显示相​​应dsym的相关UUID

If you need to know the UUID associated with your iOS application there's a neat trick you can do to get it:

$> mdls -name com_apple_xcode_dsym_uuids -raw "$APP_NAME.app.dSYM" | grep -e \" | sed 's/[ |\"]//g'

What this does is query the Spotlight metadata for the UUID key for your application, you're passing in the .dSYM because that's where it is associated with.

The grep command is there to only consider the line with the actual UUID; the sed command cleans whitespace and quotation marks.

I used this because I need to upload .xcarchive directories to a server, this server does not store any Spotlight metadata so I need to put it there explicitly. This is all done in the context of associating crash logs with specific versions of a binary.

Note: Replace $APP_NAME with the name of your application.

To get the build UUID of the application check this answer of my older post. How to get the build UUID in runtime and the image base address

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