在 xcode 6 调试控制台中打印长字符串
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/31402092/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
print long string in xcode 6 debugging console
提问by Adarkas2302
I am getting only 1022 characters of my String to display in the debugging console of Xcode6. The actual length is around 2500 characters.
我的字符串中只有 1022 个字符才能显示在 Xcode6 的调试控制台中。实际长度约为 2500 个字符。
Is there a way to display all character in the console or do i have to write them in a file.
有没有办法在控制台中显示所有字符,或者我是否必须将它们写入文件中。
i have tried print
in the console but that displays only 1023 characters.
我曾print
在控制台中尝试过,但只显示 1023 个字符。
First i tried with println(sqlstatement)
, that did not work. Second, as mentioned above, i used print sqlstatement
in the debug console itself. Oh and debugger is lldb.
首先我尝试过println(sqlstatement)
,那没有用。其次,如上所述,我print sqlstatement
在调试控制台本身中使用。哦,调试器是lldb。
Regards Adarkas
问候阿达卡斯
回答by Adarkas2302
I found an answer thanks to your comment @nms. The command line for lldb is
感谢您的评论@nms,我找到了答案。lldb 的命令行是
setting set target.max-string-summary-length 10000
with 10000 being the number of characters that are printed.
10000 是打印的字符数。
I haven`t found a nicer way to set this setting for lldb, other than typing it every time i debug, than to set a breakpoint in AppDelegate to auto continue and adding the above command to it.
我还没有找到更好的方法来为 lldb 设置此设置,除了在每次调试时输入它,而不是在 AppDelegate 中设置断点以自动继续并向其添加上述命令。