Android Needs A Simulator, Not An Emulator
jakewharton.com
jakewharton.com
I guess I don't see the point of a simulator either. If the performance is that bad, why not just use hardware?
I just built a not-particularly-large app after making a single-line change and it took 16 seconds to compile, dex, package and install on a running x86 emulator. The installation time is appreciable (4 seconds for my 10MB APK), which would be cut to zero for a simulator. Similarly, removing the dexing and packaging would be a great help.
I'm jealous when I see how fast my iOS colleagues can make code tweaks and see them running on a simulator one second later.
Edit: I suppose I should ask a more concrete question: would you pay for a service like this? If not, what would you use instead?
Doubtful it would work any better than the custom VM solution that Genymotion (mentioned in the article) does (for this specific pain-point).
I would still need to adb deploy my apk to the device (which is a process that really drags development even when doing it to local devices) and now its even worse because it is remote. Also this remoteness would add all sorts of new issues like that fact that if I'm developing a server in tandem with the client app, now I have to jump through hoops to make the server remotely accessible (so your service devices can see it) whereas otherwise I might just be running it locally in a non-publicly accessible way for development purposes (solvable problem, but still a lot of friction and this request for a simulator is all about removing such friction).
Android devices as a service is still a good idea for other things like testing & QA because while Android fragmentation isn't as bad as it used to be, you still do see device-specific bugs (or at least platform-specific, like TouchWiz bugs on Samsung devices that don't impact other versions of Android) quite often when developing and having access to specific devices would help in such situations, but I don't think it addresses any of the main problems that are driving this request for iOS-style simulation (which, FWIW, I totally agree with Jake Wharton on).
There are some kinds of sensors with variable quality that some developers claim leads to a need for testing every device. I would write code that characterizes performance instead, and possibly blacklist some known bad devices.
I've used it fairly extensively, it can be a bit buggy and slow, but it was instrumental in tracking down a bug just after launching an Android app.
People were leaving 1-star reviews, saying the app simply hard crashed at launch. We couldn't replicate the issue in any way on any of our ~10 physical devices we used for testing, or in any VM, but, with the service, we were able to isolate it exclusively to a handful of Android 2.3.3 devices with less than 512mb of memory. After that it was much easier to track down the source of the bug, fix it, and stem the flow of bad reviews.
Android is so fragmented among versions and devices that in the future I'd always want to use a service like this to at the very least make sure the app opens and runs across a slew of devices before launching.
[0] : http://www.keynote.com/solutions/testing/mobile-testing
Somewhat unfortunately, I've found the connection fairly unstable, and they don't factory reset between uses (so unless you remove your APK, it'll stay on the device and configurations persist).
[1]: http://developer.samsung.com/remotetestlab/rtlDeviceList.act...
That said, I would love a "simulator" since it would probably mean that Google has wrapped the JDK with an Android interface which frees me from having to every use Swing/SWT/any other java gui toolkit here ever again.
I get it. Ironically Google didn't copy Apple for once, and their solution turned out bad. So now they need to ironically copy it, please, Google, pretty please. But the real irony is that Android developers both get to boast about Android being open source, yet when they need something, they go beg Google implement it for them.
And Google really can't implement an efficient iOS simulator for them, because there's no Android desktop operating system.
You see, while it's getting a bit old to hear Tim Cook brag at every keynote about how "only Apple can make everything work seamlessly together", truth is, they indeed share a kernel and over half their APIs between their desktop and mobile operating systems. This is why the iOS simulator is that good. Tim Cook knows it.
While a supposed "thin layer" Android simulator has to interface all its APIs with Windows and then do it all over again for OSX, and then again for Linux (common POSIX APIs notwithstanding), every version with its unique quirks and bugs, not matching the platform it's simulating.
So instead of that ball of pain, Google chose the easier task of virtualizing the actual hardware and then running the whole Android stack on top of that.
In their particular circumstances, this was, and remains the only feasible way of doing it, and no amount of blog whining will change that.
Turns out you really can't copy some things so easily.
The x86 Android build provided by GenyMotion (cited in the article) performs at the same speed as the x86 iPhone simulator.
It has two major issues:
- The UI is quirky (but usable)
- It's expensive
- GenyMotion devices have no Google Play by default. Want to test how your website runs in Chrome? Spend ages hacking Google Play onto the Android device.
Google could fix all of these things easily.
This is on a 2013 Haswell MBA with 8GB RAM and a 512GB SSD.
Google may as well throw the official emulator away.
Did you enable the "Use host GPU" option?
Technically you can, it's just hard to do and should be there by default (I very much agree in spirit).
To me Genymotion is what Android "should" have, and it's already here.