TelephonyManager telmgr = ( TelephonyManager ) getSystemService ( Context . TELEPHONY_SERVICE );
String
deviceID
=
telmgr
.
getDeviceId
();
boolean
isEmulator
=
"000000000000000"
.
equalsIgnoreCase
(
deviceID
);
if (isEmulator) {
// 模拟器代码
} else {
// 真机代码
}