Strange errors when attempting to Symbolicate iOS crash report

你说的曾经没有我的故事 提交于 2021-02-19 06:06:45

问题


I received a crash report from Apple, and followed these instructions to symbolicate it: How to symbolicate crash report from Apple received in .txt format not .crash format

Unfortunately, I see errors when I execute step 7 ("./symbolicatecrash ..."), and don't find an SO question that addresses them:

xcodebuild: error: SDK "xxxos" cannot be located.
xcrun: error: unable to find utility "otool", not a developer tool or in PATH
## Warning: can't find tool named 'otool' in the xxxos SDK, falling back to searching the iOS SDK
xcodebuild: error: SDK "xxxos" cannot be located.
xcrun: error: unable to find utility "atos", not a developer tool or in PATH
## Warning: can't find tool named 'atos' in the xxxos SDK, falling back to searching the iOS SDK
xcodebuild: error: SDK "xxxos" cannot be located.
xcrun: error: unable to find utility "symbols", not a developer tool or in PATH
## Warning: can't find tool named 'symbols' in the xxxos SDK, falling back to searching the iOS SDK
xcodebuild: error: SDK "xxxos" cannot be located.
xcrun: error: unable to find utility "size", not a developer tool or in PATH
## Warning: can't find tool named 'size' in the xxxos SDK, falling back to searching the iOS SDK
No symbolic information found

Notes:

  • I'm running Xcode 9.2
  • I also tried copying otool, atos, symbols and size tools from /usr/bin into the same directory but still got the same errors
  • I can run all of those tools directly from the command line successfully
  • I suspect the problem is with the symbolicatecrash function "parse_SDKGuess" but I really can't go much further than that...

Any idea what's going on and how to fix it? Thanks!

Added the parse_SDKGuess function in the symbolicatecrash script for reference:

sub parse_SDKGuess {
    my ($log_ref) = @_;

    # It turns out that most SDKs are named "lowercased(HardwareModelWithoutNumbers) + os",
    # so attempt to form a valid SDK name from that. Any code that uses this must NOT rely
    # on this guess being accurate and should fallback to whatever logic makes sense for the situation
    my $model = parse_HardwareModel($log_ref);
    $model or return undef;

    $model =~ /(\D+)\d/;
    $1 or return undef;

    my $sdk = lc($1) . "os";
    if($sdk eq "ipodos" || $sdk eq "ipados") {
        $sdk = "iphoneos";
    }
    if ( $sdk =~ /mac/) {
        $sdk = "macosx";
    }

    return $sdk;
}

It seems that "lc($1)" evaluates to "xxx"...


回答1:


SDK "xxxos" cannot be located

You can probably ignore those errors. The reason of those errors is that the crash report from Apple contains the following in the crash report:

Hardware Model:      xxx1

(instead of for example iPhone10,5). Apple probably masks the hardware model. They might be using a special hardware for testing.

As the warnings show xxxos SDK is not found and it falls back to iOS.

No symbolic information found

I guess this is an unrelated issue to the xxxos errors.

What worked for me was downloading dSYMs from Apple. Go to Xcode > Organizer, in the Archives tab (the default) select your App and the version that corresponds to your crash report and click on the "Download dSYMs..." button.

After the dSYMs are downloaded, re-run the symbolicatecrash command:

./symbolicatecrash mycrash.crash > symbolicated.crash

I guess the problem is that when you enable bitcode, Apple is rebuilding the application and then the generated dSYMs in xcarchive do not match the crash report.

And even then all calls from my code were symbolicated properly, but calls in system frameworks (e.g. UIKit) were not symbolicated.



来源:https://stackoverflow.com/questions/49676044/strange-errors-when-attempting-to-symbolicate-ios-crash-report

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!