You have decided to take your first stab at iOS development and you do not have a physical Mac machine running OS X but you have a device running iOS. You can still develop for iOS while you wait for that mac mini to come in the mail. After going through this process and developing in it I don’t recommend anyone to develop in this unless it is temporary while you wait for you mac to arrive.
Apple Developer Account
The first thing you will need to do is create your Apple Developer Account, there is no way around this unfortunately. Once you have created the account apple will have to confirm it which can take a few minutes to a few hours. Follow the how-to guides below in the order of their sections to build your necessary profiles and certificates needed to build and deploy.
Device Registration
Before we can do anything we need to register our physical iOS device
- Navigate to https://developer.apple.com/account/ios/certificate/
- Navigate to Devices -> All
- Click the ‘+’ icon to start the add device wizard
- UDID is your device’s unique identifier, this is easily obtainable through itunes or one of the many free iOS apps out there. If you still can’t find your UDID skip all of the items in the Apple Developer Accounts and come back after you complete everything else. In the bitrise.io guide you can easily access your UDID after your first build.
- Click continue and you have registered your iOS device
Identifier Registration
Before we can create any profiles or certificates we need to create an App ID.
- Navigate to https://developer.apple.com/account/ios/certificate/
- Navigate to Identifies -> App IDs
- Click the ‘+’ icon to start the Registering an AppID Wizard
Certificate
Follow the steps below to create your Certificate
- Navigate to https://developer.apple.com/account/ios/certificate/
- Navigate to Certificate -> All
- Click the
+
icon to start the Create Certificate Wizard - Select iOS Development and click continue
- The next page will tell you how to create a CSR via OS X, we will create this manually. Click continue
- Open up your favorite terminal application or utility that can run the command openssl.
- Enter the following commands
1 2
openssl genrsa -out mykey.key 2048 openssl req -new -sha256 -key mykey.key -out ios_development.csr -subj "/[email protected], CN=Skye Hoefling, C=US"
- Back in your browser where it is asking for your .CSR/.certSigningRequest, upload the new file we just generated and click continue.
- You have now successfully generated your certificate, download this certificate because you will need it later.
Provisioning Profile
Follow the steps below to create your Provisioning Profile
pre-reqs
- Device Registration
- Identifier Registration
- Certificate
How To Guide
- Navigate to https://developer.apple.com/account/ios/certificate/
- Navigate to Provisioning Profiles -> All
- Click the
+
icon to start the Create Provisioning Profile Wizard - Select iOS Development and click continue
- Select the App ID we created earlier and click continue
- Select the certificate we created earlier and click continue
- Select the device we registered and click continue
- Enter the Provisioning Profile Name you would like to use and click continue
- You have successfully created a Provisioning Profile, download the profile because you will need it later
.p12 Strong Signed Certificate
To properly deploy your app onto your device you will need a strong signed certificate with an extension of .p12
- Open up a terminal or your utility that has access to openssl
- Navigate to the directory where you saved your ios_development.cer
- Enter the following command
- This will create the strong signed certificate .p12
- This will prompt you for a password, make sure you remember it because we will need it later
1 2
openssl x509 -inform DER -outform PEM -in ios_development.cer -out ios_development.pem openssl pkcs12 -inkey mykey.key -in ios_development.pem -export -out ios_development.p12 -name "Skye Hoefling"
- You now have successfully created your .p12 file, save this for later
Xamarin Project
Configure your Xamarin project to work with Android and iOS. It is recommended to use Xamarin.Forms for this so you can test/develop in the android simulator then verify those changes on your iOS device. Otherwise your development workflow will be very slow for each change you would have to try something, commit, build and deploy. (You do have that mac mini in the mail so it shouldn’t be too bad, but we used Xamarin.Forms).
For the purposes of the project setup we are going to assume you have Xamarin installed
- Open Visual Studio (2015 or Xamarin Supported IDE)
- Click New Project
- Select Templates -> Visual C# -> Cross-Platform -> Xamarin.Forms (Android/iOS) a. You can build the application with other UWP/Win8.1/WP8.1 but you need a solution file with just Android/iOS
- Import your solution into the source control engine that is supported by BITRISE.io a. We used Visual Studio Team Services - git
Feel free to test your Xamarin.Forms solution with the Android Emulator, that goes outside the scope of this post.
BITRISE.io
BITRISE.io is a free build agent if you are a team of 1-2 with a focus on mobile app builds and deployments. Since we have our code in source control we are ready to attempt a build and load download our app.
Register your iOS Device
- Navigate to BITRISE.io and create a new account
- Navigate to your account settings https://www.bitrise.io/me/profile
- In the left bar menu navigate to ‘Test Devices’
- Register your device via 1 of the 2 options below a. Navigate here from your iOS device in the safari browser, once here there will be a button to add this device b. If on your desktop you can register your device manually by clicking the ‘Register Manually’ button. Have your iOS device’s UDID handy because you will need to eneter it.
Create App
- Navigate to the dashboard https://www.bitrise.io/dashboard
- Click the ‘+ ADD’ button to create a new app
- Follow the steps to connect to your code repository
Add Provisioning Profile and Certificate
If you were unable to create a provisioning profile or certificate because you don’t know your UDID jump ahead to the build and deploy and come back when you have successfully created the profile and certificate
- Navigate to your new apps dashboard and select ‘Workflow’
- In the Workflow Editor select ‘Code signing & Files’
- Under ‘Provisioning Profile’ select ‘ a. Add Provisioning Profile’Add the Provisioning Profile we created earlier .mobileprovision
- Under Code Signing Identity select ‘Add Certificate Private Key’ b. Add our .p12 file we generated earlier, it will ask you for the password you entered earlier
Build and Deploy
We have completed all or almost all of the steps and it is time to build the app
- Navigate to your apps dashboard
- Click the ‘Build’ button and queue a new build.
- Once the build completes successfully it will send you an email with deployments for the Droid and iOS app.
- Inside the build completed email there is a button labeled ‘install’ make sure you open this link from your iOS device and in safari.
- Once at the deployment link’s location you will click the install button and it will attempt to install the app a. If you were unable to create the provision profile and certificate you will see your UDID here. Copy your UDID and complete the Profile and Certification creation process
- You can now play with your iOS app that you created without having a mac, way to go!
References
This information was compiled through a night filled with searching and below you will find useful links that I used to put together this guide.