It used to work; unfortunately, Apple removed ipfw from recent versions of OS X.
The new method uses dummynet and pf but isn't reliable and I've never got it to work consistently, despite trying for hours and hours.
The only method that works reliably on recent versions of OS X is the free Network Link Conditioner. It is absolutely bulletproof.
Edited to add: Network Link Conditioner seems to use pf and dummynet under the hood; you can see the rules appear. But there's an interaction with the nlcd daemon that I don't understand yet. I want to do protocol-specific bandwidth throttling and I've not got that to work with nlcd interfering. But if you can live with throttling all traffic on the box, NLC works a treat.