Xcode always creates targets /schemes for referenced Swift packages. In my app there are 14 Swift packages that are referenced. My app itself has two targets (app and an auto launcher) and Xcode creates targets for two schemes. I don't understand why those schemes are created (and why not for every package). Is there any way to disable this feature? Can someone explain why Xcode creates schemes for referenced Swift packages? I deleted the schemes several times, but Xcode simply recreates them.
This is indeed undesirable behavior. I'm not sure whether Apple is aware but you should file a feedback for it.
In the meantime, there's a workaround you can propose to your third party libraries' maintainers to adopt, and it consists on using an xcworkspace as the scheme container as opposed to .swiftpm. Example: https://github.com/sideeffect-io/AsyncExtensions/pull/29.
As I said, unfortunately this is up to the maintainers to adopt, not you, as Xcode reads the checked in .swiftpm folder from your dependencies and grabs the schemes from there without you having a say in it. Again, probably undersirable behavior and an oversight from the Xcode team, so worth filing a radar.