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

后端 未结 7 2214
隐瞒了意图╮
隐瞒了意图╮ 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:47

    I'm having the same issue. In my appDelegate under applicationWillTerminate: I have the __gcov_flush();. Commenting this out removes the invalid arc tag messages in my build output.

    I'm doing further research to figure out why this happens. I know that if I completely clean my project and delete the DerivedData directory these messages will stop for a few runs of my tests.

    EDIT: I seemed to have fixed this for me. In my appDelegate I had the following:

    #ifdef DEBUG
    + (void)initialize {
        [[NSUserDefaults standardUserDefaults] setValue:@"XCTestLog,GcovTestObserver"
                                             forKey:@"XCTestObserverClass"];
        [super initialize];
    }
    #endif
    

    I spelled GcovTestObserver wrong, and after fixing this the messages stopped. Make sure you also have a subclass of XCTestObserver in your Test target overriding stopObserving with the following:

    - (void) stopObserving
    {
        [super stopObserving];
        UIApplication* application = [UIApplication sharedApplication];
        [application.delegate applicationWillTerminate:application];
    }
    
    0 讨论(0)
提交回复
热议问题