简体   繁体   English

多个Android开发人员使用Fabric.io的Crashlytics

[英]Multiple android developers using Crashlytics of Fabric.io

We are a team of developers and just started using Crashlytics. 我们是一个开发人员团队,刚刚开始使用Crashlytics。 Most of us have the exact same model of device that is used for testing. 我们大多数人都具有用于测试的完全相同的设备模型。

When a crash happens, how can we identify which device it relates to. 当发生崩溃时,我们如何识别与之相关的设备。 In other words, how do we know if a crash is on the device of Developer A or B. 换句话说,我们如何知道开发人员A或B的设备是否崩溃。

The most correct way to distinct devices one from another is by sending IMEI when crash happens. 将设备彼此区分开的最正确方法是在发生崩溃时发送IMEI。 There aren't two identical IMEIs in the world. 世界上没有两个完全相同的IMEI。

public void sendImei(Context vContext) {

    String imei;
    TelephonyManager tm = (TelephonyManager) vContext.getSystemService(Context.TELEPHONY_SERVICE);
    if (tm != null)
        imei = tm.getDeviceId();
    if (imei == null || imei.length() == 0)
        imei = Secure.getString(vContext.getContentResolver(), Secure.ANDROID_ID);

    Crashlytics.setUserIdentifier(String.valueOf(imei));

}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM