Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simulators don’t appear on the list #285

Closed
ychie opened this issue Jan 25, 2025 · 5 comments
Closed

Simulators don’t appear on the list #285

ychie opened this issue Jan 25, 2025 · 5 comments
Labels
needs response waiting for the author to reply

Comments

@ychie
Copy link
Contributor

ychie commented Jan 25, 2025

Starting in Xcode 14, when you create a multiplatform app project, Xcode creates a single app target with destinations for each platform you want to support: iPhone, iPad, Apple TV and Mac.

Image

In the .nvim/settings.json i see that xcodebuild recognizes target's platform as macOS only, and so in the 'select device' popup i only see the macOS variant. Can this be adjusted to display iOS device variants also?

Image

@FelixLisczyk
Copy link

FelixLisczyk commented Jan 27, 2025

The issue you're experiencing is due to a known bug with the xcodebuild -showdestinations command. This command won't display simulator destinations unless your Xcode project has at least one Swift Package dependency. The xcodebuild.nvim plugin relies on this command to list available devices for your project. To resolve this issue, please try the following steps:

  1. Open your project in Xcode and add a Swift Package dependency.
  2. Delete the project's derived data folder.
  3. Delete the .nvim/xcodebuild subfolder in your project.
  4. Open the project in Neovim and run the XcodebuildSetup command again.

@wojciech-kulik wojciech-kulik added the needs response waiting for the author to reply label Jan 28, 2025
@ychie
Copy link
Contributor Author

ychie commented Jan 28, 2025

@FelixLisczyk Thanks a lot for support! Added one package and got my iOS targets.

@ychie ychie closed this as completed Jan 28, 2025
@wojciech-kulik wojciech-kulik pinned this issue Jan 28, 2025
@wojciech-kulik wojciech-kulik changed the title Xcode multiplatform app targets support Simulators don’t appear on the list Jan 28, 2025
@wojciech-kulik
Copy link
Owner

I pinned this issue for others, because it seems to be a common problem.

@mokkun
Copy link

mokkun commented Feb 18, 2025

I had a slightly different issue. My project has Swift Package dependencies, but I'd still get an empty device list.
So I went ahead and typed xcodebuild -showdestinations into a terminal, and got the following error:

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

Turns out this issue happens when CommandLineTools are installed after Xcode. 🤷
I easily fixed it by running sudo xcode-select -s /Applications/Xcode.app/Contents/Developer and was able to see the device list on nvim.

@nikagar4
Copy link

I had a slightly different issue. My project has Swift Package dependencies, but I'd still get an empty device list. So I went ahead and typed xcodebuild -showdestinations into a terminal, and got the following error:

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

Turns out this issue happens when CommandLineTools are installed after Xcode. 🤷 I easily fixed it by running sudo xcode-select -s /Applications/Xcode.app/Contents/Developer and was able to see the device list on nvim.

That is not a bug with xcodebuild.nvim but maybe we can add this step in readme for beginners? @wojciech-kulik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs response waiting for the author to reply
Projects
None yet
Development

No branches or pull requests

5 participants