检测崩溃Android的自动化

时间:2018-02-05 15:07:13

标签: android

我的应用程序有77种产品口味。我发现了一个已经检测到的崩溃,但我不知道它可能是哪种味道。如何自动检测其中一个站点的崩溃过程?

2 个答案:

答案 0 :(得分:0)

Firebase崩溃报告 崩溃报告会创建应用程序中错误的详细报告。错误根据具有相似堆栈跟踪的问题分组,并根据对用户的影响严重程度进行分类。除自动报告外,您还可以记录自定义事件,以帮助捕获导致崩溃的步骤。

要报告服务器端错误,我们建议使用Google Stackdriver错误报告,它支持Node.js,Python,Go,Java,PHP和Ruby错误。

答案 1 :(得分:0)

试试这个:

// The following code allows an app to report Crashlytics crashes separately 
// for release and debug buildTypes when using Gradle. This code should be inserted 
// into the specified locations within your build.gradle (Module:app) file

    // The buildTypes { } block should be inserted inside the android { } block
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            ext.crashlyticsApiSecret = "release api secret"
            ext.crashlyticsApiKey = "release api key"
        }
        debug {
            ext.crashlyticsApiSecret = "debug api secret"
            ext.crashlyticsApiKey = "debug api key"
        }
    }

// The following code can be inserted at the bottom of your build.gradle file
import com.crashlytics.tools.utils.PropertiesUtils

File crashlyticsProperties = new File("${project.projectDir.absolutePath}/fabric.properties")
android.applicationVariants.all { variant ->
    def variantSuffix = variant.name.capitalize()
    def generateResourcesTask = project.tasks.getByName("fabricGenerateResources${variantSuffix}")
    def generatePropertiesTask = task("fabricGenerateProperties${variantSuffix}") << {
        Properties properties = new Properties()
        println "...copying apiSecret for ${variant.name}"
        properties.put("apiSecret", variant.buildType.ext.crashlyticsApiSecret)
        println "...copying apiKey for ${variant.name}"
        properties.put("apiKey", variant.buildType.ext.crashlyticsApiKey)
        PropertiesUtils.injectPropertyInFile(crashlyticsProperties, properties, "")
    }
    generateResourcesTask.dependsOn generatePropertiesTask
}

有关详细信息,请阅读this GitHub postthis Stack Overflow post