ioscrashios9crash-reportsdsym

can't find tool named 'otool' in the macosx SDK or any fallback SDKs at ./symbolicatecrash line 115


I tried to analyse crash iOS app crash logs given by Apple store by using symbolicatecrash ~~~.crash and dSYM file. However, when I tried to make crash.log, I got the following error. Could you tell me how to solve the problem?

$ ./symbolicatecrash ~~~.crash ~~~.dSYM > crash.log

sh: ”/Applications/Xcode.app/Contents/Developer”/usr/bin/xcrun: No such file or directory
Error: can't find tool named 'otool' in the macosx SDK or any fallback SDKs at ./symbolicatecrash line 115.

The following is symbolicatecrash file

#symbolicatecrash
sub getToolPath {
    my ($toolName, $sdkGuess) = @_;

    if (!defined($sdkGuess)) {
        $sdkGuess = "macosx";
    }

    my $toolPath = `'$DEVELOPER_DIR/usr/bin/xcrun' -sdk $sdkGuess -find $toolName`;
    if (!defined($toolPath) || $? != 0) {
        if ($sdkGuess eq "macosx") {
            die "Error: can't find tool named '$toolName' in the $sdkGuess SDK or any fallback SDKs"; <------ This line is line115
        } elsif ($sdkGuess eq "iphoneos") {
            print STDERR "## Warning: can't find tool named '$toolName' in iOS SDK, falling back to searching the Mac OS X SDK\n";
            return getToolPath($toolName, "macosx");
        } else {
            print STDERR "## Warning: can't find tool named '$toolName' in the $sdkGuess SDK, falling back to searching the iOS SDK\n";
            return getToolPath($toolName, "iphoneos");
        }
    }

    chomp $toolPath;
    print STDERR "$toolName path is '$toolPath'\n" if $opt{v};

    return $toolPath;
}

Solution

  • I've tried the same operation by bash( before I used zsh), then have gone well. It seems that the problem is cause from the setting of .zshrc.