Fetching Database on Mobile Devices via Terminal

Published on : 05 Aug 2020


fetching database on mobile device

One of the most common and probably the most essential operations in a data-driven application is fetching data from the database. So, at times when developing an application, we need to see the database. While Android has SQLite Database and the Android Studio has no direct option to view the database. So, today we will be learning how to access Databases on an Android. The article will guide you step by step, providing you visual representation to help you efficiently fetch data from the database. This is especially useful in case you have a web server, and you wish to access data on an android application.

How to Access database on Android

If the mobile phone is rooted, all applications install in that mobile device are vulnerable. This can compromise application data. There are multiple ways to fetch the database of a mobile device and even the applications installed in there, one of them we will be using, Terminal.

To access the database of the application, it is required to check if the application has enabled ANDROID: BACKUP= True. If it is enabled, it is easy to retrieve the database of a particular application.

For this you require:

1) Rooted Device

2) Terminal Installed 

Steps: 

  • Create a Backup folder in the Mobile device.
  • open terminal and gain super user permission using “su” command
  • go to data/data folder 
  • find . –name “*.db” –type f –exec cp {} /mnt/sdcard/Backup \;
  • Open windows2 of the terminal. gain SU access 
  • locate the directory, and you got the database available the mobile device 

Watch the video here:

4.5/5 - (2 votes)
Narendra Sahoo
Narendra Sahoo

Narendra Sahoo (PCI QPA, PCI QSA, PCI SSF ASSESSOR, CISSP, CISA, CRISC, 27001 LA) is the Founder and Director of VISTA InfoSec, a global Information Security Consulting firm, based in the US, Singapore & India. Mr. Sahoo holds more than 25 years of experience in the IT Industry, with expertise in Information Risk Consulting, Assessment, & Compliance services. VISTA InfoSec specializes in Information Security audit, consulting and certification services which include GDPR, HIPAA, CCPA, NESA, MAS-TRM, PCI DSS Compliance & Audit, PCI PIN, SOC2 Compliance & Audit, PDPA, PDPB to name a few. The company has for years (since 2004) worked with organizations across the globe to address the Regulatory and Information Security challenges in their industry. VISTA InfoSec has been instrumental in helping top multinational companies achieve compliance and secure their IT infrastructure.