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?
With your new profile, the system is now finding
scan-build, butscan-buildcannot run without being able to findperl. YourPATHvariable is preventing the system from findingperlandxcodebuild. 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.