【问题标题】:can't find tool named 'otool' in the macosx SDK or any fallback SDKs at ./symbolicatecrash line 115在 ./symbolicatecrash 第 115 行的 macosx SDK 或任何后备 SDK 中找不到名为“otool”的工具
【发布时间】:2016-01-26 07:44:43
【问题描述】:

我尝试使用 symbolicatecrash ~~~.crash 和 dSYM 文件分析 Apple 商店给出的崩溃 iOS 应用程序崩溃日志。 但是,当我尝试制作 crash.log 时,出现以下错误。你能告诉我如何解决这个问题吗?

$ ./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.

以下是符号崩溃文件

#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;
}

【问题讨论】:

    标签: ios crash ios9 crash-reports dsym


    【解决方案1】:

    1)

    在命令行输入:

    xcode-select --print-path

    如果显示/Application/Xcode.app/Contents/Developer的路径,则转到步骤2。如果没有,请使用“sudo xcode-select -s /path/to/your/Xcode/Contents/Developer”文件夹更改路径。

    2)

    尝试安装 Xcode 命令行工具,您可以在 http://developer.apple.com/xcode 站点的“其他工具”链接下获得。

    3)

    确保您的 .tcshrc / .bashrc "$PATH" 环境变量是正确的。在我的本地计算机中,“xcrun”位于“/usr/bin”中,otool 也位于“/usr/bin”中。

    【讨论】:

    • 谢谢迈克尔! 1) $ xcode-select --print-path ”/Applications/Xcode.app/Contents/Developer” 2) $ xcode-select --install xcode-select: error: 命令行工具已经安装,使用“软件更新”安装更新 3) $ which xcrun /usr/bin/xcrun $ which otool /usr/bin/otool 在这种情况下,我应该更新软件(Xcode)吗?
    • 可能不会受到伤害。到今天为止,我们已经升级到 Xcode 7.1。另外,请仔细查看错误。它正在寻找一个名为“$DEVELOPER_DIR”的环境变量。看起来它应该是空白/空的,就像它在我的机器上一样(然后你的“/usr/bin/otool”将正确解析以重新符号化)..
    • 顺便说一句,我已将 DEVELOPER_DIR 设置如下。导出 DEVELOPER_DIR="/Applications/Xcode.app/Contents/Developer"
    • 在你的symbolicatecrash 脚本中搞砸了这一行:my $toolPath = '$DEVELOPER_DIR/`。也许你应该修改你的脚本?
    • 我用bash(在我使用zsh之前)尝试过相同的操作,然后成功了!!!也许,.zshrc的PATH问题
    【解决方案2】:

    我已经尝试过 bash 的相同操作(在我使用 zsh 之前),然后运行良好。看来问题是由.zshrc的设置引起的。

    【讨论】:

    • 你能解释一下吗? 我用 bash 尝试过同样的操作(在我使用 zsh 之前), 我不明白你说你之前使用过 zsh..但是我该如何使用呢?
    • 感谢任何帮助让我知道
    猜你喜欢
    • 2019-12-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-01-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多