With the recent announcement of Ionic Package you can now build your Ionic app for iOS even without a Mac.
However you still need to set up Certificates and Provisioning Profiles in the Apple Developer Member Center, then upload them to your ionic.io account before you can build anything.
The Ionic Package documentation explains how to set up iOS Credentials using OS X. But what if you don’t have access to a Mac? That’s supposed to be one advantage of Ionic Package: it lets you build iOS apps without a Mac, right?
Luckily it’s entirely possible to set up the certificates using Windows or Linux as well. Here’s how.
The only tool you need is OpenSSL. If you’re on Linux you almost certainly have it installed already. If you’re on Windows, you can find it as part of Cygwin (a Unix-like environment for Windows), or you can download and install it as a standalone binary package for your system.
You can follow the default instructions for all the steps that involve the Apple Developer Member Center – it’s just a web interface so you can access it from any web browser. At one stage you will be prompted to upload a Certificate Signing Request.
Now open a terminal (or command prompt) and generate a key file with this command:
openssl genrsa -out ios-dev.key 2048
then generate a signing request for that key with:
openssl req -new -key ios-dev.key -out ios-dev.csr -subj "/emailAddressfirstname.lastname@example.org, CN=Joe Bloggs, C=US"
(Replacing your details as appropriate of course.)
At this point you can upload the ios-dev.csr file to the Apple site, generate the signed certificate and download it as say ios-dev.cer.
The final step is to export the certificate in PKCS #12 (*.p12) format. First, convert the file downloaded from the Apple site into the PEM format:
openssl x509 -in ios-dev.cer -inform DER -out ios-dev.pem -outform PEM
then combine the key and the PEM into a single *.p12 file with:
openssl pkcs12 -export -inkey ios-dev.key -in ios-dev.pem -out ios-dev.p12
That’s all. The ios-dev.p12 is the one you need to upload to ionic.io in the Settings > Credentials for your app, along with the Provisioning Profile that you can generate from the Apple site.
You’re now ready to build an iOS app with Ionic Package. Look ma, no Macs!
Self-plug: want to learn more about Ionic? Check out my Ionic by Example course!