1.使用System.out.println语句

a 直接在代码中插入:System.out.println("johnny: test");

b 打开Window--Show View--Other--Android--LogCat

Android程序调试方法

c Filter : johnny 得到:

Android程序调试方法

由此可见,在输入println消息的时候要有独特的特征,这样才能够在众多的消息中通过filter找到它。

注意,filter所过滤的是text栏的内容,对其他栏没有任何的过滤作用。

 

2. 使用Log类

a import android.util.Log;

b Log.d("TAG", "johnny: test");

c 打开Window--Show View--Other--Android--LogCat

d Filter : johnny 得到:

Android程序调试方法

 

 

相关文章:

  • 2021-08-04
  • 2021-08-20
  • 2021-10-28
  • 2021-06-04
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-23
  • 2021-05-29
  • 2021-06-29
  • 2021-07-14
  • 2022-01-08
  • 2022-02-11
相关资源
相似解决方案