How to get the Local DB Path in titanium?

192 Views Asked by At

I want to get the local DB path by printing in the console. I tried the following code:

Ti.API.info(Ti.Filesystem.applicationDataDirectory);

1

There are 1 best solutions below

0
miga On

Check out the documentation at https://docs.appcelerator.com/platform/latest/#!/api/Titanium.Database-method-open

var db = Ti.Database.open('mydb1Installed');

iOS:

On simulator

/Users/<user name>/Library/Application Support/iPhone Simulator/<iOS version>/Applications/<apple app id>/Library/Private Documents/mydb1Installed.sql

On device

/Applications/<apple app id>/Library/Private Documents/mydb1Installed.sql

Android:

file:///data/data/appID/databases/mydb1Installed