动态装载机
有人会说你可以设置环境变量,例如DYLD_PRINT_APIS=0
, DYLD_PRINT_APIS=false
, DYLD_PRINT_APIS=no
,...但这样不行。检查源代码:
else if ( strcmp(key, "DYLD_PRINT_APIS") == 0 ) {
gLogAPIs = true;
}
换句话说gLogAPIs
is true
当变量存在时。您可以将其设置为任何值,将其保留为空,如果变量存在,它将始终启用。
Xcode方案
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.
将有:
-
LaunchAction
element attribute like enableAddressSanitizer = "YES"
2) or
-
DYLD_...
环境变量设置。
只要删除这个属性/环境变量就可以了。
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
上述说明帮助 OP 找到准确的 XML 元素名称。必须删除:
-
LaunchAction/AdditionalOptions/AdditionalOption
元素
- 哪里的
key
或者是DYLD_PRINT_LIBRARIES
and/or DYLD_PRINT_APIS