In Xcode 4.5 with LLVM, to enable code coverage on a project:
- Set "Instrument Program Flow" and "Generate Test Coverage Files" to Yes in the Build Settings.
- You'll want to have the program properly exit in order to generate the files. A simple way is:
- (void)applicationDidEnterBackground:(UIApplication *)application {
exit(0);
}
It's best to create this in a new build configuration. Run your app in the simulator and hit the Home button to have the right files generated.
Afterwards, the files will be in something like "build/$target/$project.build/Debug-iphonesimulator/$target.build/Objects-normal/i386/".
You can open this directory in Cover Story, but if your project has a lot of files you may need to apply the patch in issue 39.