As a mobile developer, you cannot afford working only in one platform, If you want your application to reach large audience you will need to have your application in both Google store (For Android users) and in the AppStore (For iPhone users) many development tools and environment allow to create a cross platform applications (React Native and Flutter are just two examples)
All is well , you build your app, and test it in the IDE but then you need to actually publish it.
Apple users have no problem whatsoever, but when it comes to Windows/Linux users, it is more complicated, to compile your application and to upload it to the Apple AppStore, you need XCode!
and this is exactly where most developers are stuck:
“Do I really need to buy a $3000US Mac to upload my app?”
“Should I rent a virtual Mac in the cloud?”
Well, I have a better solution for you, run it as a virtual machine on your PC!
Most of the advanced computer users today are running some kind of Virtual machine on there computer , whether they know it or not.
- An Emulator or Simulator of a mobile phone for a development environment is a kind of Virtual Machine.
- Docker or K8’s containers are actually virtual machine , though much more sophisticated.
- Where is many types of Virtual Machines , some are even built-in in Windows 10, Hyper-V engine allows to run the integrated Linux core.
- Even the well known Sandbox is a kind of virtual based snapshot based environment running under your operating system.
But when speaking about easy to deploy Virtual environment for you PC, you will probably hear people speaking about:
- Oracle’s Virtual Box
- VMware Workstation / Fusion.
I personally prefer VMware Workstation because of the flexibility and the ability to connect and “Transfer” everything from the PC (the Host) to the Virtual machine.
As a mobile developer, I have decided to try to install a Mac virtual machine, Its not a very complicated procedure and after few struggles few upgrades ( I initially installed the 10.15.2 / xCode 11.2 , I have managed to install Mac OS 10.15.5 and Catalina as a virtual machine on my PC.
Stay tuned, a full tutorial will be added soon
Note: Mac OS, by definition has high hardware demands, to work smoothly, you will need:
- At least 2 cores of Core i7 Processor.
- At least 8 GB of RAM
- Around 100GB of storage , preferably SSD (NVME highly suggested).
some make sure that your PC have the resources to give to the virtual machine.
Back to square one, we want to allow compile and upload of the application we have built elsewhere to the App-Store.
xCode is downloaded free from the Mac App-Store (with your Apple ID) and you can test your up with a simulator.
To publish the app to AppStore you will need an Apple developer account ($99US a year).
But funnily, the biggest problem I had in this process is actually connecting my physical iPhone to the xCode in the virtual machine.
Everywhere I looked for , they say you should just share it in the VM settings, and attach it to the virtual machine, but in my case , it was just not working!
So After deep investigation of the Virtual machine preferences I have figure out something (quite strange I must admit)
An iPhone will not appear in the Virtual Mac if the settings are the default.
For some strange reason I cannot understand , as long as the USB type is 3.0 (the default version in a virtual machine) – the device will not appear in the list of available USB devices possible to attach to the Virtual machine,
And The solution, simply to change it to USB V2.0!!
If, for some reason, you would like to run Android Simulator (i.e. for Cross platform development) you will need to enable Virtual Intel VT-x processor enhancement, as described in the image below
Can you imagine the surprise I had when suddenly the device (from the Host), appeared at the doorstep of the virtual machine , asking to enter.
So, before it retreats, I connected it , ran my xCode, and there it was, my iPhone was in the list of the devices to build the application with.
Update (Aug 12,2021): If your physical device shows an error in XCode “Unsupported OS Version” or not connecting to other IDEs (like Android Studio), refer to the MacOS / XCode / iOS Co-Existence post describing the way to overcome incompatibility problems.
And now I can proudly say , my applications , built with Flutter, are running not only on my Android devices , but installed on my iPhone , and soon to be uploaded to the AppStore.
Any comments will be appreciated.