6 Star 75 Fork 27

Gitee 极速下载 / xCrash

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/iqiyi/xCrash
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

xCrash Logo

xCrash

xCrash 能为安卓 app 提供捕获 java 崩溃,native 崩溃和 ANR 的能力。不需要 root 权限或任何系统权限。

intro

xCrash 能在 app 进程崩溃或 ANR 时,在你指定的目录中生成一个 tombstone 文件(格式与安卓系统的 tombstone 文件类似)。

xCrash 已经在 爱奇艺 的不同平台(手机,平板,电视)的很多安卓 app(包括爱奇艺视频)中被使用了很多年。

README English Version

特征

  • 支持 Android 4.1 - 11(API level 16 - 30)。
  • 支持 armeabi-v7a,arm64-v8a,x86 和 x86_64。
  • 捕获 java 崩溃,native 崩溃和 ANR。
  • 获取详细的进程、线程、内存、FD、网络统计信息。
  • 通过正则表达式设置需要获取哪些线程的信息。
  • 不需要 root 权限或任何系统权限。

Tombstone 文件预览

概览图

架构

architecture

捕获 native 崩溃

capture native crash

捕获 ANR

capture anr

使用

1. 增加依赖。

dependencies {
    implementation 'com.iqiyi.xcrash:xcrash-android-lib:3.0.0'
}

2. 指定一个或多个你需要的 ABI。

android {
    defaultConfig {
        ndk {
            abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
        }
    }
}

3. 初始化 xCrash。

Java

public class MyCustomApplication extends Application {

    @Override
    protected void attachBaseContext(Context base) {
        super.attachBaseContext(base);
        
        xcrash.XCrash.init(this);
    }
}

Kotlin

class MyCustomApplication : Application() {

    override fun attachBaseContext(base: Context) {
        super.attachBaseContext(base)

        xcrash.XCrash.init(this)
    }
}

Tombstone 文件默认将被写入到 Context#getFilesDir() + "/tombstones" 目录。(通常在: /data/data/PACKAGE_NAME/files/tombstones

xcrash_sample 文件夹中,有一个更实际和复杂的示例 app。

构建

编译 xCrash AAR 库:

./gradlew :xcrash_lib:build

技术支持

贡献

请阅读 xCrash Contributing Guide

许可证

xCrash 使用 MIT 许可证

xCrash 的文档使用 Creative Commons 许可证

空文件

简介

xCrash 能为安卓 APP 提供捕获 java 崩溃、native 崩溃和 ANR 的能力 展开 收起
C/C++ 等 3 种语言
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
C/C++
1
https://gitee.com/mirrors/xCrash.git
git@gitee.com:mirrors/xCrash.git
mirrors
xCrash
xCrash
master

搜索帮助