-
Notifications
You must be signed in to change notification settings - Fork 344
0x00 QuickStart_en
build.gradle
of Module project
dependencies {
// Core module
implementation 'cn.hikyson.godeye:godeye-core:VERSION_NAME'
// Debug dashboard
debugImplementation 'cn.hikyson.godeye:godeye-monitor:VERSION_NAME'
// Release no dashboard
releaseImplementation 'cn.hikyson.godeye:godeye-monitor-no-op:VERSION_NAME'
// Extra module, help to monitor network
implementation 'cn.hikyson.godeye:godeye-okhttp:VERSION_NAME'
// Extra module, help to monitor crash/ANR
implementation 'cn.hikyson.godeye:godeye-xcrash:VERSION_NAME'
}
VERSION_NAME Github release
build.gradle
of Root Project:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath "cn.hikyson.methodcanary:plugin:PLUGIN_VERSION_NAME"
}
}
PLUGIN_VERSION_NAME MethodCanary github release
build.gradle
of Application Module Project('com.android.application'
):
apply plugin: 'cn.hikyson.methodcanary.plugin'
Create js file MethodCanary.js
in project root directory to config MethodCanary, sample:
/**
classInfo
{int access
String name
String superName
String[] interfaces}
methodInfo
{int access
String name
String desc}
**/
function isExclude(classInfo,methodInfo){
return false
}
function isInclude(classInfo,methodInfo){
return classInfo.name.startsWith('cn/hikyson/godeyedemo'))
}
GodEye class is entrance for this step, almost all apis are provided by it.
Init first in your application:
GodEye.instance().init(this);
Install modules in application onCreate
, Repeated calls of this method will install modules that have not been installed.
if (ProcessUtils.isMainProcess(this)) {//install in main process
GodEye.instance().install(GodEyeConfig.fromAssets("assets path"));
}
There are several ways to build GodEyeConfig
- (General usage)Install from XML type assets directory:
GodEyeConfig.fromAssets("assets path")
- Install from XML type InputStream:
GodEyeConfig.fromInputStream(InputStream)
- Default configuration:
GodEyeConfig.defaultConfig()
XML Sample:install.config
Uninstall modules when you don't need it(not recommend):
GodEye.instance().uninstall();
GodEyeMonitor class is entrance for this step.
Start performance visualization dashboard:
GodEyeMonitor.work(context)
GodEyeMonitor.shutDown()
Apply AndroidGodEye for Release
Install Android Studio plug-in(Search AndroidGodEye in Android Studio plugin setting),Then you can find AndroidGodEye in main toolbar,click it and it will open dashboard in browser.
You can open it by sh/bat script without installing the plug-in
Modify port when port conflict
Now enjoy it!