Suppress xcodebuild output or make less verbose [duplicate] - ios

This question already has answers here:
How to filter the xcodebuild command line output?
(11 answers)
Closed 7 years ago.
I am building my app in teamcity with xcodebuild command line tools. I am looking for a way to suppress or make the output less verbose but still show errors or failures if they happen. The build log becomes very large and the browser has a hard time loading it.
Are there optional parameters I can pass in or a way to stream it to a log file?

It's not possible. However You can make the log more readable with xctool or xcpretty - not sure the size is also changed. Probably, it is.

If you use xcpretty https://github.com/supermarin/xcpretty you will have something readable and less verbose, the size will be smaller. It's a great tool, especially if you have unit test. You can take a look to the github they show exemples.

Related

Produce all possible errors with Clang/Ninja / Keep going with Ninja / Ninja equivalent of make -k

I am compiling a fairly large library with many outside dependencies that I need to pull in. Each time I attempt a compilation I get a new error about a missing header file. I then have to go and track down where to find that header/library and add it to the project includes. This process of compilation-then-find-header/source is repeated and takes a lot of time.
I would like the compiler to continue trying to build and output all missing headers in one error list. Is this possible using Clang and if so how can I control it? On a related note, once I have all headers is it possible to tell Clang to report all linker errors/undefined references, so I don't have to repeat this process with source files?
I am looking for compiler flags to print out all possible errors (missing headers) and all undefined references. In other words, I want the compilation to continue passed the first file with errors and attempt to compile all files in the project. The compiler is Clang (C/C++) version 8.0.2. The make tool is ninja (1.5.3). Make files are generated with CMake (3.6.4).
Update:
Looking back, my original question was asking for a solution in the wrong tool. Instead of passing a flag to Clang, I needed to pass a flag to my make tool, Ninja.
From ninja --help:
-k N keep going until N jobs fail [default=1]
so i'd run ninja command like:
ninja -k 100
to continue until 100 errors are found or the build succeeds. One thing to note is that some errors may just stop the entire build if the erroneous file is necessary to continue the build process.

Faild to build clang with ninja [duplicate]

This question already has an answer here:
Building clang taking forever
(1 answer)
Closed 4 years ago.
There was a problem when I've tried to build clang with ninja.I've executed all commands one after another from the link:
http://clang.llvm.org/docs/LibASTMatchersTutorial.html
but after running ninja where the tutorial says "Okay.Now we’ll build Clang!" it takes 2 hours to build half of the objects and after that OS stuck and I couldn't even move the cursor.I did the job on both my laptop and PC but the result was the same.What is attract my attention is that, the size of the folder is so huge (18.3GB).
Is there any way to solve the problem?
I have already answered the same question on StackOverflow here. I will suggest a deeper search in future before asking the same question.
Including information here in case link is lost. What is happening is that building clang in debug mode (that's by default) a lot of debug information is also being generated for each compilation unit the file sizes are becoming big.
The solution is to turn off all the debug info that's been attached by default. You probably are not going to debug clang, so won't need it. So instead of just doing this
cmake -G Ninja ../llvm -DLLVM_BUILD_TESTS=ON
What you should do is
cmake -G Ninja ../llvm -DLLVM_BUILD_TESTS=ON -DCMAKE_BUILD_TYPE=Release
All the other steps remain the same.

Xcode 8 Console Garbage? [duplicate]

This question already has answers here:
Hide strange unwanted Xcode logs
(14 answers)
Closed 6 years ago.
Has anybody else had issues with the Xcode 8 console showing a bunch of random stuff? I don't want to have all of this cluttering my debug messages and logs. Does anybody know how to turn this off?
EDIT: The release notes specify that the console might dump unhelpful stuff for watchOS, but not for iOS.
Example:
You can disable that output with a environment variable.
In Product>>Scheme>>Edit Scheme...>>Run add the following environment variable: Name:OS_ACTIVITY_MODE, Value: disable
Originally described on Twitter here.
It seems this information is not garbage and can help with the variables view when checking system framework calls. However, this seems more related to debugging for the engineers at Apple and seems to have been logged as an xcode 8 issue. No idea when this will be resolved.
I also checked (started) the key binding with a "show" and "display" filters but none are relative to this. Below is apple's note:
• Xcode Debug Console shows extra logging from system frameworks when debugging applications in the Simulator. (27331147, 26652255).

Xcode bug, or compile error? "Unable to convert data to string around character"

I was assigned to convert a rather large app to Swift 2. It uses various external frameworks and is mostly based around reading and displaying JSON. I got stuck today with a rather cryptic compiler error (using Xcode 7.2):
Xctool wasn't too helpful either:
Then I ran pure Xcodebuild and it shed at least some light, but not that much really:
Note the Xcodebuild output indicates an error which seems to be related to NSJSONSerialization. Would you rather say this is an issue with the code, or as Xcodebuild output suggests, this may be a bug with Xcode itself? Any help would be much appreciated.
I had a similar issue. Used Build Phases to narrow problem to a specific source file. The problem resolved when I made sure that the source file was UTF8-encoded.

Xcode 4 : iOS binary size and strip

I was trying to minimize the code size in my iOS 4 game, so I tried enabling all the strip-related commands, and using the -Os flag.
However, strangely I still found that the binary was quite big, and when I manually tried to strip the binary using the console ("using the strip command"), it actually reduced it from 18 mb to 12.3 mb.
Does Xcode actually use a different strip mechanism, or anything like that? The problem with using the console strip command is that it gives a message saying that it invalidates the code sign, so I wonder if it's possible to get the code signing working after this strip command.
Did you choose "Yes" in both "Deployment Postprocessing" and "Strip Linked Product"?
Also, check that you have the right values for the build configuration you try to optimize.

Resources