Giter Site home page Giter Site logo

footprint / xcrash Goto Github PK

View Code? Open in Web Editor NEW

This project forked from iqiyi/xcrash

0.0 0.0 0.0 2.85 MB

πŸ”₯ 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.

License: Other

C 87.35% Java 12.45% CMake 0.21%

xcrash's Introduction

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.1 - 11 (API level 16 - 30).
  • Support 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:3.0.0'
}

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

android {
    defaultConfig {
        ndk {
            abiFilters '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 xcrash_sample folder.

Build

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

Build AAR library.

./gradlew :xcrash_lib:build

Support

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.

xcrash's People

Contributors

caikelun avatar xuqnqn avatar simpleton avatar timgates42 avatar vhow avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.