NOTE: For security reasons - never e-mail PEM files. Unauthorized PEM access can leave your app(s) vulnerable. Use of secure file transferring is preferred.
NOTE: Xcode now requires that Development Provisioning Profiles be created and installed in the Organizer in order to run and distribute an Ad-Hoc build. In the past, you could simply create a production build without ever configuring development builds. Therefore, the Development .PEM Guide must be completed before sending Distribution Push Notifications.
 To begin, start by creating permissions for Ad-Hoc Distribution or submission to the App Store.
In the Provisioning Portal, head to the Certificates Tab --> All --> and click the “+” sign in the top right corner of the screen --> Distribution (App Store and Ad-Hoc) --> Continue.
 Follow the Certificate Signing Request (CSR) instructions again. While it may seem tedious, regenerating a new CSR for each of these certificates is the best way to ensure that your certificates are being properly signed. Like in previous steps, download the certificate, install the certificate and verify that it has been installed properly in your keychain:
NOTE: Notice that I have added an iPhone Distribution Certificate to the Keychain rather than an iPhone Development Certificate generated in the previous guide.
 At this point, your application has received permissions for Development/Distribution builds and is currently enabled for Development Push Notifications. However, it still needs to be configured for Distribution Push Notifications:
Head to the settings tab of your App ID and “Create Certificate” under the “Production SSL Certificate” section:
Just like in previous steps, regenerate the CSR file in the Keychain, upload the CSR file, and download and install the certificate that Apple creates for you. Verify in Keychain Access that these certificates have been properly installed:
At this point, you should have both Apple Development iOS Push Services and Apple Production iOS Push Services (Distribution) installed in the Keychain as well as iPhone Developer and iPhone Distribution permissions.
 Once the Apple Production iOS Push Services certificate has been added to the Keychain, export the file to the desktop in the form of a .p12 file and use the Terminal to generate a Distribution .PEM (in our example, "SportsApp", but substitute with a name appropriate for your app when you perform this step):
openssl pkcs12 -in Certificates.p12 -out SportsApp.pem -nodes -clcerts
 Just like in the Development PEM process, take your newly created Distribution .PEM and upload it to your iOS Distribution Platform on the Web Dashboard. Once uploaded, click “Edit” and “Download PEM.” Use TextEdit to verify that the Distribution .PEM file is correct.
Notice how the Bundle ID in the .PEM file matches the Bundle ID of our Xcode Project. Likewise, notice how this .PEM file reflects the Apple Production iOS Push Services and not Apple Development iOS Push Services.
 This concludes the tutorial for generating Distribution PEM files. You will also need to generate a Distribution Provisioning Profile on Apple’s Provisioning Portal like you did for your Development Build. Install the Distribution Provision and verify that it has been added to the library/device in Xcode’s Organizer window.