What version of sqlite does iOS provide?

2019-02-01 21:01发布

What version of Sqlite does iOS include?

7条回答
smile是对你的礼貌
2楼-- · 2019-02-01 21:15

This wiki has the latest list, which is currently:

╔═════════════╦════════════════╗
║ iOS Version ║ SQLite Version ║
╠═════════════╬════════════════╣
║ 2.2         ║ 3.4.0          ║
║ 3.1.3       ║ 3.6.12         ║
║ 4.0.2       ║ 3.6.22         ║
║ 4.1.0       ║ 3.6.23.2       ║
║ 4.2.0       ║ 3.6.23.2       ║
║ 5.1.1       ║ 3.7.7          ║
║ 6.0.1       ║ 3.7.13         ║
║ 7.0         ║ 3.7.13         ║
║ 7.0.6       ║ 3.7.13         ║
║ 8.0.2       ║ 3.7.13         ║
║ 8.2         ║ 3.8.5          ║
║ 9.0         ║ 3.8.8          ║
║ 9.3.1       ║ 3.8.10.2       ║
║ 10.0 beta 2 ║ 3.13.0         ║
║ 10.0 GM     ║ 3.14.0         ║
║ 10.2        ║ 3.14.0         ║
║ 10.3.1      ║ 3.16.0         ║
║ 11.0        ║ 3.19.3         ║
║ 12.0        ║ 3.24.0         ║
╚═════════════╩════════════════╝
查看更多
我命由我不由天
3楼-- · 2019-02-01 21:15

In iOS 9.0 the SQLite version is 3.8.10.2

查看更多
劫难
4楼-- · 2019-02-01 21:16

Just do:

p (const char*) sqlite3_libversion()

in a debugger running an app (that links to the sqlite lib) on a device on which you want to know the sqlite version.

On an iOS 8.0.2 iPhone 5s I get 3.7.13 so it seems they haven't changed version in a while based on reports in the other answers that version 6.0 used the same version.

查看更多
Evening l夕情丶
5楼-- · 2019-02-01 21:19

I've just checked on the iOS 7:

7.0: 3.7.13
查看更多
一夜七次
6楼-- · 2019-02-01 21:31

Using SELECT sqlite_version() on various iOS versions:

From the internets:

2.2: 3.4.0
3.1.3: 3.6.12
4.0.2: 3.6.22
4.1.0: 3.6.23.2
4.2.0: 3.6.23.2

I just tested now:

6.0.1: 3.7.13
查看更多
forever°为你锁心
7楼-- · 2019-02-01 21:32

Use following to printout the version in your code. You may define following as a separate debug only function and call it from didFinishLaunchingWithOptions in your appDelegate.

#if DEBUG
// Int representing version; e.g. "3016000" for macOS 10.12.4
int sqliteVersion = sqlite3_libversion_number();
NSLog(@"Sqlite Version: %d", sqliteVersion);

// String representing version; e.g. "3.19.3" for iOS 11
const char *sqliteLibVersion = sqlite3_libversion();
NSString *sqliteLibVersionStr = [NSString stringWithUTF8String:sqliteLibVersion];
NSLog(@"Sqlite Lib Version: %@", sqliteLibVersionStr);

// String representing sourceId; e.g. "2017-06-27 16:48:08 2b09...2e2377b" on iOS11
const char *sqliteSourceid = sqlite3_sourceid();
NSString *sqliteSourceidStr = [NSString stringWithUTF8String:sqliteSourceid];
NSLog(@"Sqlite SourceID: %@", sqliteSourceidStr);
#endif

Alternatively, look at sqlite3.h directly in Xcode. For iOS 11:

#define SQLITE_VERSION        "3.19.3"
#define SQLITE_VERSION_NUMBER 3019003
#define SQLITE_SOURCE_ID      "2017-06-27 16:48:08 2b09...2e2377b"

sqlite3.h also has other methods that can be used for debugging purposes.

查看更多
登录 后发表回答