android studio 中 adb logcat 在这里敲

官方视频和网络大都没有详细介绍命令行(IDE集成的那个比较容易看到)下 logcat 最初怎么进入,倒是具体用法详细的翻译了官网的文档。

所以记录如下:

(1)下面的官网上写了

https://developer.android.com/studio/command-line/logcat.html#Syntax

(科学上网)

(2)摘要如下:

Command-line Syntax 

[adb] logcat [<option>] ... [<filter-spec>] ...

You can run logcat as an adb command or directly in a shell prompt of your emulator or connected device. To view log output using adb, navigate to your SDK platform-tools/ directory and execute:

$ adb logcat

You can create a shell connection to a device and execute:

$ adb shell

# logcat

(3)看红色的部分,找到工具位置

(4)在命令行下进入该目录,执行

adb shell

logcat

(5)方便使用写个脚本,每次点一下

@echo off
set adbPath=C:\Users\computer\AppData\Local\Android\sdk\platform-tools
cd %adbPath%
adb shell
Pause

(6)other

     Log.d 可能打印不出来,这个可能是手机的设置问题,我在华为的荣耀机型上测试发现,

需要 打开log设置(输入一串数字)的电源日志,也不知道他们是怎么想的。

 

其他具体怎么用,等 随便一搜就一堆,大都类似。

 

posted @ 2016-10-24 02:34  三岁玩童  阅读(431)  评论(0编辑  收藏  举报