Building and Running Your Code

Build and run your code to compile, link, and debug it. For products that can be run directly, if the product builds successfully Xcode runs the product and starts a debugging session.

bullet
To build and run your code
  1. Select an active scheme and destination.

  2. Click Run to build and run your code with the active scheme.

  3. Use the Stop button to stop an in-progress build or end the current debugging session.

    ../Art/workspace_build_2x.png

Xcode displays any errors or warnings it encounters in the issue navigator. If there are errors during the compilation or link phase, Xcode does not run your code.

By default, if breakpoints are active, Xcode automatically stops at each breakpoint set in your code. Use the Breakpoints button at the bottom of the editor area to activate or deactivate debugging breakpoints. This button affects all breakpoints in your project. You can enable and disable individual breakpoints in the breakpoint navigator or source editor.

When you are done debugging your code, click the Stop button to end your debugging session. You can also use this button to cancel the compilation and linking of your code. During a debugging session, this button does not necessarily terminate the associated process; for example, stopping an iOS application only moves it to the background.