Enabling Xdebug in MAMP is really easy if you know where to look. Many thanks to Danne Lundqvist for sharing this delicious bit of information on his blog.
The Xdebug configuration directives are located in your php.ini file, which can be found at:
/Applications/MAMP/bin/php/php5.4.10/conf/php.ini
You'll most likely need to replace "php5.4.10" in the above path with the php version you are running. To find out what version of php you are running just type in your terminal:
Open the php.ini file and at the bottom you'll see the Xdebug configurations. Simply remove the semi-colon at the beginning of the following line:
;zend_extension="/Applications/MAMP/bin/php/php5.4.10/lib/php/extensions/no-debug-non-zts-20100525/xdebug.so"
Save the file and restart MAMP.
If you have phpunit installed, you can now run code coverage with the --coverage-html=coverage; argument.