Writing to Xcode build transcript

Is there a way to write to the transcript of an Xcode assembly? What I want to do is to throw a warning if the device is not connected to the computer, and not to an approval error in my unit test cases (some cases rely on an attached ipod).

I was thinking of something like standard compiler warnings (with custom message only).

Thanks.

+6
objective-c xcode cocoa
source share
1 answer

In the build phases of the shell, you can write to stderr in the following format:

<filename>:<linenumber>: error | warn | note : <message>\n

In the same format, gcc uses to display errors. File name: part of linenumber may be omitted. Depending on the mode (error, warning, note), Xcode will display your message with a red or yellow icon.

If you include the absolute path to the file and the line number (if an error occurred in the file), double-clicking on the error in the build log allows Xcode to open the file and go to the line, even if it is not part of the project. Very comfortably.

+6
source share

All Articles