Languages

Menu
Sites
Language
Determine if running emulator (or simulator) at runtime

Hello!!

Is it possible for my javascript code using tizen 2.3.1 for wearable to determine whether the app is running on the emulator or on the web simulator?

 

 

Edited by: Alan Buch on 10 Nov, 2018
View Selected Answer

Responses

4 Replies
K Johnson

Why do you need to know this in runtime? You may run your app either on emulator/simulator to see how your app will look on a real device. Would you please share the details about what you're trying to do?

Alan Buch

When running on the simulator or the emulator, the timezone is incorrect.  The timezone on the simulator is GMT and the timezone on the emulator is Asia/Korea.  When testing my watchface, i need the timezone to be accurate for my location.  Therefore, if the watchface is in debug mode and running on the simulator I want to adjust the time by -5 (for eastern timezone) or if running on the emulator, by -14.  Of course alternatively, if there's a way to set the timezone on the simulator or emulator, that'd be better - but I've found no such setting for either.

Mark as answer
K Johnson

So far I know, you may change date/time in root mode using sdb shell command. Please go through this link

But, in this scenario, I would like to suggest you to test on real device instead of simulator/emulator. 

Alan Buch

Thanks, marked as answer.  Too bad that setting doesn't persist so that next time the emulator starts, it "remembers".  Also too bad that Samsung didn't allow for changing the time/date from the emulator's control panel and the timezone according to the control panel location - actually, on this latter point, I can't get the location feature of the control panel to work, so maybe it does adjust the time zone when changing the location, I just can't change locations...