{"id":3028,"date":"2018-03-28T08:33:33","date_gmt":"2018-03-28T13:33:33","guid":{"rendered":"http:\/\/lisa.rushworth.us\/?p=3028"},"modified":"2018-03-28T10:32:18","modified_gmt":"2018-03-28T15:32:18","slug":"gathering-android-log-files","status":"publish","type":"post","link":"https:\/\/www.rushworth.us\/lisa\/?p=3028","title":{"rendered":"Gathering Android Log Files"},"content":{"rendered":"<p>A friend has an Android application that isn&#8217;t functioning properly. On Windows or Unix, I know how to stack-trace and debug apps &#8230; so she figured I&#8217;d be all set up to do the same thing on Android too. Except I&#8217;ve never encountered a problem that required debugging Android apps. Consult the universal archive of all IT knowledge (a.k.a. Google).<\/p>\n<p>I don&#8217;t have the Android developer kit installed, nor do I need it, so I elected to use &#8220;<a href=\"https:\/\/forum.xda-developers.com\/showthread.php?t=2317790\" target=\"_blank\" rel=\"noopener\">Minimal ADB and Fastboot<\/a>&#8221; to grab the log data. My device did not show up without a Windows driver for the\u00a0<a href=\"https:\/\/adb.clockworkmod.com\/\" target=\"_blank\" rel=\"noopener\">debug bridge<\/a>. Once the driver was installed and the adb server restarted, my device appeared.<\/p>\n<p>&nbsp;<\/p>\n<pre>C:\\Users\\lisa&gt;\"c:\\program files (x86)\\Minimal ADB and Fastboot\\adb.exe\" kill-server\r\n\r\nC:\\Users\\lisa&gt;\"c:\\program files (x86)\\Minimal ADB and Fastboot\\adb.exe\" start-server\r\n* daemon not running; starting now at tcp:5037\r\n* daemon started successfully\r\n\r\nC:\\Users\\lisa&gt;\"c:\\program files (x86)\\Minimal ADB and Fastboot\\adb.exe\" devices\r\nList of devices attached\r\ng142ef0c        device\r\n<\/pre>\n<p>Something interesting about the adb log data &#8211; it can include an hour or more of history. Which is awesome if your app crashed a few minutes ago and you want to capture historic data, but for a reproducible error &#8230; well, there&#8217;s no need to slog through thousands of lines to find where the problem actually started. Clear the log buffers first then start capturing the adb log data:<\/p>\n<pre>\"c:\\program files (x86)\\Minimal ADB and Fastboot\\adb.exe\" logcat -b main -b system ^\r\n-b radio -b events -c&amp;&amp;\"c:\\program files (x86)\\Minimal ADB and Fastboot\\adb.exe\" logcat ^\r\n-v threadtime -f \"C:\\temp\\SessionLog.txt\"<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A friend has an Android application that isn&#8217;t functioning properly. On Windows or Unix, I know how to stack-trace and debug apps &#8230; so she figured I&#8217;d be all set up to do the same thing on Android too. Except I&#8217;ve never encountered a problem that required debugging Android apps. Consult the universal archive of &hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33],"tags":[562,560,561],"class_list":["post-3028","post","type-post","status-publish","format-standard","hentry","category-coding","tag-adb","tag-debugging-android","tag-logcat"],"_links":{"self":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/3028","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3028"}],"version-history":[{"count":3,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/3028\/revisions"}],"predecessor-version":[{"id":3031,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=\/wp\/v2\/posts\/3028\/revisions\/3031"}],"wp:attachment":[{"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3028"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3028"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rushworth.us\/lisa\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3028"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}