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:
    #!/bin/bash
    
    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 Preview.app (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"