使用xcodebuild构建iPhone代码并运行LLVM / Clang静态分析器

时间:2022-08-19 02:24:11

I followed the steps in Finding memory leaks with the LLVM/Clang Static Analyzer but I was unable to run static analyzer on my project.

我按照LLVM / Clang静态分析器查找内存泄漏的步骤,但我无法在我的项目上运行静态分析器。

When I try to run xcodebuild on my project (1. Open Terminal, 2. Go to Project Directly, 3. > xcodebuild), I get this error:

当我尝试在我的项目上运行xcodebuild时(1.打开终端,2。直接转到Project,3。> xcodebuild),我收到此错误:

=== BUILDING NATIVE TARGET XProject OF PROJECT XProject WITH THE DEFAULT
CONFIGURATION (Release) ===

Checking Dependencies... CodeSign
error: no certificate found in
keychain for code signing identity
'iPhone Developer'

\** BUILD FAILED \**

How can I run this tool on my code? - I'm testing with simulator. Thanks.

如何在我的代码上运行此工具? - 我正在用模拟器测试。谢谢。

4 个解决方案

#1


1  

I'm the author of the blog post that you reference in your question. If codelogic's comments are not enough to point you in the right direction you can wait until a bit later today and I will update the blog post with some more information about running xcodebuild against iPhone projects.

我是您在问题中引用的博客文章的作者。如果codelogic的评论不足以指出你正确的方向,你可以等到今天稍晚,我将更新博客文章,其中包含有关针对iPhone项目运行xcodebuild的更多信息。

-- Michael

- 迈克尔

--

-

Alright, I've updated the post with a section titled iPhone Usage. Hope this helps!

好吧,我已经用标题为iPhone Usage的部分更新了帖子。希望这可以帮助!

Finding Memory Leaks With The LLVM/Clang Static Analyzer

使用LLVM / Clang静态分析器查找内存泄漏

#2


0  

I haven't used the tool in question but the issue you're seeing appears to be a bothced xcodebuild command. Ensure that your target is the Simulator and not the device (-target command line argument).

我没有使用过该问题的工具,但您看到的问题似乎是一个双重xcodebuild命令。确保您的目标是模拟器而不是设备(-target命令行参数)。

#3


0  

It can be tricky to set the base sdk. I like this approach:

设置基本sdk可能很棘手。我喜欢这种方法:

使用xcodebuild构建iPhone代码并运行LLVM / Clang静态分析器

I would have sworn that I had already set the sdk via the more traditional 'Build' tab, but hey... The 'Build' tab approach failed me (who know what I did wrong), but this worked great.

我会发誓我已经通过更传统的“Build”选项卡设置了sdk,但是嘿......“Build”选项卡方法让我失望(谁知道我做错了什么),但这很有用。

Good luck.

祝你好运。

[Edit - I just visited the link posted in the Question - which repeats, but does not emphasize, what I'm claiming here.]

[编辑 - 我刚刚访问了问题中发布的链接 - 重复,但没有强调,我在这里声称的内容。]

#4


0  

It looks strange but I've switched active Configuration to Debug EVERYWHERE but still got same error (like Release is active). Xcode 3.1.3 version.

I was able to fix problem just after removing Release configuration at all from active target.

它看起来很奇怪,但我已将活动配置切换到调试,但仍然出现相同的错误(如发布处于活动状态)。 Xcode 3.1.3版本。刚从活动目标中删除Release配置后,我就能解决问题。

使用xcodebuild构建iPhone代码并运行LLVM / Clang静态分析器

#1


1  

I'm the author of the blog post that you reference in your question. If codelogic's comments are not enough to point you in the right direction you can wait until a bit later today and I will update the blog post with some more information about running xcodebuild against iPhone projects.

我是您在问题中引用的博客文章的作者。如果codelogic的评论不足以指出你正确的方向,你可以等到今天稍晚,我将更新博客文章,其中包含有关针对iPhone项目运行xcodebuild的更多信息。

-- Michael

- 迈克尔

--

-

Alright, I've updated the post with a section titled iPhone Usage. Hope this helps!

好吧,我已经用标题为iPhone Usage的部分更新了帖子。希望这可以帮助!

Finding Memory Leaks With The LLVM/Clang Static Analyzer

使用LLVM / Clang静态分析器查找内存泄漏

#2


0  

I haven't used the tool in question but the issue you're seeing appears to be a bothced xcodebuild command. Ensure that your target is the Simulator and not the device (-target command line argument).

我没有使用过该问题的工具,但您看到的问题似乎是一个双重xcodebuild命令。确保您的目标是模拟器而不是设备(-target命令行参数)。

#3


0  

It can be tricky to set the base sdk. I like this approach:

设置基本sdk可能很棘手。我喜欢这种方法:

使用xcodebuild构建iPhone代码并运行LLVM / Clang静态分析器

I would have sworn that I had already set the sdk via the more traditional 'Build' tab, but hey... The 'Build' tab approach failed me (who know what I did wrong), but this worked great.

我会发誓我已经通过更传统的“Build”选项卡设置了sdk,但是嘿......“Build”选项卡方法让我失望(谁知道我做错了什么),但这很有用。

Good luck.

祝你好运。

[Edit - I just visited the link posted in the Question - which repeats, but does not emphasize, what I'm claiming here.]

[编辑 - 我刚刚访问了问题中发布的链接 - 重复,但没有强调,我在这里声称的内容。]

#4


0  

It looks strange but I've switched active Configuration to Debug EVERYWHERE but still got same error (like Release is active). Xcode 3.1.3 version.

I was able to fix problem just after removing Release configuration at all from active target.

它看起来很奇怪,但我已将活动配置切换到调试,但仍然出现相同的错误(如发布处于活动状态)。 Xcode 3.1.3版本。刚从活动目标中删除Release配置后,我就能解决问题。

使用xcodebuild构建iPhone代码并运行LLVM / Clang静态分析器