110

I have build errors in my Xcode project (Objective-C), and I no longer "stumble upon" the build command string nor the build output logs. This is Xcode 6.3.1.

All I can inspect is a left-side panel listing errors/warnings.

I want the build command and build console output to compare between two projects; there's a platform-specific issue present in one but not the other; my intuition says that the build settings are different between the two and that seeing the output would be the easiest way to identify the diff.

How do I get to see the build command string, and, the build output logs in this xcode?

pkamb
  • 33,281
  • 23
  • 160
  • 191
starlocke
  • 3,407
  • 2
  • 25
  • 38

1 Answers1

207

Use the Xcode report navigator.

To show the report navigator, either (1) click the rightmost button in the navigator bar at the top of the navigator area, which is on the left side of the workspace window, (2) select View > Navigators > Reports from the menu bar at the top of the screen, or (3) press 9.

The report navigator shows a list of recent builds. Select one to see the details of the build in the editor area, which is in the center of the workspace window.

At the top of the editor area, make sure "All" and "All Messages" are both selected. Then click the "Export…" button at the top-right of the editor area to export a text file containing all the messages and build commands.

If you just want to see the messages and build commands for a specific build step, then select that step and click the small button on the right with a series of horizontal lines.

Xcode show build commands

The picture below is from the original answer.

Xcode show build commands

ma11hew28
  • 121,420
  • 116
  • 450
  • 651
Swift Dev Journal
  • 19,282
  • 4
  • 56
  • 66
  • 28
    What about the build command itself, can we retrieve it somewhere? – AmineG Oct 24 '18 at 13:13
  • @AmineG What do you mean by retrieve the build command itself? The build command for each step in the build is in the detailed log that's shown in the screenshot. – Swift Dev Journal Oct 24 '18 at 18:41
  • 4
    And how can be check if ran from terminal? – Luigi Lopez Jun 26 '19 at 16:18
  • @LuigiLopez Create a new question. I don't build Xcode projects from the Terminal so I have no answer for you. – Swift Dev Journal Jun 26 '19 at 20:19
  • 14
    @MarkSzymczyk I think he means Xcode actually execute `xcodebuild` and commands like such. Can we see the commands Xcode executed? – allenlinli Sep 18 '19 at 01:37
  • 1
    @LuigiLopez the terminal commands are visible in the screenshot above. they start with the line 'cd /Xcode Projects/CocoaAppTest' – Alan McCosh Oct 14 '19 at 20:54
  • 1
    @allenlinli did you find which commands executed by Xcode to run/ build target – iKushal Jan 20 '20 at 04:35
  • 2
    Yeah, I would really like to be able to actually see the `xcodebuild` arguments passed when I kick off various builds. Currently in hell trying to figure out why XCode doesn't work but CI does for a particular build... – aspirant_sensei Jan 26 '21 at 13:06
  • In the same boat, really want to see the 'xcodebuild' command that xcode is running. Has anyone figured out if you can do this? – lostintranslation Mar 23 '21 at 15:10
  • 2
    @lostintranslation I don't think Xcode 12.4 (12D4e) runs xcodebuild commands. I think it uses the [Swift compiler](https://swift.org/swift-compiler/) (via the commands `swift` or `swiftc`) and other command-line tools, such as `actool` and `clang`. It uses absolute paths when invoking command-line tools, eg, `/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc …`. – ma11hew28 Apr 04 '21 at 16:57
  • @ma11hew28 can these (swift/swiftrc/actool/clang etc) commands be viewed using the above method or any other way? And if so, how and then can we use the captured commands to run the same build entirely using the command line, either with the above tools themselves or (preferably) with xcodebuild? Finally - is there a chancen that Apple will deprecate xcodebuild and replace it with something else? (sorry thats a lot of questions.) – CoolDocMan Jul 22 '21 at 22:34
  • @CoolDocMan (1) yes, you can see the build commands by using the above method. They're in the exported text file (as explained above) and in the details of each build step in the Xcode report navigator (as shown in the second screenshot above). (2) You can run many of the commands manually from the command line, but I don't know how to run those that use Xcode builtin commands, such as `write-file`. To use `xcodebuild`, see [Building from the Command Line with Xcode FAQ](https://developer.apple.com/library/archive/technotes/tn2339/_index.html). (3) I don't know. – ma11hew28 Jul 24 '21 at 01:23
  • Can't they use a filesystem path like normal people? Then this answer would have been intelligeble, short, concise, fast, easy and painless – Niklas Rosencrantz Mar 23 '22 at 05:58