简体   繁体   中英

Building iPhone Code using xcodebuild and running LLVM/Clang Static Analyzer

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.

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

=== 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.

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.

-- Michael

--

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

Finding Memory Leaks With The LLVM/Clang Static Analyzer

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.

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

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.

Good luck.

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

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).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM