Assuming you are targeting multiple platforms – most likely iOS and Android and some Windows too – you would need a Mac to compile your cross-platform solution for iOS.
As it appears, when using the Cordova framework for your project you can build iOS and Android from your Mac, but not target Windows from it. From a Windows machine, you can target Windows and Android but not iOS (since compiling Mac executable code may only be done on a Mac).
That leaves you with at least having to use some sort of Virtual Machine (VM) solution if you don’t want to reboot to reach the other side of your Mac (one partition running Windows, the other one Mac OS X).
In this post I discuss some required stuff for creating cross-platform mobile apps for the top 3 mobile platforms (iOS, Android and Windows) and what Virtual Machine software will be the best setup to enable you to build for them.
Please note (as mentioned in the comments) that Apple’s EULA prohibits you to use a Virtualised Mac OS box on Non-Apple metal. In this post i’m talking about running a Mac with VM to extend- and improve the platform development t0wards other platforms (Android and Windows).
More after the break.
[ad name=”Large Rectangle”]
The Hyper-V factor & Windows apps
If you develop for multiple platforms and Windows is one of them you’re bound to encounter the need for a Hyper-V based Emulator when testing your app for Windows Phone 8. Even the latest Windows 10 emulator – still a pre-release – is based on Microsoft’s Hyper-V VM technology.
And that is a crucial factor when you want to pick the right VM software for your mobile development brick. Since Virtualbox is a very nice free virtualization solution but it doesn’t support Hyper-V yet. Your VM images need to be able to run Hyper-V (called nested virtualization) and Virtualbox just isn’t up for that job.
Fast emulation for Android
A fast running emulator for your Android platform build to test if Android (especially when not using Crosswalk) doesn’t screw up the rendering on different OS versions is a must. If your emulator slows down your code-build-test cycle frustration will rise and the possibility to introduce failures rises along.
One of the things to keep your Android emulator running fast as lightning is NOT using Androids default emulator, but using an emulator solution like Genymotion or Xamarin Android Player which includes fast emulator installment and running your app on different configurations fast & furious. And let it just be fate that these solutions are based on the Virtualbox VM software when it comes to running them on a Mac OS X machine.
Please DO NOTE that this is the truth for both native and hybrid (Cordova based) mobile app solutions
Let’s play nice
Having your Windows VM integrating nicely with your Mac OS side of the force is another important criterium to get your developer box setup for completeness sake and get going for iOS, Android AND Windows apps.
This means that you need to be able to switch the VM fast, start and stop it fast and it should let you pick files from both the VM and Mac OS like it’s one and the same. VM software like Parallels or VMWare Fusion have modes that blend in the Virtual Windows environment to act as if the running software is running on your Mac OS. This has some advantages like:
- all programs run on the same desktop, your Mac OS’s
- copy-paste and other clipboard like stuff works with your Mac shortcuts
- file access is easier either by shared locations (VMWare) on your drive or by entirely linking and making the hard disks accessible (like Parallels)
I got to say though – and no I’m not affiliated in any way – that Parallels has unbeatable integration and that both their hard disk access and integration with the Mac OS is working mighty fine. Both VMWare Fusion and Parallels can run Hyper-V simulators although it’s more of a hassle with VMware and just works out-of-the-box with Parallels.
[ad name=”Large Rectangle”]Wrapping up a.k.a. the verdict
You want to be able to service all customers and get your top 3 mobile platforms (iOS, Android and a sniff of Windows) going for you? Better be prepared to get the best setup:
- Your Mac OS X computer (of course)
- VirtualBox in combination with one of the following Android emulators:
- Genymotion
- Xamarin Android Player
- Parallels (my preferred one for the best clipboard and hard disk integration and seamless app combining)
And there you have it. Download, install and build one to rule them all!
Shai Almog
Notice that if you are not running Mac OS virtualizing Mac OS is against the EULA. You can do it as a hobbyist but obviously not in a business setting.
I think the better approach when you are doing cross platform is to use cloud build approaches e.g. PhoneGap Build was based just on that notion, so are Corona and Codename One.
Check out the convenience of building an app with Codename One then contrast it to the work you have to do above…
eekay
Hey Shai you’re right on the Mac OS virtualisation: one DOES NEED APPLE HARDWARE To run Mac OS and only then virtualising Mac OS is allowed. In the scenario i’m talking about in the post i’m running Mac OS X on Apple hardware and adding VM for testing Android and providing Windows virtualisation. //adding it to my post
I’ve checked out Codename One and yes building on a (cloud based) service that compiles ones project into native – via AppStores – distributable packages is another fine path to take when delivering mobile functionality cross-platform.
My take on that is that it is great that people have the choice to either send their project off to be build by a service and get the platform targeted build in return OR build locally and go from there. Similar to the development language one wants to use (C# for Xamarin, webtech using Cordova or JAVA in case of Codename One) is a matter of taste and experience is the choice for building externally or local. Both are valid and have their value.
Personally, building and testing locally (using VM software on my Mac) enabled me to master a faster code-build-test routine and it allows me to improve and tweak my solution in fast cycles until its result is validated and approved for each native platform. I’ve worked with services like Phonegap Build and waiting for builds to be executed and retrieving the packages, testing them on devices etc don’t seem to be heading the proces on the fast-lane.
When one actually wants to be quick to develop functionality that will work on native platforms with the least of friction, I’m actually turning my head to Cordova/Hybrid based solutions that tend to let you test logic and interfacing as fast as possible with preview apps running on your native target platforms like Ionic Framework. Most of them don’t yet support Windows formally but I bet they will in the near future.
So, although Codename One can and probably has its place in the #mobiledev universe and provides an almost instant setup which will appeal to lots of devs my preference is still installing more VM stuff and giving the high-speed code-build-test cycle precedence.
Edwin Klesman
@codenameone:disqus : you’re right on the Mac OS virtualisation: one DOES NEED APPLE HARDWARE To run Mac OS and only then virtualising Mac OS is allowed. In the scenario i’m talking about in the post i’m running Mac OS X on Apple hardware and adding VM for testing Android and providing Windows virtualisation. //adding it to my post
I’ve checked out Codename One and yes building on a (cloud based) service that compiles ones project into native – via AppStores – distributable packages is a nice alternative path to take for delivering mobile functionality cross-platform.
My take on that is that it is great that people have the choice to either send their project off to be build by a service and get the platform targeted build in return OR build locally and go from there. Similar to the development language one wants to use (C# for Xamarin, webtech using Cordova or JAVA in case of Codename One) is a matter of taste and experience is the choice for building externally or local. Both are valid and have their value.
Personally, building and testing locally (using VM software on my Mac) enabled me to master a faster code-build-test routine and it allows me to improve and tweak my solution in fast cycles until its result is validated and approved for each native platform. I’ve worked with services like Phonegap Build and waiting for builds to be executed and retrieving the packages, testing them on devices etc don’t seem to be heading the proces on the fast-lane.
When one actually wants to be quick to develop functionality that will work on native platforms with the least of friction, I’m actually turning my head to Cordova/Hybrid based solutions that tend to let you test logic and interfacing as fast as possible with preview apps running on your native target platforms like Ionic Framework. Most of them don’t yet support Windows formally but I bet they will in the near future.
So, although Codename One can and probably has its place in the #mobiledev universe and provides an almost instant setup which will appeal to lots of devs my preference is still installing more VM stuff and giving the high-speed code-build-test cycle precedence.
Shai Almog
Agreed, just to clarify though: when you do Codename One development you debug locally with the simulator and only send builds to the cloud when you need to run on the device. So 90%+ of your work would be in the simulator.
This is really helpful with Java’s tools/debuggers that are really state of the art compared to everything else out there.