简体   繁体   中英

How to get this Apple Script for Clang Static Analyzer working with Xcode?

Here's a script where lots of people say it's good:

http://allancraig.net/blog/?p=381

But I can't get it to work. What are the steps I have to do with the Xcode script editor, to run that script?

I have pasted it in "Script Editor.app", that Script Editor app from Mac OSx and saved it as clang.scpt .

Then, I went to Xcode and opened the Script Editor, created a new script with this settings:

Input = Selection (??) Directory = Selection (??)

Script Code:

#!/bin/sh
/Applications/Clang\ Static\ Analyzer/clang.scpt

Must it look like this?? My script is my Applications directory, and there, in a subdir called "Clang Static Analyzer". I just dropped clang.scpt on terminal to get the path.

Output = Insert after Selection (??)

Errors = Merge with script output (??)

Then, when I execute that script, this happens:

/var/folders/QD/QDPLhhOJyvoyecmZQk+++TI/-Tmp-/965ABD-3FF7-46A3-8131-AA9CD1553D26-92280-0401D25AC142AE31: line 2: /Applications/Clang Static Analyzer/clang.scpt: Permission denied

Any idea?

From that page, you are missing the

/usr/bin/osascript

before the name of your script. The line above should read

/usr/bin/osascript /Applications/Clang\ Static\ Analyzer/clang.scpt

Honestly, I'd recommend installing Snow Leopard and Xcode 3.2. The Clang Static Analyzer is beatifully integrated with Xcode now, to the point where you can have the analyzer run with every build pass and have it illustrate where problems are, inline with your code. If you're worried about developing for iPhone OS 2.x, that is possible in Xcode 3.2 .

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