appium/appium-for-mac — pull request #13 by fangmobile (2014-08-22 14:46:26+00:00)
Title: take screen shot of the app window only, instead of the whole screen.

basically this change does a few things:
1. get a list of on-sreen, non-desktopElement windows
2. get the pid of the app
3. get the first window from the list that matches the pid.
(Even you open multiple test app, the lastest one launched by appium
will be used for screenshot)
4. get the windowID of that window
5. take screenshot
used current ultility methods and Quartz Window Service methods.

NOTE: this takes a clean screenshot of the app window only but you also lose the menu from the screenshot because it is in another window.