设置“Clang” Xcode 3.2.4 中的 Iphone 开发:bash 命令的问题
我想在我的应用程序上进行一些内存泄漏跟踪,但不知何故,我无法运行 Clang Static Analyzer,因为在使用终端执行它时,我总是收到一条错误消息,指出“命令未找到”。
我的 Mac 上没有“.bash_profile”文件,所以我创建了一个。有什么遗漏吗?
I wanted to do some Memory-Leak tracking on my App, but somehow I am not able to run Clang Static Analyzer because I always get an error message saying "command not found" when executing it with the terminal.
There was no ".bash_profile" file on my mac, so I created one. Is there anything missing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用您的新配置文件,系统现在正在查找
scan-build
,但scan-build
无法在找不到perl
的情况下运行。您的PATH
变量阻止系统查找perl
和xcodebuild
。如果您想将 /Users/Kay/bin/clang 添加到您的路径中,请在您的个人资料中执行此操作:这会将该路径附加到预先存在的搜索列表中。
Xcode 可以为您运行静态分析器。打开项目构建设置,搜索“分析器”,然后选中“运行 Clang 静态分析器”旁边的复选框。结果由 Xcode 呈现在“详细信息”选项卡中并作为项目源代码上的注释。
另请注意,Clang 静态分析器正是:静态分析器。它不会观察应用程序的动态运行时行为。为此,您应该使用 Instruments:在 Xcode 中,转到 Run > >使用性能工具运行>泄漏。
With your new profile, the system is now finding
scan-build
, butscan-build
cannot run without being able to findperl
. YourPATH
variable is preventing the system from findingperl
andxcodebuild
. If you want to add /Users/Kay/bin/clang to your path, do this in your profile instead:This will append that path to the pre-existing search list.
Xcode can run the static analyzer for you. Open the project build settings, search for "analyzer", then check the checkbox next to "Run Clang static analyzer." The results are presented by Xcode both in the Details tab and as annotations on your project source code.
Also, note that the Clang static analyzer is exactly that: a static analyzer. It will not observe the dynamic, runtime behavior of your application. For that, you should use Instruments: within Xcode, go to Run > Run with Performance Tool > Leaks.