1. 程式人生 > >65.iOS下面LKDatabase 匯出和檢視

65.iOS下面LKDatabase 匯出和檢視

一 .匯出

xcode->window->devices and Simulators

在Name裡面選中自己專案

然後點選那個有點像設定的圖示,選擇 Download Container...

二. 檢視資料庫

2.1.cd到檔案匯出目錄,進去匯出的資料夾->cd AppData/Documents/LKHTest,然後可以看到LK的db檔案,如下:

65.iOS下面LKDatabase 匯出和檢視

2.2 開啟db檔案

命令列輸入 sqlite3 lkdbhelperTest.db

當然也可以用資料庫檢視工具開啟

三. 基本sqlite3語法

.exit
.help 檢視幫助 針對命令
.database 顯示資料庫資訊;包含當前資料庫的位置
.tables 或者 .table 顯示錶名稱  沒有表則不顯示
.schema 命令可以檢視建立資料物件時的SQL命令;

select * from tbl_xxx;