Speaking of Android specifically - it's Java, it has very well designed APIs and the SDK provides an emulator which can simulate varying types of hardware - different screen sizes and resolutions, Wifi only, Wifi+3G, Accelerometer vs no Accelerometer etc. So for 95+% of the apps - they just code it and test it on one real device and run it through the emulator if they are paranoid.
That all might end soon. Now that IBM have joined sides with Oracle, Harmony doesn't have a very bright future.