bitrise-io / codesigndoc

Your friendly iOS Code Signing Doctor
MIT License
318 stars 43 forks source link

Failed to select scheme if ordered differently in XCode #158

Open kerrgrant opened 2 years ago

kerrgrant commented 2 years ago

Example session

Grants-MacBook-Pro:GKSwiftStringExtensionUsage grant$ codesigndoc scan xcode
Scan the directory for project files
You can specify the Xcode project/workspace file to scan with the --file flag.
Found one project file: GKSwiftStringExtensionUsage.xcworkspace.

🔦  Scanning Schemes ...
$ xcodebuild "-workspace" "/Users/grant/AIR APPS/GKSwiftStringExtensionUsage/GKSwiftStringExtensionUsage.xcworkspace" "-list"

Select the Scheme you usually use in Xcode
Please select from the list:
[1] : GKSwiftStringExtensionUsage
[2] : GKSwiftStringPod
[3] : Pods-GKSwiftStringExtensionUsage
(type in the option's number, then hit Enter) [1] : 1
could not get scheme (GKSwiftStringExtensionUsage) from path (/Users/grant/AIR APPS/GKSwiftStringExtensionUsage/GKSwiftStringExtensionUsage.xcworkspace): scheme GKSwiftStringExtensionUsage not found in GKSwiftStringExtensionUsage

I was able to get around this issue by rearranging the order of the schemes listed within XCode, i.e.

Going from...

Screenshot 2022-02-28 at 19 18 17

to...

Screenshot 2022-02-28 at 19 18 00

Perhaps the number entered on the CLI assumes the same ordering, i.e. expected '1' to correspond exactly to scheme named: 'GKSwiftStringExtensionUsage'

Maybe not but thought it might be useful as it blocked me straight away.

stevebrowndotco commented 2 years ago

Wow thanks for this, lifesaver. Confirmed working for me as well when I change the order to the 1st position