Skip to content

Troubleshooting

Wojciech Kulik edited this page Oct 20, 2024 · 3 revisions

Important

The first thing you should do is to check the output of :checkhealth xcodebuild and fix all issues.

Run it from your project root directory.

 

Steps to fix basic issues

  1. Go to your project root.
  2. Remove buildServer.json
  3. Open your project in Xcode.
  4. Run clean build (CMD+Shift+K, CMD+B)
  5. Make sure that xcode-build-server is installed via Homebrew (which xcode-build-server).
  6. Run in terminal:
    xcode-build-server config -project <Project>.xcodeproj -scheme "<your scheme>"
    or
    xcode-build-server config -workspace <Project>.xcworkspace -scheme "<your scheme>"
  7. Make sure that buildServer.json contains correct information.
  8. Open project in Neovim.
  9. Run :LspInfo.
  10. Confirm that the LSP is attached and the root directory is correctly detected.

 

Configuration

Processing the project configuration is a very complex task that relies on parsing multiple crazy outputs from xcodebuild commands. Those logs are a pure nightmare to work with. This process may not always work.

In case of any issues with, you can try manually providing the configuration file .nvim/xcodebuild/settings.json in your root directory.

 

Sample settings.json file:

{
  "bundleId": "com.company.bundle-id",
  "show_coverage": false,
  "deviceName": "iPhone 15",
  "destination": "28B52DAA-BC2F-410B-A5BE-F485A3AFB0BC",
  "config": "Debug",
  "testPlan": "YourTestPlanName",
  "projectFile": "/path/to/project/App.xcodeproj",
  "scheme": "App",
  "platform": "iOS Simulator",
  "productName": "App",
  "projectCommand": "-workspace '/path/to/project/App.xcworkspace'",
  "xcodeproj": "/path/to/project/App.xcodeproj",
  "lastBuildTime": 10,
  "os": "17.2",
  "appPath": "/Users/YOU/Library/Developer/Xcode/DerivedData/App-abafsafasdfasdf/Build/Products/Debug/App.app"
}
  • platform - check out lua/xcodebuild/core/constants.lua for available platforms
  • destination - simulator ID
  • projectile / projectCommand - can be xcodeproj or xcworkspace, the main project file that you use

 

Tests

If you encounter issues with test detection, you may want to read this: Test File Search - File Matching.

Clone this wiki locally