1から学ぶAndroidアプリデバッグ - アプリの動作を追いかけよう / Learn Android application debugging from the scratch - track apps' behaviors

1から学ぶAndroidアプリデバッグ - アプリの動作を追いかけよう / Learn Android application debugging from the scratch - track apps' behaviors

2020/2/20-21で開催されるはずだったDroidKaigi 2020で登壇するはずだったAndroidのデバッグ手法について紹介するスライドです。3月中にセッション録画を行い、DroidKaigi公式YouTubeチャンネルにて公開していただく予定です。

0f50b010cc99988fba8a73008b21f353?s=128

Yoshihiro WADA

February 20, 2020
Tweet

Transcript

  1. 17.
  2. 47.
  3. 49.
  4. 56.
  5. 74.

    ˖ ؒطؘٕ٦嶊顤ח䕦갟ׅ׷ءأذي؎كٝز׾涪鋅דֹ׷ &OFSHZ1SPMFSءأذي؎كٝزך邌爙 !74 8BLFMPDL "MBSN +PC ⡘縧䞔㜠ؙٔؒأز أٔ٦ف朐䡾חז׵׆ח 歗꬗$16׾0/׃竲ֽ׷

    㹀劍涸ח㹋遤ׁ׸׷ غحؙؚٓٝسةأؙ 䭷㹀勴⟝ד㹋遤ׁ׸׷ غحؙؚٓؐٝسةأؙ (14إٝ؟٦瘝׾欽ְ׋ ⡘縧䞔㜠ך庠㹀ؙٔؒأز
  6. 90.
  7. 91.
  8. 92.
  9. 96.
  10. 109.

    BOESPJEVUJM-PHד-PHDBUח⳿⸂ׅ׷ !109 BOESPJEVUJM-PHדךؚٗ⳿⸂ Log.v("TAG", "Verbose log output") Log.d("TAG", "Debug log

    output") Log.i("TAG", "Info log output") Log.w("TAG", "Warn log output") Log.e("TAG", "Error log output")
  11. 110.

    BOESPJEVUJM-PHד-PHDBUח⳿⸂ׅ׷ !110 5JNCFSדךؚٗ⳿⸂ Timber.v("Verbose timber output") Timber.d("Debug timber output") Timber.i("Info

    timber output") Timber.w("Warn timber output") Timber.e("Error timber output") Timber.tag("TAG").d("Debug timber output")
  12. 111.

    BOESPJEVUJM-PHד-PHDBUח⳿⸂ׅ׷ !111 5JNCFSדךؚٗ⳿⸂ Timber.v("Verbose timber output") Timber.d("Debug timber output") Timber.i("Info

    timber output") Timber.w("Warn timber output") Timber.e("Error timber output") Timber.tag("TAG").d("Debug timber output") 5"(כ㹋遤ؙٓأせחז׷
  13. 112.

    BOESPJEVUJM-PHד-PHDBUח⳿⸂ׅ׷ !112 5JNCFSדךؚٗ⳿⸂ Timber.v("Verbose timber output") Timber.d("Debug timber output") Timber.i("Info

    timber output") Timber.w("Warn timber output") Timber.e("Error timber output") Timber.tag("TAG").d("Debug timber output") 5"(׾䭷㹀ׅ׷ֿה׮דֹ׷
  14. 114.

    BOESPJEVUJMMPHWT5JNCFS !114 BOESPJEVUJMMPH 5JNCFS 5"(ך䭷㹀 䗳銲 䗳銲搀ְ鏣㹀〳 ٔٔ٦أדך㼎䘔 QSPHVBSE瘝ד嶊⿠ׅ׷ 5SFF׾䊴׃剏ִ׷

    ؚٗךꥷך 䮙⹛ך㢌刿 ♶〳腉 〳腉ؕأةي5SFF ػؿؓ٦وٝأ⡚♴װ䞔㜠怩ְִך⽬ꤹ׾㔐鼘ׅ׷湡涸
  15. 116.

    ؕأةي5SFFדؚٗךꥷך䮙⹛׾㢌ִ׷ !116 class CrashReportingTree : Timber.Tree() { override fun log(

    priority: Int, tag: String?, message: String, t: Throwable? ) { if (priority == Log.VERBOSE || priority == Log.DEBUG) { return } // Do crash reporting... } } ؙٓحءُٖه٦ز׾遤ֲ5SFF
  16. 117.

    ؕأةي5SFFדؚٗךꥷך䮙⹛׾㢌ִ׷ !117 class CrashReportingTree : Timber.Tree() { override fun log(

    priority: Int, tag: String?, message: String, t: Throwable? ) { if (priority == Log.VERBOSE || priority == Log.DEBUG) { return } // Do crash reporting... } } ؙٓحءُٖه٦ز׾遤ֲ5SFF 5SFFؙٓأ׾竰䪫׃׋ؙٓأ׾⡲׷
  17. 118.

    ؕأةي5SFFדؚٗךꥷך䮙⹛׾㢌ִ׷ !118 class CrashReportingTree : Timber.Tree() { override fun log(

    priority: Int, tag: String?, message: String, t: Throwable? ) { if (priority == Log.VERBOSE || priority == Log.DEBUG) { return } // Do crash reporting... } } ؙٓحءُٖه٦ز׾遤ֲ5SFF MPHًاحسך ؔ٦غ٦ٓ؎سד 䮙⹛׾㹀纏
  18. 119.

    ؕأةي5SFFדؚٗךꥷך䮙⹛׾㢌ִ׷ !119 override fun onCreate() { super.onCreate() if (BuildConfig.DEBUG) {

    Timber.plant(Timber.DebugTree()) } else { Timber.plant(CrashReportingTree()) } } "QQMJDBUJPOPO$SFBUF
  19. 120.

    ؕأةي5SFFדؚٗךꥷך䮙⹛׾㢌ִ׷ !120 override fun onCreate() { super.onCreate() if (BuildConfig.DEBUG) {

    Timber.plant(Timber.DebugTree()) } else { Timber.plant(CrashReportingTree()) } } "QQMJDBUJPOPO$SFBUF #VJME$POHד㙵׭鴥׬5SFF׾㢌ִ׷
  20. 128.

    -PHDBUה&WBMVBUFBOE-PHך麩ְ !128 -PHDBU &WBMVBUFBOE-PH ؚٗ鷄⸇儗 ךⱄؽٕس 䗳銲 䗳銲搀ְ ؚٗ׾⳿ׅ׋׭ ח䗳銲ז橆㞮

    "%# رغحؖ٦ך،ةحث ؘؚٗٝه؎ٝز ؝٦س♳ח婍׷ ؝٦س♳ח婍׵זְ "1*ؒٓ٦ךؚٗ瘝ծ䌢ח邌爙׃׋ְ הֹח⢪ֲךָ葺ׁ׉ֲ
  21. 129.

    -PHDBUה&WBMVBUFBOE-PHך麩ְ !129 -PHDBU &WBMVBUFBOE-PH ؚٗ鷄⸇儗 ךⱄؽٕس 䗳銲 䗳銲搀ְ ؚٗ׾⳿ׅ׋׭ ח䗳銲ז橆㞮

    "%# رغحؖ٦ך،ةحث ؘؚٗٝه؎ٝز ؝٦س♳ח婍׷ ؝٦س♳ח婍׵זְ 然钠瘝ծ♧儗涸חؚٗ׾⳿׃׋ְ 㜥さח⢪ֲךָ葺ׁ׉ֲ
  22. 142.

    /FUXPSL1SPMFSWT4UFUIP'MJQQFS !142 /FUXPSL1SPMFS 4UFUIP'MJQQFS 穈׫鴥׬׋׭ך㹋鄲 ♶銲 䗳銲 涪欰׃׋鸐⥋ꆀך鎘庠 ؚٓؿד鋅׸׷ 筨鎘ָ鋅׸׷

    鸐⥋ך鎘庠ך➬倯 儗꟦眔㔲ד䭷㹀 䌢ח崧׸גֻ׷ 鸐⥋׾䭪ִ׷״ֲחׅ׷䗳銲ָ֮׷ ⢽0L)UUQ$MJFOUך*OUFSDFQUFS鷄⸇
  23. 143.

    /FUXPSL1SPMFSWT4UFUIP'MJQQFS !143 /FUXPSL1SPMFS 4UFUIP'MJQQFS 穈׫鴥׬׋׭ך㹋鄲 ♶銲 䗳銲 涪欰׃׋鸐⥋ꆀך鎘庠 ؚٓؿד鋅׸׷ 筨鎘ָ鋅׸׷

    鸐⥋ך鎘庠ך➬倯 儗꟦眔㔲ד䭷㹀 䌢ח崧׸גֻ׷ 嗚稊〳腉 暴㹀ך乼⡲٥ة؎ىؚٝד涪欰׃גְ׷ "1*鸐⥋׾嗚鏾ׅ׷הֹח剣⸬
  24. 144.

    /FUXPSL1SPMFSWT4UFUIP'MJQQFS !144 /FUXPSL1SPMFS 4UFUIP'MJQQFS 穈׫鴥׬׋׭ך㹋鄲 ♶銲 䗳銲 涪欰׃׋鸐⥋ꆀך鎘庠 ؚٓؿד鋅׸׷ 筨鎘ָ鋅׸׷

    鸐⥋ך鎘庠ך➬倯 儗꟦眔㔲ד䭷㹀 䌢ח崧׸גֻ׷ 嗚稊〳腉 暴㹀ך"1*׾嗚鏾 ׃׋ְ㜥さח剣⸬
  25. 156.
  26. 157.
  27. 160.
  28. 162.
  29. 164.
  30. 168.
  31. 191.

    ˖ #SFBLQPJOU)FMQ]*OUFMMJ+*%&" ˖ IUUQTXXXKFUCSBJOTDPNIFMQJEFBVTJOHCSFBLQPJOUTIUNM ˖ "OESPJE1SPMFSד،فٔךػؿؓ٦وٝأ׾庠㹀ׅ׷]"OESPJE%FWFMPQFST ˖ IUUQTEFWFMPQFSBOESPJEDPNTUVEJPQSPMFBOESPJEQSPMF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