1 Star 0 Fork 12

芝麻科技 / xCrash

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
README.md 2.93 KB
一键复制 编辑 原始数据 按行查看 历史
caikelun 提交于 2019-04-08 11:13 . [doc] Update readme files.

xCrash

xCrash is a crash reporting library for Android APPs. It support catching native crash and Java exception.

xCrash can generate a tombstone file (similar format as Android system's tombstone file) in the directory you specified when the APP process crashes. And, no root permission or any system permissions are required.

xCrash is used in a variety of Android APPs (including iQIYI Video) from iQIYI for many years.

README 中文版

Features

  • Support Android 4.0 - 9.0 (API level 14 - 28).
  • Support armeabi, armeabi-v7a, arm64-v8a, x86 and x86_64.
  • Catching native crash and Java exception.
  • Setting which thread's info should be dumped via regular expressions.
  • Dumping detailed memory usage statistics.
  • Do not require root permission or any system permissions.

Catching Native Crash

catching native crash

Usage

1. Adding dependency.

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

2. Specifying ABI(s) you need.

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

3. Adding ProGuard rules.

-keep class xcrash.NativeCrashHandler {
    native <methods>;
    void callback(...);
}

4. Initialize xCrash in Application#attachBaseContext().

public class MyCustomApplication extends Application {

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

Tombstone files will be written to Context#getFilesDir() + "/tombstones" directory by default. (usually in: /data/data/<APP_PACKAGE_NAME>/files/tombstones)

There is a more practical and complex sample APP in the src/java/xcrash/xcrash_sample folder.

Build

1. Download Android NDK r16b, set PATH environment.

2. Build and install the native libraries.

cd ./src/native/
./build.sh
./install.sh

3. Build AAR library.

cd ./src/java/xcrash/
./gradlew :xcrash_lib:build

Contributing

See xCrash Contributing Guide.

License

xCrash is MIT licensed, as found in the LICENSE file.

xCrash documentation is Creative Commons licensed, as found in the LICENSE-docs file.

C
1
https://gitee.com/sesametech-group/xCrash.git
git@gitee.com:sesametech-group/xCrash.git
sesametech-group
xCrash
xCrash
master

搜索帮助