新Swift UI 项目杂记

.gitignore

# Xcode
.DS_Store

## User settings
xcuserdata/

## Build products
build/
DerivedData/
*.hmap
*.ipa
*.dSYM.zip
*.dSYM

## Xcode generated
*.xccheckout
*.xcscmblueprint
buildServer.json

# Swift Package Manager
.build/
.swiftpm/

# CocoaPods
Pods/

# Carthage
Carthage/Build/

# fastlane
fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots/**/*.png
fastlane/test_output/

# Playgrounds
timeline.xctimeline
playground.xcworkspace

# macOS
.DS_Store

使用 Neovim 作为编辑器时候的 sourcekit 语法解析

1. 进入项目根目录

MyApp/
├── MyApp.xcodeproj
├── MyApp/
└── ...

2. 安装 xcode-build-sever

brew install xcode-build-server

3. 确认 scheme 名称

xcodebuild -list

如果发生报错

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

说明当前 xcode-select 指向的是单独的 Command Line Tools,使用sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer 切换到完整的 xcode

4. 生成 buildServer.json

xcode-build-server config \
  -project PROJECTNAME.xcodeproj \
  -scheme PROJECTNAME
MyApp/
├── buildServer.json    ← 关键
├── MyApp.xcodeproj
└── MyApp/