I guess this is because I haven't passed a manifest file for the tool to build? If so, how can I actually pass something to it? I've tried to pass a path to a local directory that has a valid swift package but I got the same error.
You should set Working Directory in Schemes > Run > Options to the package youâd like to test with. Alternatively, set the arguments --package-path/path/to/your/package in Schemes > Run > Arguments.
In addition to @stevapple's solution, maybe running it from the command line could work?
If you built the target using Xcode, then the executable can be found under DerivedData/, and if you built it using SwiftPM directly (in command line), then it can be found under .build/.
Primarily, the dynamic libraries need to be upâtoâdate and locatable by swift-run without the real toolchain cutting in.
My workflow usually consists of this:
# Make sure all build products are present.
swift build
# âswift run swift-runâ often does not work because they eat one anotherâs flags in weird ways.
.build/x86_64-apple-macosx/debug/swift-run --package-path /some/package/to/experiment/with
If I find myself doing it over and over again, I usually create an alias.
I havenât tried it with Xcodeâs debugger, but I assume it should work if you convert the first line to a script build phase and the second line to the working directory, executable, and flags of a custom configuration.
Alternatively, you can add your target package alongside the other ones in the Fixtures directory and look in Tests/FunctionalTests/MiscellaneousTests.swift for examples of how to interact with it inside a unit test.
This happens to me relatively often when working on complex, unfamiliar projects, and personally I find that starting with tests is the simplest way to get started.
As a bonus - tests are typically written in such a way that they control all the inputs and start from a neutral state every time, so it's a really nice, repeatable environment to experiment in. And once you're ready to send a PR, the tests are already done