Archiving your app is an essential process. Only after archiving your app do you get an .ipa file which you can distribute to a test device or eventually to the App Store.
In Xcode, navigate to to Product | Archive while selecting Generic iOS device in active scheme:
After the archiving process has finished, navigate to Window | Organizer to view your archives.
Here, you can either export your archive to test it on your phone or can Upload to the App Store by clicking on the blue button on the right.
Click on Export and select ...