How to show SQLite Debug output from Core Data in iOS

Add this statement to your app’s Run Scheme

-com.apple.CoreData.SQLDebug 1

and your Log Console shall be populated with fascinating statements such as

2013-11-20 18:49:53.715 YourApp[6245:70b] CoreData: annotation: Connecting to sqlite database file at “/Users/versluis/Library/Application Support/iPhone Simulator/7.1-64/Applications/1FED9364-3039-4D47-967E-9B075CBE8277/Documents/PatchBay.sqlstore”
2013-11-20 18:49:53.717 YourApp[6245:70b] CoreData: sql: pragma journal_mode=wal
2013-11-20 18:49:53.718 YourApp[6245:70b] CoreData: sql: pragma cache_size=200
2013-11-20 18:49:53.719 YourApp[6245:70b] CoreData: sql: SELECT Z_VERSION, Z_UUID, Z_PLIST FROM Z_METADATA





Jay is the CEO and founder of WP Hosting, a boutique style managed WordPress hosting and support service. He has been working with Plesk since version 9 and is a qualified Parallels Automation Professional. In his spare time he likes to develop iOS apps and WordPress plugins, or draw on tablet devices. He blogs about his coding journey at http://wpguru.co.uk and http://pinkstone.co.uk.