Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
9c94c54
Create a logo for xCrash. Good luck!
caikelun Dec 8, 2019
9ce3a1b
[bug] Fix FD info error in java crash tombstone.
caikelun Dec 19, 2019
4748d18
[improve] Upgrade Android Gradle plugin from 3.5.2 to 3.5.3.
caikelun Dec 19, 2019
f33f65d
[version] 2.5.0. Upgrading to NDK r20b.
Jan 8, 2020
8ae97fe
Opt with Oz and LTO.
Mar 4, 2020
9b61858
Merge branch 'dev' into 'master'
Mar 4, 2020
2b5ea28
collect MD5, filesize, lastModifyDate for the so files that meet Unsa…
May 12, 2020
5326846
adjust date format and a code defect
May 15, 2020
4105f63
correct xCrash version number
May 27, 2020
dddbd21
change version num
May 27, 2020
65fb0a3
get SIGABRT while dump ANR trace, make it continue to dump other info…
Jun 9, 2020
adf1285
got SIGABRT after dump ANR trace, create a new trace callback thread …
Jun 9, 2020
dfd2529
new version num
Jun 9, 2020
03271ab
dump trace backup thread should be joinable
Jun 11, 2020
df6d9e9
add a missed close(fd)
Jun 11, 2020
0d53a2a
publish v2.5.3 xCrash lib to maven
Jun 11, 2020
4a2e609
use sigsetjmp & siglongjmp for handling ANR dumping's abort, removed …
Jul 1, 2020
d7899b7
skip segv error in some devices's libunwind.so while dumping trace fo…
Jul 8, 2020
0551be7
update to version 2.5.5
Jul 9, 2020
dfa22bc
don't rethow sigquit to art, if art dump trace crash and siglongjmp t…
Jul 17, 2020
a8046d3
add debug so back cmd
Jul 17, 2020
b2a4975
optimize install.sh
Jul 17, 2020
e8a4bb9
fix xCrash 2.5.6's bug for causing normal SIGSEGV and SIGABORT not co…
Jul 22, 2020
48655f7
小米机型获取方式调整的适配(Build.MODEL)
Jul 22, 2020
67b1b1b
add anr crash signal SIGBUS according to on-line crash record
Jul 29, 2020
431c836
add backup debug so for download/upload to jfrog
Jul 31, 2020
3a8372c
fix script error
Aug 3, 2020
30c08b8
add more lib path to check when meet UnsatisfiedLinkError
Sep 10, 2020
ff01a8f
rm signal limitation for anr handling crash
Aug 17, 2020
774a050
rm extra info in install.sh
Sep 10, 2020
d01b4a2
refine code for "UnsatisfiedLinkError" exception handle
xuqnqn Sep 11, 2020
a015bad
fix compiling error when using android-ndk-r21b toolchain
xuqnqn Sep 21, 2020
3f7cb56
fix for compiling error with ndk r21b
xuqnqn Sep 21, 2020
4e4b804
fix code style error
xuqnqn Sep 21, 2020
708a24f
upgrade xcrash to support android 11
xuqnqn Sep 30, 2020
f7b1152
merge dev branch's fix for ndk-21
xuqnqn Sep 30, 2020
484654e
new xcrash version 2.5.8
xuqnqn Sep 30, 2020
f9d0261
Change version to 2.5.9-beta
xuqnqn Sep 30, 2020
f9febb1
version 2.5.9
xuqnqn Oct 14, 2020
f3cd5a8
Use CMake instead of ndk-build, Support AddressSanitizer(ASan), refac…
xuqnqn Oct 27, 2020
df83fca
add iqiyi xcrash dependency in sample project
xuqnqn Oct 27, 2020
78bb54a
docs: fix simple typo, lenghts -> lengths
timgates42 Nov 27, 2020
1e74a94
Merge pull request #59 from timgates42/bugfix_typo_lengths
xuqnqn Nov 27, 2020
58c113a
remove unnecessary `String.valueOf()` call
vhow Aug 29, 2021
f117579
Merge pull request #93 from vhow/pr
xuqnqn Aug 31, 2021
b27ef0a
migrate from jcenter to mavenCentral
Jan 24, 2022
16dff88
add anr trace fast callback, avoid to call getRunningAppProcesses, etc
Jan 24, 2022
1e47e97
Merge branch 'dev'
caikelun Apr 25, 2022
457066c
Upgrade readme.
caikelun Apr 25, 2022
6689c5a
Update README.md
caikelun Jun 27, 2025
86dea4f
Update README.zh-CN.md
caikelun Jun 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
.DS_Store

libs/
obj/

build/
.cxx/
.gradle/
.idea/
*.iml
*.log
*.so
wrap.sh
local.properties
45 changes: 16 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
<p align="center"><img src="doc/xcrash_logo.png" alt="xCrash Logo" width="450px"></p>

# xCrash

![](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)
![](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat)
![](https://img.shields.io/badge/release-2.4.8-red.svg?style=flat)
![](https://img.shields.io/badge/Android-4.0%20--%2010-blue.svg?style=flat)
![](https://img.shields.io/badge/arch-armeabi%20%7C%20armeabi--v7a%20%7C%20arm64--v8a%20%7C%20x86%20%7C%20x86__64-blue.svg?style=flat)
![](https://img.shields.io/badge/release-3.0.0-red.svg?style=flat)
![](https://img.shields.io/badge/Android-4.1%20--%2011-blue.svg?style=flat)
![](https://img.shields.io/badge/armeabi--v7a%20%7C%20arm64--v8a%20%7C%20x86%20%7C%20x86__64-blue.svg?style=flat)

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.

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.

<p align="left"><img src="doc/intro.png" alt="intro" width="320px"></p>

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](http://www.iqiyi.com/) for many years.

[README 中文版](README.zh-CN.md)


## Features

* Support Android 4.0 - 10 (API level 14 - 29).
* Support armeabi, armeabi-v7a, arm64-v8a, x86 and x86_64.
* 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.
Expand All @@ -30,12 +32,10 @@ xCrash has been used in many Android apps (including iQIYI video) on different p
## Tombstone File Previews

* [java crash](doc/tombstone_java.txt)
* [native crash (armeabi)](doc/tombstone_native_armeabi.txt)
* [native crash (armeabi-v7a)](doc/tombstone_native_armeabi-v7a.txt)
* [native crash (arm64-v8a)](doc/tombstone_native_arm64-v8a.txt)
* [native crash (x86)](doc/tombstone_native_x86.txt)
* [native crash (x86_64)](doc/tombstone_native_x86_64.txt)
* [ANR (armeabi)](doc/tombstone_anr_armeabi.txt)
* [ANR (armeabi-v7a)](doc/tombstone_anr_armeabi-v7a.txt)
* [ANR (arm64-v8a)](doc/tombstone_anr_arm64-v8a.txt)
* [ANR (x86)](doc/tombstone_anr_x86.txt)
Expand All @@ -62,7 +62,7 @@ xCrash has been used in many Android apps (including iQIYI video) on different p

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

Expand All @@ -72,7 +72,7 @@ dependencies {
android {
defaultConfig {
ndk {
abiFilters 'armeabi', 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
}
}
}
Expand Down Expand Up @@ -109,39 +109,26 @@ class MyCustomApplication : Application() {

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](src/java/xcrash/xcrash_sample) folder.
There is a more practical and complex sample app in the [xcrash_sample](xcrash_sample) folder.


## Build

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

#### 1. Download [Android NDK r16b](https://developer.android.com/ndk/downloads/revision_history.html), set PATH environment.

#### 2. Build and copy the native libraries.
#### Build AAR library.

```
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](src/java/xcrash/xcrash_sample).
2. Communicate on [GitHub issues](https://github.com/iqiyi/xCrash/issues).
3. Email: <a href="mailto:caikelun@gmail.com">caikelun@gmail.com</a>
4. QQ group: 603635869. QR code:

<p align="left"><img src="doc/qq_group.jpg" alt="qq group" width="300px"></p>
* [GitHub Issues](https://github.com/iqiyi/xCrash/issues)
* [GitHub Discussions](https://github.com/iqiyi/xCrash/discussions)
* Email: <a href="mailto:caikelun@gmail.com">caikelun@gmail.com</a>, <a href="mailto:xuqnqn@qq.com">xuqnqn@qq.com</a>


## Contributing
Expand Down
48 changes: 16 additions & 32 deletions README.zh-CN.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
<p align="center"><img src="doc/xcrash_logo.png" alt="xCrash Logo" width="450px"></p>

# xCrash

![](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat)
![](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat)
![](https://img.shields.io/badge/release-2.4.8-red.svg?style=flat)
![](https://img.shields.io/badge/Android-4.0%20--%2010-blue.svg?style=flat)
![](https://img.shields.io/badge/arch-armeabi%20%7C%20armeabi--v7a%20%7C%20arm64--v8a%20%7C%20x86%20%7C%20x86__64-blue.svg?style=flat)
![](https://img.shields.io/badge/release-3.0.0-red.svg?style=flat)
![](https://img.shields.io/badge/Android-4.1%20--%2011-blue.svg?style=flat)
![](https://img.shields.io/badge/armeabi--v7a%20%7C%20arm64--v8a%20%7C%20x86%20%7C%20x86__64-blue.svg?style=flat)

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

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

<p align="left"><img src="doc/intro.png" alt="intro" width="320px"></p>

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

xCrash 已经在 [爱奇艺](http://www.iqiyi.com/) 的不同平台(手机,平板,电视)的很多安卓 app(包括爱奇艺视频)中被使用了很多年。

[README English Version](README.md)


## 特征

* 支持 Android 4.0 - 10(API level 14 - 29)。
* 支持 armeabi,armeabi-v7a,arm64-v8a,x86 和 x86_64。
* 支持 Android 4.1 - 11(API level 16 - 30)。
* 支持 armeabi-v7a,arm64-v8a,x86 和 x86_64。
* 捕获 java 崩溃,native 崩溃和 ANR。
* 获取详细的进程、线程、内存、FD、网络统计信息。
* 通过正则表达式设置需要获取哪些线程的信息。
Expand All @@ -30,12 +32,10 @@ xCrash 已经在 [爱奇艺](http://www.iqiyi.com/) 的不同平台(手机,
## Tombstone 文件预览

* [java 崩溃](doc/tombstone_java.txt)
* [native 崩溃 (armeabi)](doc/tombstone_native_armeabi.txt)
* [native 崩溃 (armeabi-v7a)](doc/tombstone_native_armeabi-v7a.txt)
* [native 崩溃 (arm64-v8a)](doc/tombstone_native_arm64-v8a.txt)
* [native 崩溃 (x86)](doc/tombstone_native_x86.txt)
* [native 崩溃 (x86_64)](doc/tombstone_native_x86_64.txt)
* [ANR (armeabi)](doc/tombstone_anr_armeabi.txt)
* [ANR (armeabi-v7a)](doc/tombstone_anr_armeabi-v7a.txt)
* [ANR (arm64-v8a)](doc/tombstone_anr_arm64-v8a.txt)
* [ANR (x86)](doc/tombstone_anr_x86.txt)
Expand All @@ -62,7 +62,7 @@ xCrash 已经在 [爱奇艺](http://www.iqiyi.com/) 的不同平台(手机,

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

Expand All @@ -72,7 +72,7 @@ dependencies {
android {
defaultConfig {
ndk {
abiFilters 'armeabi', 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
abiFilters 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
}
}
}
Expand Down Expand Up @@ -109,39 +109,23 @@ class MyCustomApplication : Application() {

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

在 [src/java/xcrash/xcrash_sample](src/java/xcrash/xcrash_sample) 文件夹中,有一个更实际和复杂的示例 app。
在 [xcrash_sample](xcrash_sample) 文件夹中,有一个更实际和复杂的示例 app。


## 构建

如果你想编译 xCrash 的源码。请按以下步骤进行:

#### 1. 下载 [Android NDK r16b](https://developer.android.com/ndk/downloads/revision_history.html),设置 PATH 环境变量。

#### 2. 编译和复制 native 库。

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

#### 3. 编译 AAR 库。
#### 编译 xCrash AAR 库:

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


## 技术支持

1. 查看 [xcrash-sample](src/java/xcrash/xcrash_sample)。
2. 在 [GitHub issues](https://github.com/iqiyi/xCrash/issues) 交流。
3. 邮件: <a href="mailto:caikelun@gmail.com">caikelun@gmail.com</a>
4. QQ 群: 603635869。二维码:

<p align="left"><img src="doc/qq_group.jpg" alt="qq group" width="300px"></p>
* [GitHub Issues](https://github.com/iqiyi/xCrash/issues)
* [GitHub Discussions](https://github.com/iqiyi/xCrash/discussions)
* Email: <a href="mailto:caikelun@gmail.com">caikelun@gmail.com</a>, <a href="mailto:xuqnqn@qq.com">xuqnqn@qq.com</a>


## 贡献
Expand Down
34 changes: 18 additions & 16 deletions src/java/xcrash/build.gradle → build.gradle
Original file line number Diff line number Diff line change
@@ -1,19 +1,21 @@
buildscript {
repositories {
google()
jcenter()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:3.5.2'
classpath 'digital.wup:android-maven-publish:3.6.2'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4'
classpath 'com.android.tools.build:gradle:4.1.0'
}
}

allprojects {
repositories {
google()
jcenter()
// mavenLocal()
mavenCentral()
maven {url "https://s01.oss.sonatype.org/content/groups/public"}
maven {url "https://s01.oss.sonatype.org/content/repositories/releases"}
}
}

Expand All @@ -22,20 +24,24 @@ task clean(type: Delete) {
}

ext {
minSdkVersion = 14
compileSdkVersion = 29
targetSdkVersion = 29
buildToolsVersion = '29.0.2'
javaVersion = JavaVersion.VERSION_1_6
minSdkVersion = 16
compileSdkVersion = 31
targetSdkVersion = 31
buildToolsVersion = '30.0.2'
javaVersion = JavaVersion.VERSION_1_8
ndkVersion = "21.3.6528147"
cmakeVersion = "3.10.2"
abiFilters = "armeabi-v7a,arm64-v8a,x86,x86_64"
useASAN = false

POM_GROUP_ID = "com.iqiyi.xcrash"
POM_ARTIFACT_ID = "xcrash-android-lib"
POM_VERSION_NAME = "2.4.8"
POM_VERSION_NAME = "3.1.0"

POM_NAME = "xCrash Android Lib"
POM_DESCRIPTION = "xCrash provides the Android app with the ability to capture java crash, native crash and ANR."
POM_URL = "https://github.com/iqiyi/xCrash"
POM_INCEPTION_YEAR = "2019"
POM_INCEPTION_YEAR = "2020"
POM_PACKAGING = "aar"

POM_SCM_CONNECTION = "https://github.com/iqiyi/xCrash.git"
Expand All @@ -49,8 +55,4 @@ ext {

POM_DEVELOPER_ID = "iQIYI"
POM_DEVELOPER_NAME = "iQIYI, Inc."

BINTRAY_REPO = "maven"
BINTRAY_ORGANIZATION = "xcrash"
BINTRAY_LICENCE = ['MIT']
}
File renamed without changes.
Binary file modified doc/intro.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed doc/qq_group.jpg
Binary file not shown.
Binary file added doc/xcrash_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading