Logcatの話

25
-1

Published on

shibuya.apk #5 extends 忘年会
http://shibuya-apk.connpass.com/event/23474/

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
25
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
0
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Logcatの話

  1. 1. About me • Shinobu Okano(@operandoOS) • Mercari, Inc. • Android Framework Code Reading の勉強会運営
  2. 2. 今日はゆっくり話します
  3. 3. 今日shinobu.apkのLTで ネタなかったのでこれで行こう
  4. 4. ガチTypoです・・・
  5. 5. shinobu.apk やります!! 来年ね…
  6. 6. shinobu.apkは shinobu okanoと愉快な仲間た ちが繰り広げるファンタジーな 勉強会です
  7. 7. ひたすらlogcatの話します
  8. 8. logcat使ってる人ー?
  9. 9. Android Studioで logcat見てる人ー?
  10. 10. Terminalで見るだろ常考
  11. 11. logcatってなんぞ?? http://developer.android.com/intl/ja/tools/help/logcat.html The Android logging system provides a mechanism for collecting and viewing system debug output.
  12. 12. logcatってなんぞ?? http://developer.android.com/intl/ja/tools/ debugging/debugging-log.html Reading and Writing Logs
  13. 13. logcatってなんぞ?? http://elinux.org/Android Android Logging System
  14. 14. logcatってなんぞ??
  15. 15. logcatを理解したい!! • ソースコードです • http://tools.oesf.biz/android-6.0.0_r1.0/xref/ system/core/logcat/ • http://tools.oesf.biz/android-6.0.0_r1.0/xref/ system/core/liblog/
  16. 16. Terminalから叩いてみよう!! adb logcat
  17. 17. 君もこれでlogact マスター!!
  18. 18. -v つけてみよう!! • v Option = Sets the log print format • adb logcat -v time • Android 6.0だとこんなにいっぱいformatある • brief, color, long, printable, process • raw, tag, thread, threadtime, time, usec
  19. 19. -b いってみよう!! • b Option = Request alternate ring buffer • adb logcat -b system • Multiple OK • adb logcat -b system -b radio • main, system, radio, events, crash, all • adb logcat -b all
  20. 20. -s 使える子 • s Option = Tag filter. • adb logcat -s BackupManagerService
  21. 21. -Q 隠しOption
  22. 22. -Q 隠しOption http://tools.oesf.biz/android-6.0.0_r1.0/ xref/system/core/logcat/logcat.cpp#679
  23. 23. -Q 隠しOption 何するかよくわからない…
  24. 24. logクリアしたいよね? • c Option • clear (flush) the entire log and exit • adb logcat -c
  25. 25. Terminalからlogが打ちたい!! • adb shell log • shell log -p e -t shibuya.apk logcat最高最強 USAGE: log [-p priorityChar] [-t tag] message priorityChar should be one of: v,d,i,w,e
  26. 26. adb shell logどんな時に便利か • 任意のタイミングでlogを打ちたい時 • 何かDebugの一環で特定操作感のログを見たい時 • adb shell log -t test debug start • adb shell log -t test debug end • 何時から何時までのログみたいなレベルで見なくて済む! • 最高!!
  27. 27. ログバッファを増やすぞい!! • Android 5.0から開発者オプションにログバッ ファ増やす設定追加された • ktkr • log見ながら開発する俺のために作られた機能 としか思えない
  28. 28. ログバッファを増やすぞい!!
  29. 29. logcatは進化している!! • なんかOS Version上がるごとにOption増えてる! • adb logcat -b all • adb logcat -v color ← Android 6.0
  30. 30. adb logcat -v color
  31. 31. logcat最高!!
  32. 32. Thanks!!
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×