1 Star 0 Fork 28

jn7163 / xCrash

forked from Gitee 极速下载 / xCrash 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
README.md 4.40 KB
一键复制 编辑 原始数据 按行查看 历史
yueming 提交于 2020-01-08 16:35 . [version] 2.5.0. Upgrading to NDK r20b.

xCrash Logo

xCrash

xCrash provides the Android app with the ability to capture java crash, native crash and ANR. No root permission or any system permissions are required.

intro

xCrash can generate a tombstone file (similar format as Android system's tombstone file) in the directory you specified when the app process crashes or ANRs.

xCrash has been used in many Android apps (including iQIYI video) on different platforms (mobile, tablet, TV) of iQIYI for many years.

README 中文版

Features

  • Support Android 4.0 - 10 (API level 14 - 29).
  • Support armeabi, armeabi-v7a, arm64-v8a, x86 and x86_64.
  • Capturing java crash, native crash and ANR.
  • Dumping detailed statistics about process, threads, memory, FD and network.
  • Setting which thread's info should be dumped via regular expressions.
  • Do not require root permission or any system permissions.

Tombstone File Previews

Overview Maps

Architecture

architecture

Capture Native Crash

capture native crash

Capture ANR

capture anr

Usage

1. Add dependency.

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

2. Specify one or more ABI(s) you need.

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

3. Initialize 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 files will be written to Context#getFilesDir() + "/tombstones" directory by default. (usually in: /data/data/PACKAGE_NAME/files/tombstones)

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

Build

If you want to build xCrash from source code. Follow this guide:

1. Download Android NDK r20b, set PATH environment.

2. Build and copy the native libraries.

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

3. Build AAR library.

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

Support

  1. Check the xcrash-sample.
  2. Communicate on GitHub issues.
  3. Email: caikelun@gmail.com
  4. QQ group: 603635869. QR code:

qq group

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/C++
1
https://gitee.com/jn7163/xCrash.git
git@gitee.com:jn7163/xCrash.git
jn7163
xCrash
xCrash
master

搜索帮助