//判断当前设备是否是模拟器。如果返回TRUE,则当前是模拟器,不是返回FALSE
public static boolean isEmulator(Context context){
try{
TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
String imei = tm.getDeviceId();
if (imei != null && imei.equals("000000000000000")){
return true;
}
return (Build.MODEL.equals("sdk")) || (Build.MODEL.equals("google_sdk"));
}catch (Exception ioe) {
}
return false;
}
最后
以上就是矮小黑夜最近收集整理的关于判断是否是模拟器的全部内容,更多相关判断是否是模拟器内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复