-->

What version of sqlite does iOS provide?

2019-02-01 21:09发布

问题:

What version of Sqlite does iOS include?

回答1:

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         ║
╚═════════════╩════════════════╝


回答2:

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


回答3:

I've just checked on the iOS 7:

7.0: 3.7.13


回答4:

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.



回答5:

SQLite has been updated in iOS 8.2 to version 3.8.5



回答6:

In iOS 9.0 the SQLite version is 3.8.10.2



回答7:

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.