Archive for November 2016

Log all SQL statements in an Android app

If you are using SQLite as your data store in an Android app, and you want to try and trace through the SQL statements that are occurring, it can be painful, especially if you are working with a large code base that you may not be 100% familiar with.

Luckily, there is a super easy way to do this with no code changes. Once you have opened the simulator, go to the terminal and execute these commands:

adb shell setprop log.tag.SQLiteLog V
adb shell setprop log.tag.SQLiteStatements V
adb shell stop
adb shell start

Then, in the Android monitor, you will probably want to filter by SQLiteStatements to see the relevant entries.

Ignore warnings in a specific file in Xcode

If you use any 3rd party or open source code in your iOS or macOS application, you know how deflating it is to get your code all compiling with no errors or warnings, only to have your open source code spit out lots of warnings. If only there were a way to ignore warnings in a specific file in Xcode…

Well as it turns out, you can go into the Build Phases section in your target’s settings, find the file or files you want to disable warnings for, double click on the Compiler Flags, and add in the following entry:

-w -Xanalyzer -analyzer-disable-all-checks

This entry will have the additional benefit of also disabling the Clang static code analysis warning messages for the files, which can be just as annoying as the warnings.

BTW, Happy 60th Birthday to the Wizard, Jordan Rudess of Dream Theater. Jennifer and I saw them here in Columbus tonight as they performed The Astonishing live, and the show was great.