Capture and read bug reports | Android Developers
文章推薦指數: 80 %
Capture a bug report using adb ... If you do not specify a path for the bugreport, it is saved to the local directory. If you have multiple ... Platform AndroidStudio GooglePlay Jetpack Kotlin Docs Games Language English BahasaIndonesia Español–AméricaLatina Português–Brasil TiếngViệt 中文–简体 日本語 한국어 Signin AndroidStudio Download What'snew Userguide Preview Platform AndroidStudio Download What'snew Userguide Preview GooglePlay Jetpack Kotlin Docs Games MeetAndroidStudio OverviewInstallAndroidStudioMigratetoAndroidStudioConfiguretheIDEKeyboardshortcutsAccessibilityfeaturesUpdatetheIDEandtools Workflowbasics Manageyourproject OverviewCreateaprojectAboutPlayFeatureDelivery AddCandC++code OverviewInstallNDKandCMakeConfiguretheNDKforAGPConfigureCMakeLinkGradleCreateanAndroidlibrarySetupcontinuousintegration Writeyourapp OverviewAddcodefromatemplateFindsamplecodeAddamoduleforanewdeviceCreateaJavaclassortypeUseJava8languagefeaturesJava8languagesupporttableAddappresourcesBuildaUIwithLayoutEditorBuildanimationwithMotionEditorManageyourapp'sUIresourcesDesignappthemesAddmulti-densityvectorgraphicsCreateiconswithImageAssetStudioCreateresizablebitmaps(9-Patch)CreateWebPimagesLocalizetheUIAddAndroidapplinksConnecttoFirebaseImproveyourcodewithlintchecksImprovecodeinspectionwithannotationsToolsattributesreference Buildandrunyourapp Overview Runappsontheemulator OverviewCreateandmanagevirtualdevicesStarttheemulatorfromthecommandlineSendemulatorconsolecommandsSetupemulatornetworkingConfigurehardwareaccelerationEmulatorfeaturecomparisonTroubleshootemulator Runappsonahardwaredevice OverviewInstallOEMUSBdriversGettheGoogleUSBdriverCreaterun/debugconfigurationsBuildyourappfromthecommandline Configureyourbuild OverviewConfiguretheappmoduleAddbuilddependenciesConfigurebuildvariantsUsetheAndroidGradlepluginUpgradeAssistantGradletipsandrecipesMigratetoKotlinscript Optimizeyourbuildspeed OverviewTroubleshootbuildperformanceProfileyourbuildUsetheMavenPublishpluginManagemanifestfilesShrinkyourappEnablemultidexExtendtheAndroidGradlepluginIntegrateacustomC/C++buildsystem Debugyourapp OverviewConfiguredeveloperoptionsWriteandviewlogsAnalyzeastacktraceDebugyourlayoutwithLayoutInspectorInspectnetworktrafficwiththeNetworkInspectorDebugyourdatabasewiththeDatabaseInspectorDebugyourWorkManagerWorkerswithBackgroundTaskInspectorViewon-devicefilesDebugpre-builtAPKsTakeascreenshotRecordavideoCaptureandreadbugreportsAnalyzeyourbuildwithAPKAnalyzer Testyourapp OverviewTestinAndroidStudioTestfromthecommandlineAdvancedtestsetup Othertestingtools OverviewEspressoTestRecorderAppCrawlerMonkeytesting monkeyrunnerreference OverviewMonkeyDeviceMonkeyImageMonkeyRunner Profileyourapp Overview AndroidStudioprofilers Overview ProfileCPUactivity OverviewRecordtracesExporttracesImporttracesInspecttracesUIjankdetectionGeneratetracelogsbyinstrumentingyourappProfilememoryusageProfileenergyuseProfilewithpre-builtAPKs Benchmarkyourapp Overview Microbenchmark OverviewWritingabenchmarkProfilingabenchmarkInstrumentationargumentsBuildwithoutGradle Macrobenchmark WritingabenchmarkCapturethemetricsControlyourappInstrumentationargumentsContinuousIntegrationTrackandanalyzeperformanceImproveappperformanceusingBaselineProfiles Measureperformance OverviewExamples Publishyourapp OverviewPrepareforreleaseVersionyourappSignyourappUploadyourapp Publishyourlibrary OverviewPrepareforreleaseConfigurepublicationvariantsConfiguretestfixturesforpublicationUploadyourlibrary Commandlinetools Overviewaapt2adbapkanalyzerapksigneravdmanagerbmgrbundletoold8dmtracedumpdumpsysetc1tooljobbjetifier-standalonelogcatmksdcardretracesdkmanagersystraceperfettozipalignEnvironmentvariables Troubleshoot Knownissues Reportabug AndroidDevelopers AndroidStudio Userguide Captureandreadbugreports Abugreportcontainsdevicelogs,stacktraces,andotherdiagnostic informationtohelpyoufindandfixbugsinyourapp.Youcancaptureabug reportfromyourdevicebyusingeithertheTakebugreportdeveloper optiononthedevice,theAndroidEmulatormenu, ortheadbbugreportcommandonyourdevelopmentmachine. Figure1.Developeroptions Totakeabugreport,youmusthave Developeroptionsenabledonyour devicesoyoucanaccesstheTakebugreportoption. Captureabugreportfromadevice Figure2.Thebugreportisready Togetabugreportdirectlyfromyourdevice,dothefollowing: BesureyouhaveDeveloper Optionsenabled. InDeveloperoptions,tapTakebugreport. SelectthetypeofbugreportyouwantandtapReport. Afteramomentyougetanotificationthatthebugreportisready(see figure2). Tosharethebugreport,tapthenotification. CaptureabugreportfromtheAndroidEmulator FromtheAndroidEmulator,youcanusetheFileabug featureintheextendedcontrols: ClickMoreinthe emulatorpanel. IntheExtendedcontrolswindow,selectBugreportontheleft. Thisopensascreenwhereyoucanseethebugreportdetailssuchasthe screenshot,theAVDconfigurationinfo,andthebugreportlog.Youcan alsotypeamessagewithreproductionstepstosavewiththereport. Waitforthebugreporttofinishcollecting,andthenclickSaveReport. Captureabugreportusingadb Ifyouhavejustonedeviceconnected,youcangetabugreportusing adbasfollows: $adbbugreportE:\Reports\MyBugReports Ifyoudonotspecifyapathforthebugreport,itissavedto thelocaldirectory. Ifyouhavemultipledevicesconnected,youmustspecifythedevicewiththe -soption.Runthefollowingadbcommandsto getthedeviceserialnumberandgeneratethebugreport. $adbdevices Listofdevicesattached emulator-5554device 8XV7N15C31003476device $adb-s8XV7N15C31003476bugreport Saveanolderbugreport Bydefault,bugreportsaresavedat/bugreportsandcanbeviewedusing: $adbshellls/bugreports/ bugreport-foo-bar.xxx.YYYY-MM-DD-HH-MM-SS-dumpstate_log-yyy.txt bugreport-foo-bar.xxx.YYYY-MM-DD-HH-MM-SS.zip dumpstate-stats.txt Youcanthenpullthezipfileviaadbpulllikethis: $adbpull/bugreports/bugreport-foo-bar.xxx.YYYY-MM-DD-HH-MM-SS.zip InspectthebugreportZIPfile BydefaulttheZIPfileiscalled bugreport-BUILD_ID-DATE.zipand itmaycontainmultiplefiles,butthemostimportantfileis bugreport-BUILD_ID-DATE.txt.This isthebugreportanditcontains diagnosticoutputforsystemservices(dumpsys),errorlogs(dumpstate), andsystemmessagelogs(logcat).Thesystemmessagesincludestacktraces whenthedevicethrowsanerror,andmessageswrittenfromallappswiththe Logclass. TheZIPfilecontainsaversion.txtmetadatafilethatcontains theAndroidreleaseletter,andwhensystraceisenabled,theZIPfilealso containsasystrace.txtfile.The Systracetool helpsanalyzetheperformance ofyourapplicationbycapturinganddisplayingexecutiontimesofyour applicationprocessesandotherAndroidsystemprocesses. Thedumpstatetoolcopiesfilesfromthedevice’sfilesystem intotheZIPfileundertheFSfoldersoyoucanreferencethem.Forexample, a/dirA/dirB/fileCfileinthedevicewouldgeneratean FS/dirA/dirB/fileCentryintheZIPfile. Figure3.Bugreportfilestructure Formoreinformation,see Readingbugreports. Getreportsfromyourusers Capturingbugreportsasdescribedaboveishelpfulasyou'reusingtheapp yourself,butyourend-userscan'teasilysharethesetypesofbugreports withyou.Togetcrashreportswithstacktracesfromreal-worldusers, youshouldtakeadvantageofGooglePlay'sandFirebase'scrashreporting features. GooglePlayConsole Youcangetreportsfromthe GooglePlayConsole toviewdataforcrashesandapplicationnot responding(ANR)errorsfromuserswhoinstalledyourappfromGooglePlay. Dataisavailablefortheprevioussixmonths. Formoreinformation,see Viewcrashes&applicationnotresponding(ANR)errors inPlayConsolehelp. Firebasecrashreporting FirebaseCrashlyticsreportingcreatesdetailedreportsoftheerrorsinyourapp. Errorsaregroupedintoissuesbasedonhavingsimilarstacktraces,andtriaged bytheseverityofimpactonyourusers.Inadditiontoautomaticreports,you canlogcustomeventstohelpcapturethestepsleadingtoacrash. You'llstartreceivingcrashreportsfromanyuserbysimplyaddingthe Firebasedependencies toyourbuild.gradlefile.Formoreinformation,see FirebaseCrashlytics. ContentandcodesamplesonthispagearesubjecttothelicensesdescribedintheContentLicense.JavaandOpenJDKaretrademarksorregisteredtrademarksofOracleand/oritsaffiliates. Lastupdated2021-11-15UTC. [{ "type":"thumb-down", "id":"missingTheInformationINeed", "label":"MissingtheinformationIneed" },{ "type":"thumb-down", "id":"tooComplicatedTooManySteps", "label":"Toocomplicated/toomanysteps" },{ "type":"thumb-down", "id":"outOfDate", "label":"Outofdate" },{ "type":"thumb-down", "id":"samplesCodeIssue", "label":"Samples/codeissue" },{ "type":"thumb-down", "id":"otherDown", "label":"Other" }] [{ "type":"thumb-up", "id":"easyToUnderstand", "label":"Easytounderstand" },{ "type":"thumb-up", "id":"solvedMyProblem", "label":"Solvedmyproblem" },{ "type":"thumb-up", "id":"otherUp", "label":"Other" }] Twitter Follow@AndroidDevonTwitter YouTube CheckoutAndroidDevelopersonYouTube LinkedIn ConnectwiththeAndroidDeveloperscommunityonLinkedIn MoreAndroid Android AndroidforEnterprise Security Source News Blog Podcasts Discover Gaming MachineLearning Privacy 5G AndroidDevices Largescreens WearOS AndroidTV Androidforcars AndroidThings ChromeOSdevices Releases Android11 Android10 Pie Oreo Nougat Marshmallow Lollipop KitKat DocumentationandDownloads AndroidStudioguide Developersguides APIreference DownloadStudio AndroidNDK Support Reportplatformbug Reportdocumentationbug GooglePlaysupport Joinresearchstudies Android Chrome Firebase GoogleCloudPlatform Allproducts Privacy License Brandguidelines Getnewsandtipsbyemail Subscribe Language English BahasaIndonesia Español–AméricaLatina Português–Brasil TiếngViệt 中文–简体 日本語 한국어
延伸文章資訊
- 1用adb logcat抓取log - 程序員學院
狀態資訊的有:adb shell dmesg,adb shell dumpstate,adb shell dumpsys,adb bugreport. 講解一下各自作用:. 通過ddms抓的其實...
- 2【Linux】adb bugreport bugreport.zip doesn't work - githubhot
Hi, $ adb bugreport bugreport.zip Android Debug Bridge version 1.0.32 Revision debian. -a - direc...
- 3Android adb bugreport工具分析和使用_createchance的博客
bugreport是什么,怎么用?Android系统想要成为一个功能完备,生态繁荣的操作系统,那就必须提供完整的应用开发环境。而在应用开发中,app程序的调试 ...
- 4Android測試日誌文件抓取與分析 - 壹讀
bugreport(命令adb bugreport>bugreport.log)。裡面包含有dmesg,dumpstate和dumpsys。 dumpstate是系統狀態信息,裡面比較全,包括手...
- 5Capture and read bug reports | Android Developers
Capture a bug report using adb ... If you do not specify a path for the bugreport, it is saved to...