Capture and read bug reports | Android Developers

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

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 中文–简体 日本語 한국어



請為這篇文章評分?