Xcode 11 執行 Reveal 報錯 RevealServerCommands.py
升級到 Xcode11之後 Reveal 不能正常使用,啟動時工程報錯
File "/Applications/Reveal.app/Contents/SharedSupport/Scripts/RevealServerCommands.py", line 18, in __lldb_init_module
HandleRevealCommand.__doc__ = CreateRevealCommandOptionsParser().format_help()
File "/Applications/Reveal.app/Contents/SharedSupport/Scripts/RevealServerCommands.py", line 36, in CreateRevealCommandOptionsParser
for key, info in subcommands.iteritems():
AttributeError: 'dict' object has no attribute 'iteritems'
error: 'reveal' is not a valid command.
複製程式碼
分析
- 提示問題很明顯 python 程式碼報錯
- Xcode 11 升級了 Python 由 2.7 -> 3
- 檢視 RevealServerCommands.py 定位到底 36 行 程式碼
for key, info in subcommands.iteritems():
iteritems
方法 Python3 廢棄了,改為items()
- ? 大功告成,又可以用了。
其他
RevealServerCommands.py 位置
/Applications/Reveal.app/Contents/SharedSupport/Scripts/RevealServerCommands.py