To audit memory or to debug with external tools it can be useful to get a dump of the running memory of an app.
If instead you’re up to a simulated app, things are easier: apps running in the simulator are actually just native processes on your Mac OS X.
It is actually an interesting read, but if you are in a hurry, skip to downloading the code and compile it like this (screw the Makefile, it compiles also for PowerPC)
gcc -O2 -arch i386 -Wall -o gcore gcore.c gcc -O2 -arch x86_64 -Wall -o gcore64 gcore.c
Then simply run your app, find the process id
ps -hax and run
sudo gcore 1234
And enjoy your core dump. (Bonus: you can load it up in
If you happen to want the dump happen at a particular moment, place a regular breakpoint in XCode, then dump the memory when the process is paused.