How do I detect running in emulator vs real device?

As a matter of fact, I did not even figure out how to do this with just Cordova.
I found this but does not seems to work anymore. device.platform gives me iOS device.model gives me x86_64
I filed a JIRA to Cordova but I wonder if anyone here knows anything.

Thank you!

Hmm, good question. Just did a quick test, and it seems that emulator returns model: "x86_64" when getting the model