How to access data/data folder in Android device? - Stack ...
文章推薦指數: 80 %
Viewing private files created by an android app - Stack Overflow
Home
Public
Questions
Tags
Users
Collectives
ExploreCollectives
FindaJob
Jobs
Companies
Teams
StackOverflowforTeams
–Collaborateandshareknowledgewithaprivategroup.
CreateafreeTeam
WhatisTeams?
Teams
CreatefreeTeam
CollectivesonStackOverflow
Findcentralized,trustedcontentandcollaboratearoundthetechnologiesyouusemost.
Learnmore
Teams
Q&Aforwork
Connectandshareknowledgewithinasinglelocationthatisstructuredandeasytosearch.
Learnmore
Howtoaccessdata/datafolderinAndroiddevice?
AskQuestion
Asked
9years,1monthago
Active
11monthsago
Viewed
747ktimes
370
179
IamdevelopinganappandIknowmydatabase*.dbwillappearindata/data/com.****.***
IcanaccessthisfilefromAVDinEclipsewithhelpofsqlitemanager
ButIcan'taccessthisfileinmyAndroidphone.
IgoogleditanditsaysIneedtorootmyphonetodoit,butIdon'twanttodothat.
HowcanIaccessmydata/data/.....directoryinmyAndroidphone"withoutrootingit"?
CanIchangeuserpermissionsforthedirectorydata/data.....withoutrootingit?
androidandroid-emulatorandroid-sqliteadb
Share
Follow
editedDec14'20at10:57
phrogg
76911goldbadge1212silverbadges2525bronzebadges
askedOct22'12at6:56
NaveenPrincePNaveenPrinceP
4,28233goldbadges1414silverbadges1717bronzebadges
6
1
douhavedatabase.dbfile..???
– AmitPrajapati
Oct22'12at7:01
siamusingdatabase-"openOrCreateDatabase(....)"
– NaveenPrinceP
Oct22'12at16:36
5
Youwilldefinitelyneedtorootthephonefirstofall.Thenyouwillneedacompetentfilemanagerappyoucanuse.ASTROfilemanagerispopularbutithasnorootaccesssupportsoit'suselessforpowerusers.YoushouldbeabletouseESFileExplorerorFileExpert.Ihaverecentlyhadproblemsviewing/data/dataorotherprotectedfolderswithESFileExplorerandhaveprettymuchabandonedit,andIamnowusingFileExpert.Theybothrequirethatyougointosettingsandenablerootexploreroption(andsometimesalsomountthefilesystemaswritable).Soyouneedtodothatfirst.
– Samir
Jul5'13at10:33
Thisisnotprogrammingrelatedquestionnoranswers.
– SkyWalker
Apr3'15at7:33
stackoverflow.com/a/18472135/1778421
– AlexP.
Oct3'16at3:40
|
Show1morecomment
18Answers
18
Active
Oldest
Votes
421
Accessingthefilesdirectlyonyourphoneisdifficult,butyoumaybeabletocopythemtoyourcomputerwhereyoucandoanythingyouwantwithit.
Withoutrootingyouhave2options:
Iftheapplicationisdebuggableyoucanusetherun-ascommandinadbshell
adbshell
run-ascom.your.packagename
cp/data/data/com.your.packagename/
AlternativelyyoucanuseAndroid'sbackupfunction.
adbbackup-noapkcom.your.packagename
Youwillnowbepromptedto'unlockyourdeviceandconfirmthebackupoperation'.It'sbestNOTtoprovideapassword,otherwiseitbecomesmoredifficulttoreadthedata.Justclickon'backupmydata'.Theresulting'backup.ab'fileonyourcomputercontainsallapplicationdatainandroidbackupformat.Basicallyit'sacompressedtarfile.ThispageexplainshowyoucanuseOpenSSL'szlibcommandtouncompressit.
Youcanusetheadbrestorebackup.dbcommandtorestorethebackup.
Share
Follow
editedJun12'16at8:33
answeredJul26'13at8:38
THelperTHelper
14.6k66goldbadges6060silverbadges9797bronzebadges
23
20
adbbackup-f\location\on\local\drive-noapkapp.package.nameworkedformewithoutroot
– theblang
Dec4'13at16:28
28
Usethiscommandtouncompressyourbackupfile:ddif=backup.abbs=24skip=1|opensslzlib-d>backup.tar
– Human
Mar17'14at18:27
12
InOption1,howdoItellthecpcommandtosavethemtomylaptop(Mac)?IfyougiveaWinexample,I'dliketoknowtoo,andwilljusttranslateit.Thanks.
– Gerard
Sep3'14at4:20
12
Important:Runningadbbackup-noapkcom.your.packagenamewillsavetheabfileonthecurrentdirectory,somakesureyouhavenavigatedintherightdirectory(e.g.cdDesktop..)
– MenelaosKotsollaris
May20'15at15:12
18
Notethatthebackupapproachwillyieldanemptybackupifyourapphasdisabledbackupsviaandroid:allowBackup="false"inthemanifest.
– Tom
May1'19at1:24
|
Show18morecomments
165
IfyouareusingAndroidStudio3.0orlaterversionthenfollowthesesteps.
ClickView>ToolWindows>DeviceFileExplorer.
Expand/data/data/[package-name]nodes.
Youcanonlyexpandpackageswhichrunsindebugmodeonnon-rooteddevice.
Share
Follow
editedMay20'17at18:39
answeredMay20'17at18:24
ShahidulShahidul
2,64911goldbadge1919silverbadges2020bronzebadges
9
1
icantseeanythinginthisdock.andsaymenothingshow.doyouknowwhatstheproblem?
– MahdiAzadbar
Jun25'17at8:34
4
Thisworksonlyindebug-mode,notforrelease-builds
– itinance
Aug2'17at8:35
Thankyouforshowingtheno-pitawaytolookintothefilesystem!
– Lensflare
Feb20'18at17:03
2
thisisawesome.WishIhadknownthisawhileago.
– checkmate711
Sep12'18at18:40
1
Forthosewondering,thepathisusuallysomethinglike:/data/user/0/[package.name]
– SmartyP
Dec24'18at10:47
|
Show4morecomments
57
Youcouldalsotryfetchingthedbusingrootexplorerapp.Andifthatdoesnotworkthenyoucantrythis:
Opencmd
Changeyourdirectoryandgointo'Platformtools'
Type'adbshell'
su
Press'Allow'ondevice
chmod777/data/data/data/data/data/com.application.package/data/data/com.application.package/*
OpenDDMSviewinEclipseandfromthereopen'FileExplorer'togetyourdesiredfile
Afterthisyoushouldbeabletobrowsethefilesontherooteddevice.
Share
Follow
editedMay2'18at15:54
answeredOct22'12at7:17
SherazAhmadKhiljiSherazAhmadKhilji
8,12288goldbadges4848silverbadges8383bronzebadges
9
3
ithinkrootexploreappworksonlyforrootedphones.Iwilltry2ndmethod
– NaveenPrinceP
Oct22'12at16:40
6
Unabletochmod/data:Operationnotpermitted
– bofredo
Aug22'13at15:47
@bofredoIthinkitsbecauseyourphoneisn'trooted.youshouldrootyourphoneandthentrythis
– SherazAhmadKhilji
Feb3'14at6:42
1
@mahemadhiyesyouwouldprobablyhavetorunthiscommandmanuallyforeverydirectoryasalldirectorieshavepermissionsthatareprivatetothem.
– SherazAhmadKhilji
Mar24'14at6:44
1
@VivekChavdayuptheyrequirerootedphone
– SherazAhmadKhilji
May2'18at15:53
|
Show4morecomments
21
Todoanyoftheabove(i.e.accessprotectedfoldersfromwithinyourphoneitself),youstillneedroot.(Thatincludeschangingmount-permissionsonthe/datafolderandaccessingit)
Withoutroot,accessingthe/datadirectlytoreadexceptfromwithinyourapplicationviacodeisn'tpossible.Soyoucouldtrycopyingthatfiletosdcardorsomewhereaccessible,andthen,youshouldbeabletoaccessitnormally.
Rootingwon'tvoidyourwarrantyifyouhaveadeveloperdevice.I'msorry,thereisn'tanyotherwayAFAIK.
Share
Follow
editedOct5'13at16:07
answeredOct22'12at7:03
AnirudhRamanathanAnirudhRamanathan
44.6k2121goldbadges122122silverbadges180180bronzebadges
8
iamnotusingandevelopersdevice.MineisXperiaU
– NaveenPrinceP
Oct22'12at16:29
caniedituserpermissionofdatafolderwithchmodecommands?
– NaveenPrinceP
Oct22'12at16:37
Thewholepartitionismountedasread-only.I'dsayyourbestbetwouldbeadbpullasmentionedinthebelowanswer.
– AnirudhRamanathan
Oct22'12at16:39
Iispossibleiftheapplicationallowsit.Thedirectoriesallhavexpermissionforeverybody(butnorforeverybody,soyouhavetoknowthepath).Thanitdependsonwhethertheapplicationmadethefileworldaccessibleornot.Somefilesare,mostarenot.
– JanHudec
Oct4'13at9:08
Firstyousayit'simpossibletoread,thenyousuggesttocopythefileelsewhere.But,howtocopyafilewithoutreadingitinthefirstplace?Ithinkthisanswer'sbuggy.
– untill
Jun10'15at12:57
|
Show3morecomments
13
Theeasiestway(justonesimplestep)topullafilefromyourdebuggableapplicationfolder(let'ssay/data/data/package.name/databases/file)onanunrootedAndroid5.0+deviceisbyusingthiscommand:
adbexec-outrun-aspackage.namecatdatabases/file>file
Share
Follow
answeredAug7'15at15:07
AlexP.AlexP.
27.8k1616goldbadges109109silverbadges158158bronzebadges
0
Addacomment
|
13
Openyourcommandprompt
ChangedirectorytoE:\Android\adt-bundle-windows-x86_64-20140702\adt-bundle-windows-x86_64-20140702\sdk\platform-tools
Enterbelowcommands
adb-dshell
run-ascom.your.packagenamecatdatabases/database.db>/sdcard/database.db
Changedirectorytocd/sdcardtomakesuredatabase.dbisthere.
adbpull/sdcard/database.dborsimplyyoucancopydatabase.dbfromdevice.
Share
Follow
editedApr30'16at17:32
LeosLiterak
7,8781313goldbadges6363silverbadges124124bronzebadges
answeredSep11'14at10:44
IsuraAmarasingheIsuraAmarasinghe
76277silverbadges1212bronzebadges
1
Worksperfectforme.Thanks!Butinmycase,thedatabasefilenamehasno.dbextension.
– technik
Apr17'17at17:53
Addacomment
|
10
UseFileExplorerineclipse.SelectWindows=>ShowView=>Other...=>FileExplorer.
Ananotherwayispullthefileviaadb:
adbpull/system/data/data/
延伸文章資訊
- 1Where Android apps store data?
All apps (root or not) have a default data directory, which is /data/data/<package_name> . By def...
- 2Edit data folder on Android 11 - Rhythm Software
Only system level file manager has the permission to access data folder. Open Data File By QuickE...
- 3Access app-specific files | Android Developers
Your app doesn't require any system permissions to read and write to files in these directories. ...
- 4Where are Android app files stored? - OS Today
How do I access internal storage?
- 5How to access data/data folder in Android device? - Stack ...
Viewing private files created by an android app - Stack Overflow