List of Useful ADB and Fastboot Commands - DroidWin

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

Most Commonly Used ADB Commands: Check ADB Connection; ADB Shell Command; Reboot to Bootloader/Fastboot Mode; Reboot to TWRP or Stock Recovery; Pull Any File ... SkiptocontentThistutorialcontainsa comprehensivelistofthemostimportantandcommonlyusedADBandFastbootCommands.Moreover,instructionsonHowtoEnableDeveloperOptionsandUSBDebuggingonanAndroiddevicearealsoincluded.Likewise,thistutorialalsocontainsadetailedinstructionsetregardingthestepstoInstallADBandPlatformToolsonanyPC.Attheendofthisguide,wehavelistedoutallthepossibleADBandFastbootErrorsaswellastheinstructionstofixthem.ADBorAndroidDebugBridgeisacommand-linetoolthatisapartoftheAndroidSoftwareDevelopmentToolkit.ItismostlyusedforestablishingasuccessfulconnectionbetweenthePCanddevice,whichcouldthenbeusedforperformingvariousfunctions.Theseincludefileinstallation,rebootingtofastbootorrecovery,unlockingthebootloader,andmanymore.Franklyspeaking,therearetonsandtonsofADBandFastbootcodes,butthemajorityofthemaren’tevenrequiredmostofthetime.Thereforeratherthandraggingthisguidewithunnecessarycodes,Iwouldbecoveringthemostimportantanddailyusedones.Plusadescriptionofeachofthecodeswillalsobeprovidedsidebyside.Foryourconvenience,theguideisbrokendownintotwosegments.ThefirstonecoverstheADBcodeswhereasthenextoneisallaboutthevariousFastbootcommands.Butbeforebeginningwiththeprocess,havealookattheprerequisitessectionbelow.TableofContentsInstallADBandFastbootPlatformToolsEnableUSBDebuggingonyourDeviceMostCommonlyUsedADBCommands:CheckADBConnection ADBShellCommandReboottoBootloader/FastbootModeReboottoTWRPorStockRecoveryPullAnyFileviaADBPullPushfilesviaADBPushADBSideloadStartADBServerKillADBServerInstallAPKviaADBCommandUpdateAPKviaADBCommandMoveApptoSDCardviaADBUninstallAppviaADBCommandRareButImportantADBCommandsCheckInstalledAppsviaADBCheckSystemAppsviaADBUninstallSystemAppsviaADBListAllThirdPartyAppsviaADBTakeScreensbhotviaADBDeleteFileviaADBDeleterFolderviaADBCreateNewFolderviaADBCopyFilesviaADBMoveFilesviaADBMostCommonlyUsedFastbootCommandsReboottoFastbootModeVerifytheADBConnectionUnlockBootloaderviaFastbootRelockBootloaderviaFastbootBoottoTWRPviaFastbootInstallFiletoBootPartitionInstallTWRPToRecoveryPartitionEraseUserdataEraseEverythingviaFastbootCheckCurrentActiveSlotChangeActivePartitionReboottoOSfromFastbootRebootfromFastboottoRecoveryModeBoottoFastbootDModeHowtoFixAllPossibleADBandFastbootErrorsInstallADBandFastbootPlatformToolsForthesecommandstorun,youwouldeitherberequiredtodownloadADBandFastbootPlatformTools(Windows|Linux|macOS).ThisistheofficialtoolprovidedbyGoogleandyoushouldonlyusethisone,notanyotherthird-partyADBbinaries.IfyouareusingADBandPlatformTools,thenafterinstallingthem,youneedtoexecutethecodesusingthePowerShellWindowortheCommandPrompt.Let’ssayyouinstalledthetoolsinC:\adb,thenforusingthePowershellorCommandPrompt:Goinsidethatfolder(i.eC:\adb\platform-tools),WhilepressingtheShiftkeyright-clickonanemptylocation.Select‘OpenPowerShellwindowhere.Begintypingthecodes.Ontheotherhand,ifyouprefertouseCommandPrompt,thenheadovertotheplatform-toolsfolder,typeinCMDintheaddressbar,andhitEnter.ThiswilllaunchtheCMDwindow.EnableUSBDebuggingonyourDeviceForenteringanyADBorFastbootcommands,youneedtomakesurethatthePCrecognizesyourdevice.Forthattohappen,youneedtoenablethe‘USBDebugging’optiononyourdevice.Followthebelowpointsforthesame:Gotothe‘Settings’optionsonyourdevice.Headoverto‘AboutPhone’.Tapon‘BuildNumber’7times.Youwillgetatoastmessageindicatingthat‘Youarenowadeveloper!’.Gobackto‘Settings’.[OnlyforAndroidPiedevices]Goto‘System’>‘Advanced’.Navigateto‘DeveloperOptions.Enable‘USBDebugging’fromthere.Ifyouarealsogoingtounlockthebootloader,thenenable‘OEMUnlocking’fromthereaswell.IMPORTANTNOTESWhereveryouwillneedtoenter‘filename’inanycommand,alwaysenteritwithitsextension.Forexample,ifyouaresideloadingarecovery(namedtwrp.img),thecorrectcodewouldbeadbsideloadtwrp.img[noticethe.imgextensionattheend].Also,ifyouwanttoflash/send/bootanyfiletothedevice,makesuretomovethefiletothelocationwhereADBandFastbootPlatformToolsorMinimalADBandFastbootisinstalled.MostCommonlyUsedADBCommands:Forthefirsthalfoftheguideon“MostImportantADBandFastbootCommands”,wewillbefocusingonvariousADBcodes.CheckADBConnection TocheckwhetherthedeviceisproperlyconnectedandisinADB,enterthebelowcode.Untilyougetanalphanumericcodewiththeword‘device’nexttoit(seescreenshotbelow),youcannotcarryoutanyfurtheroperations.Also,makethatdeviceisnotrecognizedas‘unauthorized’.Don’tMiss: FixWaitingforDeviceErrorinADBDevicesadbdevicesADBShellCommandTointeractwithyourdevice’soperatingsystem,enterthebelowcodes.Whereastherearetonsofadbshellcommands,youcouldfindthemostimportantonesinthisguide.adbshellReboottoBootloader/FastbootModeUsethebelowcommandtobootthedevicetoFastbootorBootloaderModeadbrebootbootloaderDon’tMiss: HowtoFixAndroidDevicestuckinFastbootModeReboottoTWRPorStockRecoveryTobootyourdevicetoTWRPorstockrecoveryfromthebootedOS,usethebelowcommand:adbrebootrecoveryDon’tMiss: HowtoBootintoRecovery(TWRP/Stock)fromFastbootModePullAnyFileviaADBPullTo‘pull’anyfilefromyourdeviceandsenditovertoPC,enter:adbpull/file-location-on-device/filenamePushfilesviaADBPushSimilarlyto‘push’anyfiletothedevicefromPC,type:adbpushfilename/location-where-file-is-to-be-sent-on-deviceADBSideloadUsingthiscommand,youcouldflash(install)zipfilesdirectlyfromthecommandshell,ifyourrecoverysupportsit(goodnews-TWRPdoessupport).Bootyourdeviceto‘TWRPrecovery’>Goto‘Advanced’>‘Sideload’>‘Swipetostartsideload’.Nowenterthebelowcode:Readthisdetailedguide: HowtoUseADBSideloadinAndroid[StockandTWRPRecovery]adbsideloadfilenameStartADBServerWhenyouneedtostarttheADBserver,incaseitdoesnotautomatically“killsthedaemon”and“startonaspecificport”,typethebelowcommand:adbstart-serverKillADBServerIfthecommandtoolgetshangedorisnotperformingasexpected,youmaykilltheserverbyenteringthebelowcode:adbkill-serverInstallAPKviaADBCommandToinstallanAPKfileonyourdevice,enterthebelowcommand:adbinstallfilename.apkUpdateAPKviaADBCommandToreinstallorupdateanAPK,type:adbinstall-rfilename.apkMoveApptoSDCardviaADBTomovetheapptosdcard(ifsupportedbyyourdevice):adbinstall-sfilename.apkUninstallAppviaADBCommandTouninstallanAPKfileonyourdevice,type:adbuninstallfilename.apkRareButImportantADBCommandsHerearesomeotherADBCommandsthatmightcomeinhandyonceawhile.CheckInstalledAppsviaADBTolistalltheapppackagesname:adbshellpmlistpackagesCheckSystemAppsviaADBTolistallthesystemapps:adbshellpmlistpackages-sUninstallSystemAppsviaADBTouninstallsystemappsoranybloatware:adbshellpmuninstall-k–user0app-package-nameListAllThirdPartyAppsviaADBTolistthird-partyappsinstalled:adbshellpmlistpackages-3TakeScreensbhotviaADB18.Tocapturescreenshotfromyourdevice:[DetailedGuide:HowtoTakeScreenshotsinAndroidviaADBCommands]adbshellscreencap/sdcard/screenshot.pngThentodownloadthecapturedscreenshottoyourPC:adbpull/sdcard/screenshot.pngDeleteFileviaADBTodeleteafile,type:adbshellrm-f/sdcard/OPWallpaperResources.apkDeleterFolderviaADBTodeleteafolder,enterthebelowcode:adbshellrm-d/sdcard/ZooperWidgetCreateNewFolderviaADBTocreateanewfolderonyourdevice,type:adbshellmkdir/sdcard/NewFolderCopyFilesviaADBTocopyafilefromonelocationandpasteittoanotherlocation(onyourdevice),type:adbshellcp/sdcard/OPWallpaperResources.apk/sdcard/LiveWallpapersMoveFilesviaADBTomoveafilefromonelocationtoanother(onyourdevice),enterthebelowcode:adbshellmv/sdcard/OPWallpaperResources.apk/system/appSothiswasthefirstpartoftheguideonADBandFastbootCommands.LetusnowmoveontothesecondhalfandbeginwiththeFastbootcodes.MostCommonlyUsedFastbootCommandsHerearesomeofthemostcommonlyusedFastbootCommands.ReboottoFastbootModeTorebootyourdevicetofastbootorbootloadermode,enterthebelowcode:adbrebootbootloaderVerifytheADBConnectionOnceyourdeviceisbootedtofastbootmode,enterthebelowcommandtocheckwhethertheconnectionissuccessfulornot.Ifyouseeanalphanumericcodeandthewordfastbootwrittennexttoit(seescreenshotbelow),itmeansyourdeviceissuccessfullyconnectedtofastbootmode.Nowyoumaytryoutotherfastbootcommands.fastbootdevicesUnlockBootloaderviaFastbootTounlockthebootloaderofyourdevice,typeinanyofthetwocodes(makesure‘OEMUnlocking’isenabledfromthe‘DeveloperOptions’).Formostofthedevices,thefirstcodeworkswellandfine.However,ifthatisnotthecasewithyou,thengoforthesecondone.Also,notethatbothofthesecodeswillwipeallyourdata.Makesuretocreateabackupbeforeproceeding.DoRead:HowtoUnlockBootloaderofAnyAndroidDevicefastbootoemunlockORfastbootflashingunlockRelockBootloaderviaFastbootTorelockthebootloaderofyourdevice,enter:fastbootoemlockORfastbootflashinglockBoottoTWRPviaFastbootTobootarecoveryfileonyourdevice,enterthebelowcode:Don’tMiss:HowtoBootintoTWRPRecoveryfastbootbootrecovery-name.imgOnRedmidevices,youmayalsousethefastbootrebootcommandandatthesametime,pressandholdtheVolumeUpkey.YourdevicewillstraightawayboottoTWRP.Don’tMiss: TWRP:fastbootflashvsfastbootboot:WhichcommandtouseInstallFiletoBootPartitionToflash(install)abootfilefromthecommandshell,suchasflashingmagiskpatchedboot.img,typeinthebelowcode:fastbootflashbootboot-file-name.imgInstallTWRPToRecoveryPartitionToflash(install)arecoveryfilefromthecommandshelltotherecoverypartition,typeinthebelowcode:fastbootflashrecoveryrecovery-name.imgDon’tMiss: HowtoInstallTWRPRecoveryonAndroidEraseUserdataToerasealltheuserdataonyourdevice(i.e.formattingtheuserdatapartition),enterthefollowingcode:fastbooteraseuserdataEraseEverythingviaFastbootThiswilleraseeverythingfromyourdevice.Yourdevicewillbejustasitcameoutoftheboxfastboot-wCheckCurrentActiveSlotIfyouhaveadualA/BPartitiondevice,thenyoucouldcheckthecurrentactivepartitionviathefollowingcommand:fastbootgetvarallAfterexecutingthiscommand,refertothe(bootloader)current-slot:section.[ReadMore:HowtoCheckandChangeCurrentActiveSlotonAndroid]ChangeActivePartitionIfyourdeviceisA/BPartition,andyouwanttoswitchslots,sayfromAtoB,typethebelowcommand:ForalltheA/BpartitionCommands,refertothisguide:HowtoCheckandChangeCurrentActiveSlotonAndroid.fastbootset_activebReboottoOSfromFastbootTorebootyourdevicetoAndroidOS,enterthebelowcode:fastbootrebootRebootfromFastboottoRecoveryModeToRebootfromFastboottoRecoveryMode,eitherTWRPorstock,usethebelowcommand:fastbootrebootrecovery//generalcommandfastbootoemreboot-recovery//forsomedevicessuchasPocoX2BoottoFastbootDModeTobootthedevicetothenewerFastbootDMode:fastbootrebootfastbootDon’tMiss:FixFAILED(remote:Partitionshouldbeflashedinfastbootd)HowtoFixAllPossibleADBandFastbootErrorsWhileononehandthesecommandsofferaplethoraofgoodies,ontheotherhand,theyhavetheirfairshareofissuesaswell.Fortunately,eachofthemcouldbefixedwithoutmuchhassle.IhavecompiledvariousguidespertainingtoallthemajorADBandFastbootErrorsaswellasthestepstofixthem.Likewise,IhavealsodocumentedacomprehensiveguidethatactsasauniversalguideforallADB/FastbootFixes.Sowithoutfurtherado,let’scheckthemout:AUniversalGuidetoFixAllPossibleADBandFastbootErrors[Recommeded]FixWaitingforDeviceErrorinADBorFastbootCommandsFixadbserverversiondoesn’tmatchthisclient;killing.HowtofixADBDevicenotfound[ListofDevicesAttachedisblank]DetailedStepstoFixadbisnotrecognizedErrorHowtoFixUnauthorizedDevicewithADBCommands[3methods]HowtoFixNokiaDeviceStuckinNoCommandScreenFixFailed(remote:‘flashingisnotallowedforcriticalpartitions)FixFAILED(remote:Partitionshouldbeflashedinfastbootd)HowtoFixFAILED(remote:Commandnotallowed)Fixfastboot:error:Couldn’tparsepartitionsize‘0x’HowtoFixAndroidDevicestuckinFastbootModeSothiswasadetailedguidecoveringthemostimportantADBandFastbootcommands.Moreover,wehavealsoprovidedastep-by-steptutorialonHowtoEnableDeveloperOptionsandUSBDebuggingonanyAndroiddevice.However,ifyoufindanyerrorintheabovecodesordidn’tunderstandtheexecutionofanycertaincode,letmeknowinthecommentssectionbelow.HappyCoding!AboutChiefEditorSadiqueHassanadministratorAtechnicalgeekbybirth,healwayshasakeeninterestintheAndroidplatformrightsincethebirthoftheHTCDream.Theopen-sourceenvironmentalwaysseemstointriguehimwiththeplethoraofoptionsavailableathisfingertips.“MBAbyprofession,bloggerbychoice!”Seeauthor'spostsPostnavigation←PreviousPostNextPost→28thoughtson“ListofUsefulADBandFastbootCommands|DownloadPlatformTools”It’sashameyoudon’thaveadonatebutton!I’dcertainlydonatetothissuperbblog!Isupposefornowi’llsettleforbookmarkingandaddingyourRSSfeedtomyGoogleaccount.IlookforwardtofreshupdatesandwillsharethissitewithmyFacebookgroup.Talksoon!ReplyThanksalotfortheseencouragingwords.Yourvaluableviewsandfeedbackforthissitemorethancompensateforthedonations!ReplyPleasehelp.IopenedupapowershellthroughodinandIenteredthecommand“adbdevices”andgotadbserverversion(39)doesn’tmatchthisclient(41);killing…*daemonstartedsuccessfullyListofdevicesattached(Serialnumber)recoveryI’mtryingtosideloadmagisk.Pleasehelp.I’mstilllearningasthisismyfirsttimerootingaphone.ReplyHiVeetz,It’sbecauseyouhavetwoinstancesofADBinstalledonyourPC.DoyouhaveAndroidStudioinstalledaswell?Becauseit’slookingthattheStudio’sADBbinariesareconflictingwiththeAndroidSDKone.Ifyoudon’thaveit,thentryremovingoneinstanceofADBfromtheenvironmentalvariablespath.ReplyhavingissuewithdeviceicanonlyaccessfastbootnotabletobootthedevicewithitsositriedbutbootloaderislockedanywaytounlockoemReplyThisisthebest,wellexplainedadbandfastbootcommandseverReplyThanks,ChrisfortheAppreciation.Replyhello,sirhowcanIfixthiserror?failed(remote:partitiondoesnotexist)pleaseReplyHiAfzalcouldyoupleaseletmethecommandthatyouhaveexecuted?Andalsothedeviceonwhichyouareusingthesecommands.ReplyHelloSir,pleasetellmethatmymobile“Vivo1601”isabletobootloaderunlock…thankingyouforveryinformativewebsiteaginReplyIhaveanalcatel5002H_EEAandicantunlockthebootloaderI’vemanagedtogettofastbootmodewithoemunlockandusbdebuggingonandneithercommand,fastbootoemunlocknorfastbootflashingunlockworkwhatcanIdo?ReplyPingback:[Fixed]HowtofixADBdevicesunauthorizederror-TheAndroidLabSadiqueHassan,IcannotbegintotellyouhowmuchIreallyenjoyreadingyourarticles,yourknowledgeisquiteimpeccableandIhavelearnedagreatdealfromthem,frommysideoftheworld,Thankyousomuch!!ReplyPingback:HowtoExtractBoot.imgfromHTCRUUFirmware-TrendyPortHelloSadiqueHassan,MayIfirstcongratulateyouonanexcellentsetofinstructionsforadb/fastboot.YourarticlesaredefinitelytheclearestandeasiesttofollowIhaveseen!Thanks!NowIhaveaquestion:I’musinganAcerIconiaOne8tablet,modelB1-850runningAndroid5.1,andalsousingtheoriginalpower/data-transfercableitcamewith,NOTacheapalternative.Allyourinstructionsworkedexactlyasdescribed!Iwasabletodovariousthingsonthetabletwithadbcommandsandalsorebootitintorecoverymode.However,thecommand“adbrebootbootloader”didNOTputthetabletintofastbootmodeasexpected,itjustturneditoff.Norestart,itjustshutdown.Why?IstheresomethingelseIwassupposedtodofirst?Itriedunlockingthebootloaderinthedeveloperoptionsmenuonthetablet,butthatmadenodifference.ThenIthoughtitcouldbeadriverproblemsoIinstalledtheAcerdriversdownloadedfromtheirofficialwebsite,butthatalsomadenodifference.ThenItiredtheAndroidbootloaderinterfacedriversasdescribedinoneofyourotherposts,whichalsomadenodifference.Sowhydoesn’titgointofastbootmodeasexpectedifallotheradbcommandsworkcorrectly?I’vehadthistabletfor4yearsandit’sneverfailedonce.ItisNOTrooted,isthatnecessaryfirstperhaps?WouldanOTGinterfacecableinsteadoftheoriginaloneitcamewithmakeanydifference?Thanksforyourhelpinadvance!Clive.ReplyHi,I’mabletoissueADBcommandstomyASUSTF201,alreadyinunlockedbootloader.Fastbootfails,asdeviceisnotrecognized.Ifailtounderstandwhatthecausemightbe…ADBcanrebootintobootloadermode,justbeforeselectingRCK,AndroidorWipeData.Butfromthenon,Fastbootcommandsdonothing.AsifthedeviceisnotseenbymyPC….WhatshouldIdonow?Thanks!ReplyHiMarc,couldyoupleaseinstalltheGoogle’sAndroidBootloaderInterfaceDriversandletmeknowtheresults.Replyhiitestyourwaysthatsayonthistopiclhavearedminote10s.icantinstalltwrponmyphone.inlasttryincmdshoemethis:errortheimulatornotdetect.idontknowwhatdoReplyPingback:WhatisXiaomiEUROM&HowtoFlashXiaomiEUROM[2021]Pingback:WhatisUSBDebuggingandHowtoEnableitonAndroidPhones?-LuciStylePingback:HowtoRemoveGoogleChromefromAndroidDevicesWithoutRoot–Phonefirmware.netPingback:HowtoBootanySamsungDevicetoDownloadModePingback:HowtoFixUnauthorizedDevicewithADBCommands[3methods]Pingback:FIX:UnauthorizedDevicewithADBCommands–AppsforWindows,Mac,LinuxYouneversayhowtogetoutoffastbootmodeasthetitlesays.Verylameman.ReplyPingback:CáchcàiđặtADBvàođườngdẫntrongWindows11dễdàng-GuideCycle.netPingback:Cáchhạcấphệthống/ứngdụngAndroidđơngiảnnhất-GuideCycle.netPingback:CáchcàiđặtTWRPRecoverychoRedmiK40Pronhanhchóng-GuideCycle.netLeaveaCommentCancelReplyYouremailaddresswillnotbepublished.Requiredfieldsaremarked*Typehere..Name*Email*WebsiteThissiteusesAkismettoreducespam.Learnhowyourcommentdataisprocessed.AdsDevicesMustReadDownloadsDownloadsSelectCategoryAndroidAndroidAndroidToolsAppleCustomROMsDefaultDownloadsFacebookGamesGoogleGoogleGoogleAppsGoogleCameraGoogleChromeInstagramiPadiPhoneLGMacMagiskManagerMagiskModulesMotorolaNewsNokiaOnePlusOppoPixelSeriesRealmeRedmiROMsRootSamsungStockFirmwareTipsandTricksTWRPTWRPRecoveryUnbrickUnlockBootloaderVivoWhatsAppWhatsAppWindowsWindowsXiaomiAds



請為這篇文章評分?