在安卓平台调试,用adb logcat抓logcat时命令行会提示unexpected EOF!并断开了

这是因为有些平台设置的Logbuffer太小了,一般是256KB,通过adb logcat -g可以查询到

解决办法就是要加大这个buffer,有两种办法,这里只介绍第一种办法

用cmd命令行直接设置的,这种办法比较常用:

C:\Users\Administrator>adb logcat -G 4m

C:\Users\Administrator>adb logcat -g

main: ring buffer is 4 MiB (1010 KiB consumed), max entry is 5120 B, max payload is 4068 B

system: ring buffer is 4 MiB (1007 KiB consumed), max entry is 5120 B, max payload is 4068 B

crash: ring buffer is 4 MiB (247 KiB consumed), max entry is 5120 B, max payload is 4068 B

kernel: ring buffer is 4 MiB (0 B consumed), max entry is 5120 B, max payload is 4068 B

截图如下:

注意,有些平台不能用adb logcat -G这个命令,提示-G为无效选项,这样的话,就得去设置,开发者选项里面增大buffer了。

 

 

Logo

华为开发者空间,是为全球开发者打造的专属开发空间,汇聚了华为优质开发资源及工具,致力于让每一位开发者拥有一台云主机,基于华为根生态开发、创新。

更多推荐