Don't Forget "Autocreate Schemes Now"
This is just a short post documenting something I've run into a couple times in jumping around to multiple Xcode 14.3 projects with Swift Packages as shared frameworks.
When adding a new library/target to a Package.swift
shared library, the library's scheme jumps right into the Xcode project.

If you then add a sibling test target for the same library to the Package.swift
, maybe before you have the directory for it, or piecemeal sometime later:

... it can create a standalone scheme, instead of automagically combining them together:

What if you wanted to build/test and keep just the main library scheme selected? Basically merge the sample-lib
and sample-libTests
schemes?
Instead of wading in too deep to the Scheme Manager manually and figuring out how to edit them into one scheme (which I'm sure someone is an expert at), simply:
- Choose
Product -> Scheme -> Manage Schemes
- Delete both schemes (
sample-lib
andsample-libTests
) - In the same dialog, choose "Autocreate Schemes Now"

Even though Autocreate Schemes is already checked, you just need to nudge it. Exactly what I wanted, quick.