Sunday, December 22, 2013

Library Inspector

Library Inspector is a simple tool for inspecting the contents of compiled object code, archives, dynamic libraries (dylib), frameworks and applications. There are two main components, the Library Inspector application, and the Library Inspector Quick Look plugin. The main features provided by Library Inspector include:

  • Quickly display local and exported symbols using colors to visually represent the type of symbol.
  • Flexible filtering search for symbol name and type.
  • Dump Objective-C libraries to header files quickly and easily.
  • Disassemble compiled code to symbolic assembly language at the click of a button.
  • Library-specific icons generated using Quick Look including the architectures included in the library.


Hopper is a reverse engineering tool for OS X, Linux and Windows, that lets you disassemble, decompile and debug (OS X only) your 32/64bits Intel Mac, Windows and iOS (ARM) executables.

Tuesday, November 26, 2013

Avoiding repaints due to :hover selectors while scrolling disabling pointer events during the scroll.

Saturday, November 16, 2013

Reverse engineering Xcode with dtrace

Sample dtrace scripts for tracing Objective-C message sends (with filtering and indentation to make flows easier to follow).

Monday, October 7, 2013


Simple Dev Tools snippet for adding breakpoints when JavaScript changes property values (including ones for built-in objects).

Thursday, July 4, 2013

Python Memory Leaks

Object graph visualization library, as described in these blog posts:

On Mac OS X graphviz should be installed to get the dot tool.

Wednesday, June 12, 2013


Helper tools (fake apps, fake carrier, tap indicator) for recording iOS app screencasts. See this blog post for more details.

Friday, June 7, 2013


PonyDebugger is a remote debugging toolset. It is a client library and gateway server combination that uses Chrome Developer Tools on your browser to debug your iOS application's network traffic and managed object contexts.

Saturday, June 1, 2013

Clear in the iCloud

Clear uses a custom system built on top of iCloud File Storage and it works in a similar fashion to Operational Transformation. The post proceeds to cover the reasons for choosing iCloud, then explores iCCD and subsequently builds a synchronization system from the ground up.

NS: Poor Man’s Namespacing for Objective-C

Preprocessor hack that works around the lack of namespaces in Objective C.

Friday, April 26, 2013

Alternative UIWebView to Objective-C communication paths

WebViewJavascriptBridge (and similar libraries) rely on loading a custom URL scheme in an iframe and intercepting the request in shouldStartLoadWithRequest. Other approaches include embedded WebSockets and HTTP servers (see LinkedIn.

One alternative to consider is modifying document.cookie for some magic cookie name value, and then listening for those changes on the iOS side via NSHTTPCookieManagerCookiesChangedNotification. That might have fewer side-effects that triggering a (sub-)frame load.

Thursday, April 25, 2013

Tuneup JS

Tune-up is a collection of JavaScript utilities that builds upon and improves the UIAutomation library provided by Apple for testing iOS applications via Instruments. While the JavaScript library provided by Apple is fairly complete and robust, it is a bit wordy and repetitive at times. This project aims to reduce as much pain as possible when writing UI tests by enhancing the existing API. It also provides some basic structure for your tests in a manner familiar to most testers.

Tuesday, April 23, 2013

JavaScript Madness: Keyboard Events

Summarizes the results of some browser tests done while attempting to implement key stroke handling code in JavaScript. It documents inconsistencies in the way different browsers implement keyboard events.

Friday, April 19, 2013

Thursday, April 18, 2013

iOS WebKit modifications

Apple does code dumps on their open source releases site. For iOS, this contains WebCore and JavaScriptCore (because of LGPL), but not WebKit (BSD).

iOS 6.1 seems to track the open source WebKit repository up to r116247. You can diff Apple's code against the open source repo at that revision to see what is different in iOS.


Plugin that makes it easier to run Xcode without the main toolbar. It adds keyboard shortcuts for selecting the active scheme and device (Ctrl+7 / Ctrl + 8), and a compact popup menu in the window title bar that shows the currently selected run configuration.

Wednesday, April 17, 2013


FastClick is a simple, easy-to-use library for eliminating the 300ms delay between a physical tap and the firing of a click event on mobile browsers. The aim is to make your application feel less laggy and more responsive while avoiding any interference with your current logic.

See also Google's fast buttons article. Though it may not be necessary anymore, at least on Android (stock browser doesn't do a delay for fixed viewport sites since Gingerbread, and neither does Chrome).

Friday, April 12, 2013

Deep JS object comparisons

Micro-benchmark comparing doing manual object property traversal and using JSON.stringify and string comparison of the result. One might think that the JSON approach would be spending more time in native code, thus would be faster, despite the string allocation overhead. But the manual property traversal is always faster (JIT FTW).

Friday, February 8, 2013

Array loop iteration style

So long, for (var i = 0, p; p = a[i]; i++) {...}. Also related are these tests of Array.prototype.splice() performance.

Monday, January 28, 2013

Screenshot Uploader App

Minimal iOS app that uploads screenshots to a designated folder in Dropbox. Once configured, it should just be a matter of briefly launching it once the screenshot is taken (background HTTP completion service can be used to finish the upload).

Sunday, January 20, 2013

Automating iOS Screenshots

Post describing the use of a self-driving screenshot mode for apps (uses WaxSim for a CLI interface to the simulator). See also the original author's take.

UI Screen Shooter is a variant that uses UI Automation.

On the desktop, the screencapture tool may be useful.

Friday, January 4, 2013

View chunk-level diffs of PNG files

  1. Download zlib and build it with ./configure and make.
  2. Download pngcheck.
  3. Make sure that the zlib directory is called zlib and is a sibling of of the pngcheck directory.
  4. Build pngcheck with make -f Makefile.unx.
  5. Put pngcheck somewhere in your path.
  6. Create a pngdiff shell script somewhere in your path:
    LOCAL_FILE=`mktemp /tmp/pngdiff.local.XXXXXX` || exit 1
    pngcheck -v $1 > $LOCAL_FILE
    REMOTE_FILE=`mktemp /tmp/pngdiff.remote.XXXXXX` || exit 1
    pngcheck -v $2 > $REMOTE_FILE
    bbdiff --wait --resume $LOCAL_FILE $REMOTE_FILE
    (replacing bbdiff with your preferred text diffing tool)
  7. Add the following lines to ~/.gitconfig:
    [difftool "pngdiff"]
      cmd = pngdiff "$REMOTE" "$LOCAL"
  8. Run git difftool -t pngdiff to view diffs.

Relatedly, to view diffs of images in (using the up/down arrows to toggle between the old and new versions), add this to ~/.gitconfig:

[difftool "imagediff"]
  cmd = open -n -W -a preview "$REMOTE" "$LOCAL"