Xcodebuild gives "profiling: invalid magic number", does not generate coverage files

Let me make this out first: This question is not a duplicate of this earlier question . I will explain why below.

I run the command xcodebuild test -scheme 'ISO8601ForCocoa' SYMROOT=../build , and here's the output:

 Executed 16 tests, with 0 failures (0 unexpected) in 0.047 (0.051) seconds profiling: invalid magic number (0x656d6954) profiling: invalid magic number (0x00000000) ** TEST SUCCEEDED ** 

The person who asked this question before received the same error message, but fixed it by clearing the build folder.

In my case, cleaning will not help, because I do not have the assembly folder yet. I still get this error message even on a completely new build. In fact, the .gcda and .gcno files are not even created, so there is nothing to clean.

+4
source share
1 answer

xcodebuild places assemblies in $SYMROOT , but stores the profile products in $OBJROOT .

If you want to completely restrict the assembly, including all intermediate and final products, into one directory, you need to set three assembly parameters:

  • SYMROOT : product creation path (end products such as applications and test suites)
  • OBJROOT : path to intermediate assembly files (intermediate products, such as object files on each module, created by the compiler, read by linker- and .gcno / .gcda files)
  • SHARED_PRECOMPS_DIR : SHARED_PRECOMPS_DIR header cache path (guess)
+1
source

Source: https://habr.com/ru/post/1501580/


All Articles