Run the app

Simulator

Check that the iPhone simulator is checked for Scheme and hit Run (⌘R):

Running in the simulator

The empty app should be running in the simulator now:

iPhone Simulator

Device

To run the app on the device, you need to be iOS Developer Program member.

Connect the iPhone to your Mac. Open the Organizer in Xcode via Window > Organizer and choose the device. The first time you might have to enable it for development.

Click the Add to Portal button. It will query for your Apple account password and offer to request a certificate for you. If it asks to wait for your Provisioning Profile to be created, refresh the Provisioning Profiles section until a valid "Team Provisioning Profile: *" pops up there. The icon besides the device should be green by now:

Xcode Organizer

Add to Portal does many things automatically:

Provisioning Profile

You can now pick the hardware device in the Scheme selector and run the app on the hardware device:

Running in the simulator

App running on the device

Ralf Ebert

Ralf Ebert is an independent software developer and trainer. He makes apps for Mac OS X and iOS and offers iOS and Git training courses for software developers.