user1819441
user1819441

Reputation: 127

code coverage with xcode 4.5 - no gcda generated

I have a simple project that run on Xcode 4.5 with Apple LLVM 4.1 compiler.

I have set below flags in build settings:

  1. Generate Profiling code: Yes
  2. Instrument program flow: Yes Generate
  3. Test Coverage files: Yes

I am running the app on iPad 6.0 Simulator and once the app launches I am clicking few buttons and playing around with it.

I am not running unit tests on this, but am manually clicking buttons. Under derived data..., all I am seeing is .gcov files. But No .gcda files are being generated.

Really appreciate any pointers you might have!

Thanks!

Upvotes: 2

Views: 3550

Answers (1)

Diksha
Diksha

Reputation: 128

I have tried the same settings as yours. I was able to generate code coverage files by just running the app on iPad 5.1 simulator. It didn't work for me for iPad 6.0 simulator.

Steps taken by me:

In the main target of the Xcode Project, set the following flags in build settings:

Generate Test Coverage Files : Yes Instrument Program Flow: Yes

Set these flags only for Debug.

In the info.plist of your application, set 'Application does not run in background' : YES

.gcda files get generated only when the application closes properly. Setting the above flag will close your application when you press HOME button. It will not run in background. Somehow, this flag did not work for me for iPad 6.0 simulator.

Upvotes: 8

Related Questions