这个插件https://github.com/touchlab/xcode-kotlin不允许通过Xcode调试kotlin代码,文件没有颜色,也没有可能在kotlin文件中添加断点(虽然它是为。swift文件),该怎么办?
- 确保您遵循
readme
: 中提到的所有步骤。
- 从GitHub下载项目并运行
./setup.sh
插件(或./setup-xcode11.sh
为新版本https://github.com/touchlab/xcode-kotlin/pull/30/files) 打开Xcode,点击"Show project navigator",创建一个新组(我的在 - 将
commonMain
和iosMain
文件夹添加到新建的组中
executive-app
下)- 如果上述步骤仍然没有帮助,请尝试重新启动Xcode,重新启动计算机或删除
DerivedData
我如何在Xcode 8中删除派生数据? - 重要!如果你有几个Xcode版本或者如果你最近更新了你的Xcode,可能插件不知道你的Xcode UUID。
让插件知道:
-
手动获取UUID:
defaults read /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID
(如果你有几个版本,它可能会像defaults read /Applications/<howMyXCodeIsNamed>.app/Contents/Info DVTPlugInCompatibilityUUID
) -
将UUID写入插件信息文件default
write ~/Library/Developer/Xcode/Plug-ins/Kotlin.ideplugin/Contents/Info DVTPlugInCompatibilityUUIDs -array-add <UUID from previous step>
或者使用https://github.com/touchlab/xcode-kotlin/pull/29/files来纠正初始脚本,但在此之前请确保您现在使用的Xcode版本是默认的(它可以由sudo xcode-select --switch Applications/path/to/your/xcode
设置)