How to Develop iOS Apps with Cusor and Preview in Real Time

✍🏼 Written on Feb 11, 2025    💡 Updated on Feb 11, 2025
❗️ Note: it has been days since this article was written, please be aware of its timeliness
🖥  Note:This article provides a detailed, illustrated guide on how to use Cursor to develop iOS applications and achieve real-time preview effects.

This article is an expanded version by the original author. The original post can be found at:

在 Cursor 打造高效 iOS 开发环境: AI 编程 + 实时预览完整指南 This article will guide you on how to properly configure Cursor/VSCode for iOS development. Once set up, you will be able to: Develop iOS apps in Cursor/VSCode, freeing yourself from the bloated and sluggish Xcode, and enjoy a better mood and temper. Leverage cutting-edge AI programming features,... https://blog.imjp.uk/fxxk-xcode

I’m adding supplementary notes here because when I followed this tutorial, I encountered some pitfalls due to my lack of familiarity with Xcode and iOS development. Hence, I’m documenting these points for reference.

This article serves as a supplement to the original post. Please refer to the original first.

Supplement to “Installing the Swift Plugin and CodeLLDB Plugin”:

The Swift plugin mentioned here is outdated. You should use the latest plugin instead. Search for Swift Programming Language in the plugin marketplace.

Supplement to Step 2 of “Setting Up Hot Reloading”:

Open the corresponding Target settings in your project -> Build Settings -> Search for **Other Linker Flags**, then add **-Xlinker** and **-interposable** separately.

Note that both must be added simultaneously, i.e., copy -Xlinker -interposable and paste it as shown in the image below:

Source Kit File Not Found Error After Adding New Files:

You’ll need to rerun the command mentioned in the original post using Xcode-Build-Server:

1
2
3
4
5
6
// 然后在项目根目录下根据你的项目文件类型执行对应的命令:
xcode-build-server config -workspace *.xcworkspace -scheme <XXX>
xcode-build-server config -project *.xcodeproj -scheme <XXX>

//例如你用的是 exampleProject.xcodeproj:
xcode-build-server config -project exampleProject.xcodeproj -scheme exampleProject

Issue with SwiftUI Previews Not Updating in Real Time During Debugging:

Certain ViewModifier additions or modifications may indeed fail to update in real time, but changes like modifying a String in Text generally work fine. I’m not entirely sure why.

- EOF -
Originally published at: How to Develop iOS Apps with Cusor and Preview in Real Time - Xheldon Blog