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

The empty app should be running in the simulator now:

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:

Add to Portal does many things automatically:
- It creates a developer certificate for you. This includes a public/private keypair which is added to your OS X keychain. iPhone apps need to signed to run on the device and your key will be used to sign your app.
- It uploads a request to sign the certificate to the Apple iOS Provisioning Portal. Your certificate needs to be signed by Apple, otherwise the app will not run on the device.
- It adds the
Unique Device ID (UDID)of your device to the iOS Provisioning Portal. - It creates an
App IDin the iOS Provisioning Portal. - It creates a
Provisioning Profilein the iOS Provisioning Portal. This is the permission to run apps (having a matching App ID) signed with your key on only the devices with the specified UDIDs. - It downloads the provisioning profile from the iOS Provisioning Portal and installs it to Xcode and on your phone (you can check that on the phone using
Prefs > General > Profiles).

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

