如何获取钛的本地数据库路径?

时间:2019-02-14 16:04:56

标签: titanium appcelerator appcelerator-titanium appcelerator-mobile appcelerator-studio

我想通过在控制台中打印来获取本地数据库路径。我尝试了以下代码:

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

1 个答案:

答案 0 :(得分:0)

https://docs.appcelerator.com/platform/latest/#!/api/Titanium.Database-method-open上查看文档

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

iOS:

在模拟器上

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

在设备上

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

Android:

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