Nov
22
2016

Publish .ipa file from Windows PC to iOS without Mac

With Unity Cloud Build service, you can create iOS apps, without ever needing Macintosh+XCode!

First steps

– Register as an Apple Developer : https://developer.apple.com/programs/enroll/
– Join Unity Cloud Build (if you haven’t already) : https://unity3d.com/services/cloud-build
– Follow cloud build instructions there, its quite simple to setup iOS project
(but you’ll need to have the project at source control somewhere, for example github.com, bitbucket.com)

Registering your Devices

– You can only install on devices that are registered
– Go to https://developer.apple.com/account/resources/devices/list
– Add you UDID there, you can get UDID from https://showmyudid.com/
– Info: https://www.igeeksblog.com/how-to-find-iphone-udid-number/

Creating .CSR file in Windows (Certificate Signing Request)

– Download openssl binary : https://indy.fulgan.com/SSL/ (i used this version )
– Unzip it
– Open Command Prompt on that folder  *Note: Must run command prompt as an Administrator!
– Download missing openssl.cfg file from this page https://docs.oracle.com/cd/E19509-01/820-3503/ggeyz/index.html and place it to the same folder with openssl (with filename openssl.cnf)
– Enter following command> openssl genrsa -out mykey.key 2048
– Enter following command> set OPENSSL_CONF=c:\YourOpensslFolder\openssl.cnf
– Enter following command> openssl req -new -key mykey.key -out CertificateSigningRequest.certSigningRequest  -subj “/emailAddress=yourAddress@example.com, CN=YourName, C=US”
– Now you can upload the generated “CertificateSigningRequest.certSigningRequest” file into Apple Developer site (when creating the Production Certificate in next step)

Setting Up Apple Developer Licenses

– Login into Apple Developer Account
– Create App ID (make it wildcard, so you can use it for many apps) https://developer.apple.com/account/resources/identifiers/list
– Go to “Certificates, Identifiers & Profiles” https://developer.apple.com/account/resources/certificates/list
– Create Distribution certificate (“iOS Distribution (App Store and Ad Hoc)”, cloud build says so)
– *If you have too many added (cannot add new), need to revoke some old cert first
– Upload signing certificate (its the file you created in earlier steps here)
– Download it (ios_distribution.cer)

Creating .p12 file in Windows

– Download your “ios_distribution.cer” from previous step (and copy it into your openssl folder)
– Open command prompt (NOTE run as administrator)
– Enter following command> openssl x509 -in ios_distribution.cer -inform DER -out developer_identity.pem -outform PEM
– (Uses the mykey.key we created in CRS creation)
– Enter following command> openssl pkcs12 -export -inkey mykey.key -in developer_identity.pem -out iphone_dev.p12
– enter password (write it down, as you will need it later) *Note: if you paste the password in from notepad, it might not work(?)

Creating .mobileProvision file

– Register a New Provisioning Profile at https://developer.apple.com/account/resources/profiles/list
– Select Adhoc, continue
– Select AppID (select your wildcard id from there), continue
– Select certificate from list (should be todays date), continue
– Select devices (all, you need to have them added first in devices place), continue
– Set “Provisioning Profile Name”
– Click Generate
– Click Download “yourfile.mobileprovision”

Building .ipa with Unity cloud build

– Go to unity cloud build: https://unity3d.com/services/cloud-build
– Create new IOS Project (just follow the instructions on the site, its quite simple)
– And when it asks for the Mobile Prov File and .p12 files, you now have them!
– If you want to Update your signing cert inside cloud build, do these steps:
– Go to dev ops, Build automation, Settings, Credentials /
– Edit existing configuration (… update credentials)
– Select your mobileprovision file
– Select your .12 file
– Enter password
– Then hit Build and download your .ipa file

Copying .ipa to iOS Device

– Note this is not tested on 2022.. since there is no itunes access to pad anymore either? (but you can use those generated cert files in Unity Cloud build)
– Install iTunes
– Connect ios device to your pc
– Click […] and select Apps (shows all available apps on this machine, not from the ipad)
– Remove your old app from the list (if its there), right click, delete
– Then drag and drop the cloud build .ipa file here (cannot drag and drop it directly to the ipad)
– Then click [] Ipad icon to view your ipad
– Click Apps (in left panel)
– Scroll down to see your .ipa app listed there
– Click Install (or Update) button *it changes to Will Install or Will Update
– Click Apply button at the bottom
– Done! You can now run the app on ipad
*Note: First you need to authorize and sync the ipad to this machine

References:
https://unity3d.com/learn/tutorials/topics/cloud-build/your-first-cloud-build-project
http://help.adobe.com/en_US/as3/iphone/WS144092a96ffef7cc-371badff126abc17b1f-7fff.html
http://help.adobe.com/en_US/as3/iphone/WS144092a96ffef7cc-371badff126abc17b1f-8000.html
https://www.tbs-certificates.co.uk/FAQ/en/openssl-windows.html
http://docs.telerik.com/platform/appbuilder/cordova/code-signing-your-app/configuring-code-signing-for-ios-apps/create-distribution-certificate

Errors:
“Failed to update credentials! The provisioning profile and .p12 file are not compatible (certificates did not match)!”

Generate your keys again, probably used wrong file or wrong password in some step..


21 Comments + Add Comment

Leave a comment to mgear

Connect

Twitter View LinkedIn profile Youtube Youtube Join Discord Twitch

UnityLauncherPro

Get UnityLauncherPRO and work faster with Unity Projects!
*free unity hub alternative

@unitycoder_com

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.