Skip to content

Instantly share code, notes, and snippets.

@Axrorxoja
Created February 20, 2019 05:46
Show Gist options
  • Save Axrorxoja/da0bfaf6152b84505782e0b9c4f43ae3 to your computer and use it in GitHub Desktop.
Save Axrorxoja/da0bfaf6152b84505782e0b9c4f43ae3 to your computer and use it in GitHub Desktop.
isEmulator():Boolean
private fun isEmulator(): Boolean {
return (Build.FINGERPRINT.startsWith("generic")
|| Build.FINGERPRINT.startsWith("unknown")
|| Build.MODEL.contains("google_sdk")
|| Build.MODEL.contains("Emulator")
|| Build.MODEL.contains("Android SDK built for x86")
|| Build.MANUFACTURER.contains("Genymotion")
|| Build.BRAND.startsWith("generic") && Build.DEVICE.startsWith("generic")
|| "google_sdk" == Build.PRODUCT)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment