arthas官网
arthas官网下载:
Releases · alibaba/arthas · GitHub
idea集成arthas idea插件,可以自动生成arthas命令到剪贴板
步骤一:集成插件
步骤二:选择方法和命令,单击执行后,便以将命令复制到剪贴板
步骤三:将命令放在arthas后台执行即可,可以做修改
watch service.TimeTest getTimeNowToSixMonth '{params,returnObj,throwExp}' -n 5 -x 3
常用命令:
反编译类和方法:
jad com.bestpay.settle.unity.certify.core.service.BusinessBeneficiaryCheckComponent compareBusinessBeneficiary
打印方法入参和返回值:
watch com.bestpay.settle.unity.certify.core.service.BusinessBeneficiaryCheckComponent compareBusinessBeneficiary '{params[0],returnObj}' -n 5 -x 3
调用静态变量:
watch com.example.arthasquestionognl.ognlDemo.Test test @com.example.arthasquestionognl.ognlDemo.Test@m -n 1
调用静态方法:
watch com.example.arthasquestionognl.ognlDemo.Test test '@com.example.arthasquestionognl.ognlDemo.Test@invoke("luoyu test")' -n 1
访问map的所有key:
watch com.example.arthasquestionognl.ognlDemo.Test test '@com.example.arthasquestionognl.ognlDemo.Test@n.keys' -n 1