How do I activate emulation in the Coddeblocks Arduino IDE
I have not done extensive testing with the simulator but here is what you do open code blocks start a new project. Then under the target choose simulator. See the picture for details. 

I just tested it out for the simple program but this looks pretty cool.