Dozens of “profiling:invalid arc tag” when running code coverage in Xcode 5

后端 未结 7 2248
隐瞒了意图╮
隐瞒了意图╮ 2020-12-13 05:54

When running my Test target with code coverage enabled in Xcode 5, I get dozens of the following message in the build output:

profiling:invalid arc tag (0x..         


        
7条回答
  •  青春惊慌失措
    2020-12-13 06:42

    Old question, but now Xcode 7 GM is out, and this behavior hasn't changed, I took a deeper look. The issue, I believe is that code coverage of the test app target is conflicting with code coverage of the main target.

    Assuming you don't actually care about code coverage of your test target these settings stop the errors for me, with no need for extra scripts or deleting files:

    In your main target (be it a framework, or an app) set:

     Enable Code Coverage Support to YES
     Generage Legacy Test Coverage Files to YES
     Instrument Program Flow to YES
    

    For my purposes I only did this for Debug builds, but your needs may vary.

    Then in your Tests target set:

     Enable Code Coverage Support to NO
     Generage Legacy Test Coverage Files to NO
     Instrument Program Flow to NO
    

    This has resolved the error messages, and still allowed the code coverage files to be created appropriately.

    Again, the question is old, but as the error still is issued in XCode 7, I found this solution works better than deleting files with special scripts.

提交回复
热议问题