Customize Xcode
Customize Xcode
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.
1. Optionally, select an active scheme and destination from the scheme menu in the toolbar.
For iOS, watchOS, and tvOS apps, choose a run destination from the Scheme menu.
Run in a simulator: Under iOS Simulators, choose a device family or click Add Additional
Simulators to configure your own. For tvOS apps, choose Apple TV 1080p. For watchOS,
choose the WatchKit App as the scheme, and choose an iPhone simulator paired to an Apple
Watch as the run destination.
Build using the platform SDKs: Under Build Only Device, choose a generic device. Choose
a generic device if later you want to create an archive of your app and you dont have a real
device. You cant create an archive of a simulator build.
Launch on a device: Under Device, choose a device connected to your Mac.
2. Click the Run button to build and run your code with the active scheme.
The activity viewer shows the build progress and results. (If the device is not registered, click
Register Device in the sheet that appears.)
Optionally, press the Run button to see other run options, or Option-click the Run button to
open the Scheme editor and check or modify your settings before starting the build. Click the
Run button in the Scheme editor to start building and running your code, or click the Close
button to apply any changes without building.
3. Use the Stop button to stop an in-progress build or end the current debugging session.
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.
).
).
).
).
Show a main editor with an assistant editor: Click the middle button (
).
Change the location of the assistant editor: Press the middle button (
location from the pop-up menu.
) and choose a
).
) in the navigator bar of the navigator area. Your project files are displayed in
Tip: You can also drag a file type from the File Template library to a location in the project navigator.
2. Click the Add button (+) in the filter bar and choose File from the pop-up menu (or choose File > New > File).
3. Click iOS, watchOS, tvOS, or macOS at the top of the template dialog to display the templates for that platform.
Other: Miscellaneous files such as empty files, assembly-language and shell script files, and configuration files.
4. Select a template for the file type, and click Next.
5. In the sheets that follow, enter any required information and click Next.
For example, enter a class name for a class implementation file.
6. In the last sheet, choose a location and enter a filename (if applicable).
7. Choose a group from the Group pop-up menu.
The project structure is different from the file system structure.
8. Select the targets that you want to add the file to.
9. Click Create.
The new file is selected in the project navigator and opens in the appropriate editor.
), select the destination project or group for the item you want to add.
2. Click the Add button (+) in the filter bar, choose Add Files to [Project Name] from the pop-up menu (or choose
File > Add Files to [Project Name]), and select the files or folders.
3. At the bottom of the sheet, click Options.
Choose options for how the files and folders are added:
Copy the files and folders into the project: Select Copy items if needed.
Select this option if you want the files and folders to reside in the project folder.
Create groups for each folder: Select Create groups.
Select this option if you want the group structure to be the same as the file structure.
Create references for each folder: Select Create folder references.
Select this option if you want the folders and their contents to appear in the project navigator, but not actually
reside within the project. A folder reference is a reference in the project navigator to a folder in the file system.
Add the files to the project or selected targets only: Select the targets that you want to add the file to.
Show only classes and protocols: Click the Classes and Protocols button (
Show only project symbols: Click the Project Symbols button (
Show only containers, such as classes and functions: Click the Containers button (
bottom.
Show the inheritance hierarchy of classes and protocols: Click Hierarchical at the top.
Show a flat list of classes and functions: Click Flat at the top.
Tip: You can navigate the symbols in the current file using the jump bar at the top of an editor area pane.
Clear the list of recently viewed files: Click the Related Items icon (
from the pop-up menu.
Increase or decrease the number of recently viewed files displayed: Click the Related Items icon (
choose Recent Files > Number of Recent Files > [Number] from the pop-up menu.
) and
Show a counterpart file, such as the interface file for an implementation file: Click the Related Items icon (
and choose Counterparts > [Filename] from the pop-up menu.
Show a file related to the current context: Click the Related Items icon (
menu.
Step forward or backward through your viewing history: Click the Previous button ( ) or Next button ( ) on the
left side of the bar. Click and hold a button to display a pop-up menu containing the complete viewing history.
Choose an item to jump to it.
Navigate to a file: Click a hierarchical path segment to display a pop-up menu of files at that level of the hierarchy.
Choose a file to jump to it.
Navigate to a symbol: Click the final path segment to display a pop-up menu of symbols, such as properties and
methods, in the current file. Choose a symbol to jump to it. Hold down the Option key when clicking this segment to
sort the pop-up menu items alphabetically.
Step through issues: Click the Previous button ( ) or Next button ( ) on the right side of the bar. Click the icon
between the buttons to display the current issue. These buttons are only visible when there are problems.
Tip: The View > Standard Editor menu includes menu items for showing related items, previous files history, next
files history, top level items, group files, and document items in the jump bar. Use the keyboard shortcuts for these
menu items to navigate through your project using the keyboard.
Results appear in four categories: API Reference, SDK Guides, Tools Guides, and Sample Code. Within each
category, results are sorted by relevance.
In the toolbar, click the Table of Contents button to the left of the search field.
In the toolbar, click the documentation Navigator button to the left of the Table of Contents button.
Browse documentation
1. Show the documentation navigator.
2. To browse API reference, in the navigator bar, click the framework icon.
In the toolbar, click the Share button in the upper-right corner and choose a method from the pop-up menu.
Create bookmarks
1. Open the book or section you want to bookmark.
2. Next to the document title, click the bookmark icon. (Alternatively, in the toolbar, click the Share button and
choose Add Bookmark from the pop-up menu.)
The bookmark appears in the bookmark navigator.
Choose File > New > Tab (or click the Add button (+) in the tab bar).
The current document appears in the tab bar. (To display the tab bar, choose View > Show Tab Bar.)
3. Press Return.
A dialog is displayed, listing the items in your project that can be renamed. The dialog includes a preview of how
the items will appear after the change.
4. To selectively rename items, disable the checkboxes for any items you dont want to rename. To rename only your
app, leave the app selected and deselect all other items.
5. Click Rename.
Add a property
1. Click the Add button (+) beside a key in the property list editor or select an existing property and press Return.
2. Choose a key from the pop-up menu (press the Down Arrow key to display it if its not visible) or type a new key
name in the Key column.
3. Choose a type from the pop-up menu in the Type column.
4. Enter a value in the Value column.
To add a value to an array or dictionary, expand the disclosure triangle beside the array or dictionary. Next, click
the Add button (+) or press Return to add a child property.
Remove a property
Click the Remove button () beside a key in the property list editor or select a property and press Delete.
Control-click anywhere in the property list editor and choose Show Raw Keys/Values from the contextual menu.
Repeat the process to hide the raw keys and show the readable ones again.
Control-click a property list in the project navigator and choose Open As > Source Code from the contextual
menu. Repeat the process but choose Open As > Property List to display it as a property list again.
Control-click anywhere in the property list editor and choose Property List Type > [Type] from the contextual
menu.
The current type is indicated by a preceding dash.
In the toolbar, click the Table of Contents button to the left of the search field.
In the toolbar, click the documentation Navigator button to the left of the Table of Contents
button.
Browse documentation
1. Show the documentation navigator.
2. To browse API reference, in the navigator bar, click the framework icon.
In the toolbar, click the Share button in the upper-right corner and choose a method from the
pop-up menu.
Create bookmarks
1. Open the book or section you want to bookmark.
2. Next to the document title, click the bookmark icon. (Alternatively, in the toolbar, click the
Share button and choose Add Bookmark from the pop-up menu.)
The bookmark appears in the bookmark navigator.
Choose File > New > Tab (or click the Add button (+) in the tab bar).
The current document appears in the tab bar. (To display the tab bar, choose View > Show Tab
Bar.)
3. Press Return.
A dialog is displayed, listing the items in your project that can be renamed. The dialog
includes a preview of how the items will appear after the change.
4. To selectively rename items, disable the checkboxes for any items you dont want to rename.
To rename only your app, leave the app selected and deselect all other items.
5. Click Rename.
Add a property
1. Click the Add button (+) beside a key in the property list editor or select an existing property
and press Return.
2. Choose a key from the pop-up menu (press the Down Arrow key to display it if its not visible)
or type a new key name in the Key column.
3. Choose a type from the pop-up menu in the Type column.
4. Enter a value in the Value column.
To add a value to an array or dictionary, expand the disclosure triangle beside the array or
dictionary. Next, click the Add button (+) or press Return to add a child property.
Remove a property
Click the Remove button () beside a key in the property list editor or select a property and
press Delete.
Control-click anywhere in the property list editor and choose Show Raw Keys/Values from the
contextual menu. Repeat the process to hide the raw keys and show the readable ones again.
Control-click a property list in the project navigator and choose Open As > Source Code from
the contextual menu. Repeat the process but choose Open As > Property List to display it as a
property list again.
Control-click anywhere in the property list editor and choose Property List Type > [Type] from
the contextual menu.
The current type is indicated by a preceding dash.