How to get Android crash logs? - Stack Overflow

文章推薦指數: 80 %
投票人數:10人

1) Plug in Phone through USB (w/ Developer Debugging options enabled) · 2) Open Terminal and Navigate to your Android SDK (for Mac): · 3) Logcat from that ... Home Public Questions Tags Users Companies Collectives ExploreCollectives Teams StackOverflowforTeams –Startcollaboratingandsharingorganizationalknowledge. CreateafreeTeam WhyTeams? Teams CreatefreeTeam CollectivesonStackOverflow Findcentralized,trustedcontentandcollaboratearoundthetechnologiesyouusemost. Learnmore Teams Q&Aforwork Connectandshareknowledgewithinasinglelocationthatisstructuredandeasytosearch. Learnmore HowtogetAndroidcrashlogs? AskQuestion Asked 11years,7monthsago Modified 9monthsago Viewed 377ktimes 172 57 Ihaveanappthatisnotinthemarketplace(signedwithadebugcertificate),butwouldliketogetcrashlogdata,whenevermyapplicationcrashes.WherecanIfindalogofwhymyappcrashed? androidloggingcrash Share Improvethisquestion Follow editedSep4,2010at18:19 SheehanAlam askedSep4,2010at18:02 SheehanAlamSheehanAlam 58.5k123123goldbadges352352silverbadges552552bronzebadges 0 Addacomment  |  18Answers 18 Sortedby: Resettodefault Highestscore(default) Trending(recentvotescountmore) Datemodified(newestfirst) Datecreated(oldestfirst) Helpusimproveouranswers.Aretheanswersbelowsortedinawaythatputsthebestansweratornearthetop? Takeashortsurvey I’mnotinterested 63 Youcantrythisfromtheconsole: adblogcat--buffer=crash Moreinfoonthisoption: adblogcat--help ... -b,--buffer=Requestalternateringbuffer,'main', 'system','radio','events','crash','default'or'all'. Multiple-bparametersorcommaseparatedlistofbuffersare allowed.Buffersinterleaved.Default-bmain,system,crash. Share Improvethisanswer Follow editedOct27,2019at13:16 GianfrancoP. 8,35555goldbadges4444silverbadges6363bronzebadges answeredOct25,2017at12:12 AmeeralikhanAmeeralikhan 65566silverbadges1010bronzebadges Addacomment  |  67 ThewaytodothisistoimplementtheThread.UncaughtExceptionHandlerinterfaceandpassittoThread.setDefaultUncaughtExceptionHandler()atthebeginningofyourActivity'sonCreate().HereistheimplementationclassTopExceptionHandler. publicclassTopExceptionHandlerimplementsThread.UncaughtExceptionHandler{ privateThread.UncaughtExceptionHandlerdefaultUEH; privateActivityapp=null; publicTopExceptionHandler(Activityapp){ this.defaultUEH=Thread.getDefaultUncaughtExceptionHandler(); this.app=app; } publicvoiduncaughtException(Threadt,Throwablee){ StackTraceElement[]arr=e.getStackTrace(); Stringreport=e.toString()+"\n\n"; report+="---------Stacktrace---------\n\n"; for(inti=0;ilogs.txt Share Improvethisanswer Follow answeredJul26,2018at6:51 JGPhilipJGPhilip 1,1921515silverbadges1919bronzebadges Addacomment  |  8 HereisanothersolutionforCrashLog. Androidmarkethastoolnamed"CrashCollector" checkfollowinglinkformoreinformation http://kpbird.blogspot.com/2011/08/android-application-crash-logs.html Share Improvethisanswer Follow answeredAug18,2011at4:45 KetanParmarKetanParmar 2,8961717silverbadges2727bronzebadges 1 4 DoesnotworkonAndroid4.1andlater(newpermissionstoreadlogs). – cat Jan31,2014at14:31 Addacomment  |  -1 TryCarshlogappfromandroid. usethelinktodownloadapp. Share Improvethisanswer Follow answeredSep13,2016at5:45 prashantthakreprashantthakre 4,75022goldbadges2525silverbadges3838bronzebadges Addacomment  |  0 BaseonthisPOST,usethisclassasreplacementof"TopExceptionHandler" classTopExceptionHandlerimplementsThread.UncaughtExceptionHandler{ privateThread.UncaughtExceptionHandlerdefaultUEH; privateActivityapp=null; privateStringline; publicTopExceptionHandler(Activityapp){ this.defaultUEH=Thread.getDefaultUncaughtExceptionHandler(); this.app=app; } publicvoiduncaughtException(Threadt,Throwablee){ StackTraceElement[]arr=e.getStackTrace(); Stringreport=e.toString()+"\n\n"; report+="---------Stacktrace---------\n\n"; for(inti=0;i



請為這篇文章評分?