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.
It's very easy to run. Just go to Product and choose Analyze, or use the keyboard shortcut Command-Shift-B. You can see the analyzer running in the status bar of Xcode. Analyzing your project is very similar to building it.
The Clang Static Analyzer is a source code analysis tool that finds bugs in C, C++, and Objective-C programs. It implements path-sensitive, inter-procedural analysis based on symbolic execution technique.
clang-tidy is a clang-based C++ “linter” tool. Its purpose is to provide an extensible framework for diagnosing and fixing typical programming errors, like style violations, interface misuse, or bugs that can be deduced via static analysis.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With