请教怎么判断设备是否是android的模拟器

如题所述

第1个回答  2017-03-25
/** 判断是否模拟器。如果返回TRUE,则当前是模拟器 * @param context * @return */ public static boolean isEmulator(Context context){ TelephonyManager tm = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE); String imei = tm.getDeviceId(); if (imei == null imei.equals("000000000000000")){ return true; } return false; }这个方法没大量测试过,应该是WORK的,一般真机都有IMEI的,不过也见过工程机的IMEI是000000000000000还是0。
相似回答
大家正在搜