How to Restart Audio on a Mac

Run this from Terminal and your audio session will restart, can be used to fix when you Mac stops playing audio from any apps (which often seems to happen with bluetooth audio devices).

sudo kill -9 `ps ax|grep 'coreaudio[a-z]' |awk '{print $1}'`

Unfortunately if that doesn’t do the trick, you’ll have to do a restart.

Creating iOS PhoneGap / Cordova 2.0 & Mountain Lion

PhoneGap 2.0 and Mountain Lion don’t get along too well when it comes to creating new iOS projects. If you’re getting the following (or similar errors):

usage: cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file target_file
 cp [-R [-H | -L | -P]] [-fi | -n] [-apvX] source_file ... target_directory

Replace your current cordova bin file by downloading the latest bin as per the second step in the getting started guide.

If you’re interested in the problem:

The script has multiple points of failure if there are spaces anywhere in either the path to the extracted bin dir, or the path to the target. It seems that there is insufficient argument escaping when passing the derived variables, like $R, on to other scripts and program

– https://issues.apache.org/jira/browse/CB-1124

I’m unsure why the official download doesn’t contain this fix.

Mountain Lion Dock Stops Showing Active Apps

In OS X Mountain Lion (10.8) there’s a bug where the dock, exposé and cmd+tab app switching can stop showing newly opened apps. To fix this restart the dock by entering the following into Terminal:

killall -KILL Dock

I’ve had this a few times and expect it to be updated in 10.8.1.