android 方法数统计工具,Android小工具

66b52468c121889b900d4956032f1009.png

8种机械键盘轴体对比

本人程序员,要买一个写代码的键盘,请问红轴和茶轴怎么选?

Android小工具–方法计数统计DexCount

目录结构.

├── dex-method-counts.jar

├── tools.bat

├── app-debug_dexcount.txt

**dex-method-counts.jar**

获得方法的可执行jar包

**tools.bat**

tools.bat:获取某一apk方法数的bat批处理命令

工具使用

将某一个需要查看方法数的apk拖入tools.bat上,然后就会在 当前目录生成 一个名为 “${apk名称}_dexcount.txt”文件,打开该文件,即可以看到具体的方法分布。

such as:Processing D:UserProfilesHaiolvDownloadsapp-debug.apk

Read in 64836 method IDs.

: 64836

: 1

adStats: 12

android: 16841

accessibilityservice: 6

accounts: 5

animation: 12

app: 349

bluetooth: 3

content: 338

.....

如上,当将 app-debug.apk 拖入 tools.bat命令后,会在当前目录生成一个 名为 app-debug_dexcount.txt文件,打看我们可以看到该apk先总含有方法数为 64836,bomm..快超过 单个dex所允许的最大方法数了(65536),关于当apk方法数超过Short限制时,请查看 Configure Apps with Over 64K Methods

批处理命令详解echo 拖入apk包

REM echo "%~f1"

REM echo "%~dp0"

REM echo %0

pushd %~dp0

if exist ./dexcount.txt (

rmdir /s /q ./dexcount.txt

)

REM echo %~n1

REM echo %~n1%_dexcount.txt

REM pause

java -jar ./dex-method-counts.jar "%~f1" > ./%~n1%_dexcount.txt

popd

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值