# 获取当前activity
> adb shell dumpsys activity top | grep ACTIVITY
# 当前获取焦点的Window 所包含的Activity
> adb shell dumpsys window | grep mCurrentFocus> adb shell pm list pacakges用于关闭android studio模拟器
# 关闭模拟器
> adb emu kill> adb logcat
> adb logcat | grep ${进程名称} # 查看某个进程的日志
> adb logcat '*:E' | grep ${进程名称} # 查看某个进程的Error日志
# 按优先级过滤
# priority 可以为V(Verbose) D(Debug) I(Info) W(Warning) E(Error) F(Fatal) S(Slient)
> adb logcat '*:priority'
> adb logcat -v ${时间} # 按时间查看错误日志
> adb logcat > log.txt # 将日志输入到摸个文本
## windows下需要将 grep 替换为 findstr> emulator -list-avds > emulator -avd ${模拟器名称}10.0.2.2