In this post I will walkthrough the process to build and deploy a Cordova/PhoneGap app to a device using Visual Studio 2013, PhoneGap Build and Testflight.
NOTE: You will still require a mac for the store submission.
Things you will need to get started:
- A Cordova/PhoneGap app ready to build
- Setup a Testflight account as a developer with team for your testers (Its free)
- Setup a PhoneGap Build account (Free for 1 private app)
First thing to do is get your apple developer account setup for the new app.
Go here: https://developer.apple.com/account/ios/identifiers/bundle/bundleList.action and create a new App ID.
Next you will need to create a certificate for your app to be signed with. To do this you will need to download OpenSSL and create some keys and junk.
Download the latest OpenSSL build for Windows from here (Light version will work fine) at the time of writing this its "Win32 OpenSSL v1.0.1h Light".
NOTE: You will need to run cmd as Administrator
Create a new private key
openssl genrsa -out mykey.key 2048
This will create a new key file for you called "mykey.key"
Now that you have the key you can generate the Certificate Signing Request. Update the subj parameter with your own email, name and country.
openssl req -new -key mykey.key -out CertificateSigningRequest.certSigningRequest -subj "/emailAddressfirstname.lastname@example.org, CN=Damian Karzon, C=NZ"
This will then create the Certificate Signing Request for us to upload to upload the the Apple developer site. (A file named "CertificateSigningRequest.certSigningRequest")
- Go back to the Apple developer site and under Certificates click new. When prompted for the type of certificate you need select "iOS App Development". Continue through the process and upload your CSR when prompted.
- Download your developer certificate. (You will need this for PhoneGap Build)
OK, let try and build it!
Since we are building for a Testflight build here we need to jump through a few hoops and get the build provisioned for our devices.
To provision the builds you will need to add the devices to your Apple developer account. Go here: https://developer.apple.com/account/ios/device/deviceList.action I found the easiest way to get the DeviceIds is from Testflight (Assuming you already have this setup for your team), This can be found under People by clicking the Info symbols.
Once the devices are added to your account you will need to create a provisioning profile. Go through the steps to create a new provisioning profile, select the certificate you created and the devices you wish to provision for the build. Download your new provisioning profile, you will need this for build.phonegap.com to create your builds.
Now that you have your certificate and provisioning profile you can login to build.phonegap.com and create an app for building with them.
Create the app, upload www folder, unlock the certificate, build. Finally you can download the built .ipa file which you can then upload to Test Flight to push out to your testers.