I want to disable the printing of Logging Dynamic loader events (dyld) in the XCode console. I found a solution here. But I couldn't find Log Dyld API Usage and Log Library Loads options in product scheme diagnostics of XCode 11. Please help me find them.
PS: If there is a new process in Xcode11 for disabling logs, please let me know.
Answer: This step by step solution is suggested below in the answers. I am just attaching this picture for a better understanding.
One would say that you can set environment variables like DYLD_PRINT_APIS=0
, DYLD_PRINT_APIS=false
, DYLD_PRINT_APIS=no
, ... but it doesn't work in this way. Check the source code:
else if ( strcmp(key, "DYLD_PRINT_APIS") == 0 ) {
gLogAPIs = true;
}
In other words gLogAPIs
is true
when the variable exists. You can set it to whatever value, keep it empty, it will be always enabled if the variable exists.
UI for this setting is gone in the Xcode 11, but it can still be in the scheme file. Let's say that you have a simple project Foo
. The scheme is located at Foo/Foo.xcodeproj/xcshareddata/xcschemes/Foo.xcscheme
1). It's a XML file. Quit Xcode and open this file in any editor and search for the LaunchAction
element.
There will be:
LaunchAction
element attribute like enableAddressSanitizer = "YES"
2) orDYLD_...
environment variable set.Just remove this attribute/environment variable and you should be fine.
1) The exact path can vary, because it the scheme can be included in the workspace, project, ...
2) I don't have a previous version (10) of Xcode installed, can't check for the exact name, but it should be there and it will be obvious which one it is. This one, I used, is for the Address Sanitizer checkbox. If you find the exact name, let me know and I will update this answer or answer it yourself and I'll delete this one.
Update
Instructions above helped OP to find exact XML element names. One has to remove:
LaunchAction/AdditionalOptions/AdditionalOption
elementskey
is either DYLD_PRINT_LIBRARIES
and/or DYLD_PRINT_APIS