Skip to content

LaodingDev/TraceFix

 
 

Repository files navigation

English README.md    中文 README_zh.md

TraceFix

Auto add systrace Tag when project compiling

Getting Started

  1. Configure TRACEFIX_VERSION in gradle.properties.
TRACEFIX_VERSION=0.0.5
  1. Add matrix-gradle-plugin in your build.gradle(Root project or module, Make sure it looks like below):
buildscript {
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath("com.androidperf:tracefix:${TRACEFIX_VERSION}"){ changing = true }
        implementation 'androidx.appcompat:appcompat:1.2.0'
    }
}
  1. Add AndroidX for Appcompat Api(This is needed for now )
dependencies {
    implementation 'androidx.appcompat:appcompat:1.2.0'
}
  1. Add dependencies to your app/build.gradle.
apply plugin: 'auto-add-systrace'
  1. Build and install apk , run systrace tools, " -a your-package-name" is Needed!
python /path-to-your-systrace/systrace.py -a your-package-name

#for example
python /mnt/d/Android/platform-tools/systrace/systrace.py -a com.android.settings
  1. Open trace file on Chrome or https://ui.perfetto.dev/#!/viewer

TODO

  1. Add white list and black list
  2. Class name opt
  3. Init method opt
  4. Disable get、set
  5. No-AndroidX opt

Module

android-systrace-sample-remote-debug

Demo module , just for remote test

android-systrace-sample-local-debug

Demo module , just for local test

android-systrace-sample-jetpack

Demo module , just for test

android-systrace-plugin

plugin module , add trace tag when entering a method and exiting a method

Code Change

Before auto add trace tag

Demo

After auto add trace tag

Demo

Systrace

Demo Project

Demo

Demo

About

TraceFix is a android systrace plugin , with asm and gradle

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Java 91.9%
  • HTML 6.6%
  • Kotlin 1.5%