Generating iOS and Android Distribution Certificates
Overview
In order to submit your apps to the app stores, they need to be signed. iOS apps must be signed with a Developer Certificate to be built at all, they must be signed with a Distribution Certificate to be submitted to the App store. Android apps can be built and run without signing during development, but must be signed for distribution. This process varies across platforms, see the individual platform for details.
iOS
A Certificate and Mobile Provisioning file required to build your iOS apps, and in order to obtain these, a membership in the Apple Developer Program is required. During development, you will use a Development certificate which will allow you to install your iOS apps on a pre-selected set of specific devices (identified by their UUID). Once you're ready to publish, you'll sign the application with a Distribution certificate.
Generating p12 certificate using Mac
You'll first need to obtain an Apple Developer Certificate. See apple documentation for this.
Next you'll export it to the P12 keystore format. To do this on Mac OS:
Open the Keychain Access application (in the Applications/Utilities folder).
If you have not already added the certificate to Keychain, select File > Import. Then navigate to the certificate file (the .cer file) you obtained from Apple.
Choose the Keys category in Keychain Access.
Choose the private key associated with your iPhone Development Certificate. The private key is identified by the iPhone Developer, public certificate that is paired with it.
Right-Click the iPhone Developer certificate and select, Export "iPhone Developer: Name.."
Save the keystore in the Personal Information Exchange (.p12) file format.
You will be prompted to create a password that is used when you use the keystore to sign applications or transfer the key and certificate in this keystore to another keystore.
Generating p12 certificate using Windows
Convert an Apple developer certificate to a p12 file on Windows
To develop apps via Build, you must use a p12 certificate file. You generate this certificate based on the Apple iPhone developer certificate file you receive from Apple.
Download and install OpenSSL
Convert the developer certificate file you receive from Apple into a PEM certificate file. To do this, run the following command-line statement from the OpenSSL bin directory:
openssl x509 -in developer_identity.cer -inform DER -out developer_identity.pem -outform PEM
If you are using the private key from the keychain on a Mac computer, convert it into a PEM key:
openssl pkcs12 -nocerts -in mykey.p12 -out mykey.pem
You can now generate a valid P12 file, based on the key and the PEM version of the iPhone developer certificate:
openssl pkcs12 -export -inkey mykey.key -in developer_identity.pem -out iphone_dev.p12
Register devices
Visit Apple Developer Portal.
Go to the Device section. Under Manage tab, provide Device Name and Device UDID (40 hex characters).
Create Provisioning Profile
Create Provisioning Profile
Visit Apple Developer Portal.
Go to the Provisioning section. Create a new profile under the Development tab.
Fill the form with Profile Name, Certificates (as per .cer above), App ID and your development device.
Android
Generating a private key
Open the command prompt (cmd.exe) as an Administrator, then Run the following command:
$ keytool -genkey -v -keystore [keystore_name].keystore -alias [alias_name] -keyalg RSA -keysize 2048 -validity 10000
Keytool will ask for keystore password. Enter password and confirm:
Next, keytool will ask for additional information. Supply appropriately:
Next, keytool will ask password for Alias. Return if it's the same as keystore password. Othewise enter password and confirm:
Your signing key is now ready to submit: