Monday , November 29 2021

How to Access SQLite Database in Android using ADB Shell? – Android Coding by DMTechnolab

Sometimes when developing applications we need to see the database. Android has a SQLite database and there is no direct option to view the database in Android Studio. So today we will learn to access SQLite database using ADB Shell. So if you are thinking How to access SQLite database in Android So keep reading.

Android sqlite tutorial

  • If you want to learn how you can handle SQLite database in your Android application, just go through this playlist for a detailed description.

https://www.youtube.com/watch?v=videos

How to access SQLite database in Android?

Just follow these steps and you will be able to access and run queries for your SQLite database using a command prompt.

SDK Location Search

  • First you need to find the SDK location of your system. Go for it File -> Settings.

How to access SQLite database in AndroidHow to access SQLite database in Android

  • Now you can see the SDK location in the window.

How to access SQLite database in AndroidHow to access SQLite database in Android

Go to SDK location in command prompt

  • Now open the command prompt and write the following command.
  • Again run the following command.
  • You are now inside the directory Stage equipment.

How to access SQLite database in AndroidHow to access SQLite database in Android

Enable adb route

  • To access the database we have to enable adb root. For this, just run the following command.

Listing tool

  • Now we will list all the running emulators and devices. For this, run the following command.
  • This will show you all the running devices.

How to access SQLite database in AndroidHow to access SQLite database in Android

  • As you can see I have only one device for now.

Connecting to device shell

  • Run the following command to connect the shell to your device.
  • Don’t forget to change Emulator Name In the above command.
  • And after running the command you will connect to the device.

How to access SQLite database in AndroidHow to access SQLite database in Android

Going to device’s database folder

  • To access the database folder, run the following command again.
  • Don’t forget to change net.simplifiedcoding.androidmysqlsync With the package name of the application you want to access.

Connecting to SQLite Database

  • Run the following command to connect to the SQLite database.
  • In the above order NamesDB My database is name, you have to replace it with your database name.

How to access SQLite database in AndroidHow to access SQLite database in Android

  • Bingo! We are associated with the database.
  • Now you can run the command .help for SQLite Cheat Sheet To view or modify a database.

So this is how you can simplify your work of SQLite in Android. If you are having any confusion or trouble, feel free to leave your comment. Thank you 🙂

Belal Khan ProfileBelal Khan Profile

Hi, my name is Belal Khan and I am Google Developers Specialist (GDE) for Android. A passion for teaching made me this blog. If you are an Android developer, or you are learning about Android development, I can help you a lot with simplified coding.


Source link

About dmtechnolab

Check Also

Simplified Coding

Android Espresso Tutorial – Testing Fragment in Isolation – Android Coding by DMTechnolab

Welcome to another tutorial in the Android test series. And this post is called Android …

One comment

  1. I do not know whether it’s just me or if perhaps
    everybody else encountering problems with your site.
    It appears as though some of the text on your posts are running off the screen.
    Can someone else please provide feedback and let me know if
    this is happening to them as well? This might be
    a issue with my browser because I’ve had this happen previously.
    Kudos

Leave a Reply

Your email address will not be published. Required fields are marked *