LG4 - Can't Find App's Data


Question

I have a LG4 and I have installed an app being developed internally. I am trying to view the data of this app but can't find it.



Do I have to root the phone to be able to view the data? I look in both internal storage and SD card but can't find the app.



Internal Storage/SD Card



I have no data directory in the root, only Android/Data and in there it's




  1. com.airbnb...

  2. com.android...

  3. com.google...

  4. com.lge...



Any help would be appreciated.



Thanks


Answer

An app has private data and optionally public data. The private data goes inside a directory with name as the package name and located inside /data/data/ - an ordinary user/app cannot read that data. The public data may either go into internal SD card or external SD card, whichever is set as default and the app having permission to write it. /sdcard/Android/data is where often the public data goes. Some apps opt to create a dedicated folder under the root of default storage as well.



Now, how do you access the private data?




  • Since you noted that the app is in development, it may be possible that it is marked as debuggable1 (android:debuggable="true"). If that's the case, then setup in PC and execute the command:



    adb shell 
    run-as PACKAGE # PACKAGE is the package name of your app


    Note: run-as would work only for debuggable apps.



    If successful, run-as would drop you into the data directory of your app where you can see whatever you intend to see.



    Follow this answer from marmor as an example.


  • If the app hasn't explicitly declared itself not to be backed up1 (android:allowBackup="false"), you can use adb to backup the app. To do so, execute the command:



    adb backup PACKAGE


    This will create a file named backup.ab in the working directory from where adb is called.



    In order to extract the data from the backup, follow an answer from here: How do you extract an App's data from a full backup made through "adb backup"?


  • Yes, if the first two methods fail, then the Android should be rooted. Once you've root, you can use a file explorer or even a terminal emulator app to read the desired data.






1 Unless there is an explicit app to tell you so, you would be required to read the manifest of the involved app in order to ascertain whether it is debuggable or disallows backup. Axel (XML Editor / Viewer) and App Browser can help you to read manifest.


Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes