# xCrash **Repository Path**: cmzl_ohos/xcrash ## Basic Information - **Project Name**: xCrash - **Description**: 提供捕获 java 崩溃,native 崩溃和 ANR 的能力。不需要 root 权限或任何系统权限 - **Primary Language**: Unknown - **License**: CC-BY-4.0 - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2021-07-12 - **Last Updated**: 2024-06-02 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # xcrash xCrash为 app 提供捕获 java 崩溃,native 崩溃和 ANR 的能力。不需要 root 权限或任何系统权限 ![overview](screenShoot/xCrash.gif) ### 功能介绍 - 支持 arm64-v8a。 - 捕获 java 崩溃,native 崩溃和 ANR。 - 获取详细的进程、线程、内存、FD、网络统计信息。 - 通过正则表达式设置需要获取哪些线程的信息。 - 不需要 root 权限或任何系统权限 ### 集成 ##### 方法1: 直接使用har包 ``` 通过library生成har包,添加har包到要集成的libs文件夹内 在entry的gradle内添加如下代码 implementation fileTree(dir: 'libs', include: ['*.jar', '*.har', '*.so']) ``` ##### 方法2: gradle依赖 ``` allprojects{ repositories{ mavenCentral() } } implementation "com.gitee.archermind-ti:xcrash-ohos-lib:1.0.0-beta" ``` ### entry运行要求 ``` sdk5模拟器运行需要配置apiVersion字段: "compatible": 5, "target": 5, "releaseType": "Beta1" 将项目中的build.gradle文件中dependencies→classpath版本改为对应的版本(即你的IDE新建项目中所用的版本) ``` ### 使用说明 - Java初始化xCrash ``` public class MyApplication extends AbilityPackage { @Override protected void attachBaseContext(Context base) { super.attachBaseContext(base); XCrash.init(this); } } ``` Tombstone 文件默认将被写入到 `Context#getFilesDir() + "/tombstones"` 目录。(通常在: `/data/data/PACKAGE_NAME/files/tombstones`) ### 遗留问题 so库不全,导致打印日志的缺失 ### License - xCrash is MIT licensed, as found in the [LICENSE](LICENSE) file. - xCrash documentation is Creative Commons licensed, as found in the [LICENSE-docs](LICENSE-docs) file.