开发者

Accessing SQLite database in android emulator

i am working on an android app which stores data in sqlite db i want to be able to access the dat开发者_JS百科a that is currently stored in the emulator. How do i go about connecting to it and perform sql operations.


  • Open a terminal window
  • Get a list of AVD devices by entering: adb devices
  • If your terminal can't find the adb command then have a look at this post for OSX or Windows.
  • Start a shell connection to your AVD by entering: adb -s emulator-xxxx shell
  • Browse to the databases location: cd data/data/your.package.name/databases
  • Type sqlite3 xxxxx.db
  • For SQLite shell instructions see Command Line Shell For SQLite


There is an example on that link about "sqlite command in adb"


In the eclipse, go in to FileExplorer, here you will find three root folders: here go in to 1.data 2.go in to data folder again 3. here you will find all the package names of the applications. 4. once you find your projects particular package, click on it. 5.you will see a folder called 'databases' 6.in that folder you will get the sqlite db file. 7.in order to pull it out of the emulator, just click on it and on the top right corner you will find 3 icons: one to delete, one to pull a file from device and the other to push file in the device. 8. after selecting the db file, click on the icon that says 'pull a file from the device'. Thats it mate ...cheers.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜