I realized that there is a lot of misconception and misinformation about the requirements of developing iOS apps, the chief amongst which is the urban myth that states:
"You can only develop iOS apps on a Mac"
Now let me say right off the bat that this is just plainly wrong
, first and foremost because I do develop iOS apps on PC, and don't even own a Mac.
This myth probably has stemmed from the fact that you do
need a Mac to use iTunes Connect, which is necessary to actually submit the app to the App Store (the very last step in the development process), and you do
need a Mac if you're using Objective C or any other Mac-dependant language/engine.
However, some multi-platform languages/engines (such as Unity, Haxe NME and others) can't generate an IPA on their own, but instead output an XCode project (which needs a Mac to run on). In this case, you can still pretty much develop the whole project on PC, then export the iOS version to a Dropbox folder, import it on a Mac, and finish the actual build/submission process there.
When eventually you need to use a Mac, you can either:
- Borrow a Mac from a friend
- Run your own MacOSX Virtual Machine (warning: needs a pretty fast machine with lots of memory, or else it will run horribly slow)
- Rent a Mac over a VPN <--- Recommended!
Please note that it is also helpful to have a Mac if you want to easily deploy test builds to your beta testers using TestFlight (which now requires iTunes Connect as well), but is not mandatory, as it is possible to install the app through the regular iTunes for PC (more on this later). WHAT DO YOU NEED
To generate an iOS package (IPA), you'll need:
- The developer certificate, generated through Apple's Member Center
- A Certificate Signing Request to generate the developer certificate
- OpenSSL to generate the CSR
- A provisioning profile, generated through Apple's Member Center
- A packaging tool for your chosen language/engine (that supports an IPA target)
Please note that you'll only need to generate the developer certificate once, as it can be used multiple times, across different projects.
The provisioning profile must be generated per app, and whenever you add or remove a device from the list. HOW TO GENERATE A CSR
Make sure you have OpenSSL
installed, and in your command path (or else use the full path for the executable).
Open a command prompt window and, if your OpenSSL executable complains about the random generator, enter this first:
set RANDFILE = .rnd
So, let's start by generating a private key and saving it to a file:
openssl genrsa -out ios.key 2048
Then, generate the Certificate Signing Request file:
openssl req -new -key ios.key -out ios.csr -subj "/[email protected], CN=Your Name, C=US"
Make sure that the email address, name and country code match your actual data. HOW TO GENERATE THE DEV CERTIFICATE
- Open "Certificates / Development" on the iOS provisioning portal (accessed through Member Center), and click the plus button to add a new certificate
- Select "iOS App Development" and click "Continue" twice
- Upload the ios.csr file and click "Generate"
- Download the new certificate and save it as ios.cer
This ios.cer file is your dev certificate, and it might be enough for your purposes, but if your packaging application requires a p12 file, read on.
Generate the PEM File (an intermediary format needed to generate the actual certificate):
openssl x509 -in ios.cer -inform DER -out ios.pem -outform PEM
Generate the p12 certificate file:
openssl pkcs12 -export -inkey ios.key -in ios.pem -out ios.p12 -password pass:SecretPassword
Make sure to change the password to something meaningful. HOW TO GENERATE A PROVISIONING PROFILE
HOW TO GENERATE THE PACKAGE (IPA)
- Make sure you've created an App ID and registered at least one test device on the iOS provisioning portal
- Open "Provisioning Profiles / Development" and create a new profile by clicking on the plus button
- Download the provisioning profile file and save it as ios.pp
This is up to the packaging tool of the language/engine you're using, but the certificate (ios.cer or ios.p12) and provision file (ios.pp) are basically all you need.
For instance, you can use Adobe's AIR Developer Tool (adt) to generate the IPA like so:
adt -package -storetype pkcs12 -keystore ios.p12 -storepass SecretPassword -provisioning-profile ios.pp AppName.ipa App.xml App.swf
Don't forget to change the password to match the certificate's password, and any other values according to your environment.
For Haxe, target Flash, create a swf and package it using adt, as described above. HOW TO INSTALL ON A TEST DEVICE
- Open iTunes and select the 'Apps' tab (Ctrl + 7)
- Open (Ctrl + O) or drag-and-drop the IPA file into the 'Apps' tab
- Connect the device and select it on iTunes
- Select 'Apps' tab and search/locate the app
- Click on 'Install' button, and then on 'Apply' to start syncing
Note: To update first remove the app from iTunes, then start over from #1 FINAL THOUGHTS
So as you can see, this may seem like a convoluted process, but some steps you only have to do once, other are entirely optional, and you can automate the actual building process very easily (I use ANT
Having a Mac is definitely easiefastebetter but if you, like me, don't feel like shelling out hundreds of dollars just to support the iOS build, then these workarounds will do just fine... ;)