Test and Develop iOS App on your iPhone with Microsoft Windows

Vincent Delacourt
4 min readMar 17, 2019

--

With React-Native and Visual Studio App Center

Windows with XCode on the cloud

Most people think that it’s impossible to deploy an app on a device without having a Mac but with VS App Center we can use XCode on the cloud and distribute our App on iOS

Requirements

As we don’t have a Mac, we will develop our React-Native App with Windows and Android.

Of course, you still need an Apple Developer Account https://developer.apple.com/programs/enroll/

Follow the instructions here to start your App with React Native CLI Quickstart for Windows and Android https://facebook.github.io/react-native/docs/getting-started

Choose CLI, Windows, Android

As written in instructions, I recommend you to use https://chocolatey.org/ to install all the tools. I also recommend you to use PowerShell

Create your React-Native App

$ react-native init IblisProject

It’s better for you to use a different name for your project as it will generate a Bunde ID (in App Store it must be unique). In the following, you just have to replace IblisProject with the name you choose.

Push your app to your remote Git repository

You can use only Github or BitBucket

$ cd IblisProject
$ git init
$ git add .
$ git commit -m "first commit"
$ git remote add origin https://xxx@bitbucket.org/xxx/xx.git
$ git push -u origin master

Register your Bundle ID on App Store

Go to https://developer.apple.com/account/ios/identifier/bundle

By default, the Bundle ID set up by React-Native is org.reactjs.native.example.iblisproject (you can change it if needed)

Create your App ID and Bundle ID

Create your AppStore Certificate

To create all the Keys you need to have OpenSSL installed. On Administrator Powershell launch :

$ choco install openssl.light

Create your RSA key

$ openssl genrsa -out iblis.key 2048

Create your Certificate Signing Request (CSR)

$ openssl req -new -key iblis.key -out iblis.certSigningRequest

Fill all pieces of information needed (Country, Company name, etc …)

Go to the Certificate in Apple Developer Portal https://developer.apple.com/account/ios/certificate/

Create an iOS Certificate
Upload the generated file iblis.certSigningRequest
Download the certificate file ios_distribution.cer

Open an account on Visual Studio App Center

Create your account here: https://appcenter.ms/create-account

Register your device on Visual Studio App Center

On your iOS device go to register device App Center with Safari https://install.appcenter.ms/register-device

Add Device with App Center
Install App Center Profile

Get your UDID

Find your registered device
Copy your UDID

Add Device to your Apple Developer Account

Go to https://developer.apple.com/account/ios/device/

Paste your UDID

Create your AppStore Add Hoc Provisioning Profiles

Go to the Certificate in Apple Developer Portal https://developer.apple.com/account/ios/profile/production

Add a new Distribution Provisioning Profile and choose Ad Hoc
Select the App ID previously created
Select the Certificate created previously
Select your device added previously
Write your profile name Iblis Ad Hoc
Download the file Iblis_Ad_Hoc.mobileprovision

Create the p12 Key

Generate the pem file

$ $env:RANDFILE=".rnd"
$ openssl x509 -in .\ios_distribution.cer -inform DER -out .\ios_distribution.pem -outform PEM

Generate the p12 and fill password when asked (remember it)

$ openssl pkcs12 -export -inkey .\iblis.key -in .\ios_distribution.pem -out .\ios_distribution.p12

Build your App with App Center

Go to https://appcenter.ms/apps and choose to add a new app

Select iOS and React Native
Go to build and add your git repo (no need to install Add App Center’s SDK)
Click setting on your branch
Choose Automatically increment build number
Add the file Iblis_Ad_Hoc.mobileprovision and ios_distribution.p12 (use the password in p12)
Add yourself in the distribute builds, then Save & Build

You should receive an email, open it on your device

Install the App on your device
Install the App
The app is now on your device
You can now see your App running on your device

Of course for development of real app, it’s hardly recommended to have a Mac and make local development with XCode.

--

--

Vincent Delacourt

Interesting in start-up or project development in the latest technologies for web and mobile apps