Any way to determine at runtime whether you're running on device or simulator?
The title pretty much asks it all :) Thanks.
3 Answers
-
Nevermind… I figured it out. For anyone else that is interested it's in the Titanium.Platform obj
Titanium.Platform.model is 'Simulator'
and
Titanium.Platform.username is 'iPhone Simulator'
-
1.7.2 has changed things so that Titanium.Platform.model is now set to 'iPhone Simulator' when running in the simulator. Why the change? - that broke all my code!!
-
A colleague I work with has to look for this value from Ti.Platform.model when checking to see if the app is running in the simulator… 'x86_64'.
For me the iPhone simulator shows as 'Simulator'.