Xamarin Ios App Without Mac
If you’re a die-hard Windows user, like me, you’ll be excited to know that you can now build iOS application using Xamarin (and Xamarin.Forms) and Visual Studio, without having to buy or use a Mac. That’s right for development, you no longer need to invest, or carry around, a Mac. In this post I’ll walk you through how to enable this feature.
Xamarin allows us to code in C just once and then deploy on the three platforms (Windows, iOS and Android), but without a Mac, the iOS environment might give us some problems. In Visual Studio, where Xamarin is installed, we have the Xamarin Mac Agent that allows you to run iOS Simulator. Note: The final build and submission to the App Store will still require a Mac. Device Requirements. The Xamarin Live Player app supports the following devices: iOS. IOS 9.0 or later. ARM64 processor. Check the App Store for a list of supported devices. Android 4.2 or later. ARM-v7a, ARM-v8a, ARM64-v8a, x86, or x8664 processor. After installing your app on your device, Visual Studio will show a popup telling you to manually run the app. Do it and the popup will disappear and you will be able to test your app on your device. Xamarin Hot Restart. Not only you can test your Xamarin.iOS app without a Mac.
I’m working in the latest preview of Visual Studio 2019 and as of now, to use Xamarin Hot Restart (the feature that powers the no Mac development experience), you need to check the Enable Xamarin Hot Restart option under Preview Features in the Tools, Options dialog.
After enabling Xamarin Hot Restart, make sure you restart Visual Studio. Next, set your iOS project to be the startup project by right-clicking the iOS project in Solution Explorer, followed by the Set as Startup Project menu item.
Make sure in the toolbar the option next to the play button says Local Device. Click the play button, which will kick off the Setup Hot Restart experience.
There are a couple of steps to jump through the first time you want to use Hot Restart. Make sure you follow the instructions to avoid having to redo steps.
The first step in the process it to Download iTunes – make sure you click the Download iTunes button. Do NOT install iTunes from the Microsoft Store. If you’ve done this previously, make sure you uninstall it, and then install it by clicking the Download iTunes button.
Clicking the Download iTunes button will open your default browser but it will attempt to immediately download the file – make sure you check out the downloads so you can launch the file once it’s downloaded.
Step through the iTunes installer.
Once iTunes is installed the Setup Hot Restart process will detect the presence of iTunes (note that it will not detect iTunes if you’re installed it from the Microsoft Store).
Next, make sure you have an iOS device plugged in and that you’ve clicked the Trust option on the device when prompted to trust the connected computer. The Setup Hot Restart process should detect the attached device.
Next, sign into your Apple Developer account.
And select the Development Team you want to use for provisioning.
After completing the Setup Hot Restart process you should see that the build process will continue and that in the Output window you’ll see the iPA being created and subsequently pushed to the device.
When prompted, you’ll need to launch the installed application on the iOS device – this manual step is required in order for Visual Studio to attach the debugger.
And there you have it – you now have an iOS application being debugged using Visual Studio on an actual device with no Mac required!!!
I don't have a physical Mac at the moment but I have a IPhone which I love! So how do I get my app running on my phone?

If you are like me this guide will help you get your Xamarin app to your IPhone (and your testers IPhones) without needing to buy a Mac!
TL'DR
To be able to run Xamarin apps legally on your IPhone you will need a physical Mac you'll need to buy an access to a Mac in the cloud.
I can't find information on it but the reason for you needing a Mac to build iOS code is either:
- Apple hasn't made 3rd parties it easy to use their build chain (XCode,etc) so they haven't invested in it
- Apple just doesn't allow it (Eula)
But the fact is that you will need a Mac (legal or not) to build your iOS code so it will run on your phone.
Me and Xamarin
I have been doing Xamarin development on and off since 2014 and dabbling in XCode/ objective-c for 1.5 years in 2011.
I have been doing some light teaching of Xamarin.Forms so I have the developing skills up to date (even though Xamarin is moving fast these days).
But in the last 2 years I have just been using the simulator and this year the LivePlayer in Visual Studio to develop the code.
Its been a long time since I connected a local Mac to Visual Studio to get the apps to my physical device.
The weekend project
So this weekend I wanted to try out some code on my IPhone. I can't use the LivePlayer since I am using the Prism framework and the LivePlayer doesn't work with 3rd party libraries.
And I didn't have a Mac to connect to! And I wasn't going to go out to buy one for this test (it might pay off in the long run though)
So what to do?
Mac in the cloud
Since I had previously (two years ago) bought access to a MacInCloud I decided to do that again since I knew (so I thought) I had some leftover prepaid credits.
What I came to realize was that I had 28 left of my 30 build minutes in the Pay-As-You-Go plan but since I had not logged on in the last 60 days it was void and I need to buy more.
While looking at the plans I saw something new, VSTS Build Agent
Connect MacInCloud to VSTS
So the next step was to connect MacInCloud to VSTS.
I managed to get this working by going over the 'Getting Started with the MacinCloud VSTS Build Agent Plan' guide. Somebody really should update this since some steps were not straight forward in my case.
Now I when I build an iOS app it will use my MacInCloud to do it.
VSTS (Azure DevOps)
So what I first thought of was to open up VSTS and check if I could use the build tasks there to build and deploy a app.
So I added a Xamarin.iOS build step and got this (overload).
I tried to config and run this build and got some errors and warnings so I decided to quit that route and try something else and easier to start up (AppCenter).
I know VSTS is very powerful because I work with it every day. But I just wanted to get my mobile app pipeline up and running fast. I really didn't want to spend more time than needed setting this up.
And maybe it wasn't so hard in VSTS but I didn't want to find out. I'll try it out next time.
AppCenter
Last year I used AppCenter for building and distributing Android apps so I knew (hoped) it would be a little easier to setup.
I'm not going to show you how to setup an app in AppCenter and hook it up to your repository since they do a good job of guiding you through the process.
The build configuration
Run Xamarin App On Ios Device Without Mac
So for distributed test (Ad-Hoc) apps you will need to set up the build configuration as following in AppCenter.
Xamarin Ios App Without Macbook
And then upload your provisioning profile and certificate (that I'm going to show you how to create).
Provisioning profile and certificates (.p12)
This was the thing that took me the longest to do!
Everybody that has ever tried to get an app to the store or even to their testers know this. Articles like 'Why I hate iOS as a developer' are a testament of that.
This is totally normal when dealing with Apple but its still easier if you have a Mac!
Again this all would have been a breeze if I had had a Mac. Because then I could probably have used use the new Automatic provisioning to do deal with this all for me.
By combining Automatic provisioning with a Pay-As-You-Go subscription (paired to Visual Studio) I could have had these files.
.CSR .mobileprovision .cer .p12/.pfx
Xamarin Ios Development
Yes... Welcome to the jungle!

I tried to find out how to do this and just got lost fast.
I had allready found this article 'Where do I get the code signing files I need' but it told me nothing about how to create the these files on Windows.
.CSR
To create a certificate in you Apple development portal you need a .CSR file. There are millions of examples on how to do it on a Mac when doing iOS mobile developement. But I did´t see any (there probably are) mentioning that.
So I googled 'creating a .csr file on windows' that led me to downloading the CSR creation program where I filled out the information about me and saved the .csr file.
Then I was able to choose 'App Store and Hoc' type of certificate in the Apple portal and upload the .CSR and create the certificate!
Create a Ad Hoc provisioning profile
Next step is to create a provisioning profile for Ad Hoc. You will need a device setup under Devices where you need the UDID of your phone. You can get it by using e.g SuperUDIDI.
Download .mobileprovisionin
Download the provisioning profile (.mobileprovision). You'll need to upload it to AppCenter.
Download and install/extract .cer/.p12
Then you need to download the certificate you created. Double click it and install on your computer under your user and then export the private key to a .pfx file (.pfx .p12).
Upload .mobileprovisionin and .pfx file to AppCenter

Just that. Upload these two files to AppCenter and you should be ready to go.
Queue a build in AppCenter
Now you should be able to build the app and get a notification email where you are can just download and install the new version of the app.
There where few other problems I had getting this up and running. They where mostly easily fixed.
'Project bundle identifier 'com.companyname.xx' does not match specified provisioning profile'
Open the Info.plist in Visual Studio and change the Bundle Identifier to the one you set in the Apple development portal.
You don't get an email after successful build?
I was so excited when the build got green! It said 'App distributed'. I waited for 20 minutes and no notification!
For some reason I (the only user anywhere) wasn't in the distribution group! So just make sure you are in the group set to get the updates.
So is it worth it or should I get a Mac?
I think I will look around and see if I can find a used older Mac Mini after this trial month. Lets see how many hours of build time I really need.
But at the moment I will be developing Xamarin.Forms using the simulator. And when I want/need to try the app on my IPhone I will just queue a build.
Summary
I'm sorry if some steps in here aren't as super detailed as I think they need to be.
The reason for it is that I thought setting this all up wouldn't be a problem. Specially after watching so many (obviously 'hello world') CI/CD videos.
I just didn't start taking notes on what I was doing until after I was c.a 30% done.
If I ever need to do this again or help somebody else to do it I'll add more details to this article.
But I really hope somebody learned something reading this.
p.s
Will it pay off in the long run just to buy a Mac Mini? Yes I think so. It would take c.a 1 year to pay up the Mac Mini vs. MacInCloud, so I'm thinking of getting one eventually.