Code Coverage on Xcode 4.4.1

后端 未结 3 1565
北荒
北荒 2021-01-14 11:12

I\'ve been trying code coverage testing for Mac application on Xcode4.4.1, and the app is an 10.8 app so the app builds and runs only via Xcode4.4.1. But the /Developer/usr/

3条回答
  •  栀梦
    栀梦 (楼主)
    2021-01-14 12:02

    You don't need to include *libprofile_rt.dylib* and use *-profile_rt* flag when running project in xCode 4.4.1 (works with iOS Simulator like a charm) Just set these flags:

    Generate Test Coverage Files: YES
    Instrument Program Flow: YES
    

    Build and run. In case you runt Test-target of your app, *.gcda files are created automatically because tested app terminates, in case of running regular target, *.gcda files are created when you explicitly kill your app (the other approach is to set UIApplicationExitsOnSuspend = YES in .plist)

    Please note, it was well tested on new project created with xCode 4.4.1

提交回复
热议问题