2

I am developing a ionic application but when I am trying to build it it is giving me below error

xcodebuild: error: The project named "SnapHome" does not contain a scheme named "SnapHome". The "-list" option can be used to find the names of the schemes in the project.

Below is the available schemes

Information about workspace "SnapHome":
    Schemes:
        SnapHome

I am using below script and enterprise provisioning profile to build the application, I have used same script to build other cordova applications

cordova build
projectname='xxxxx'
provisionprofilename="xxxxxxx"
outoutdirectory="xxxxxxx"
xcodeprojectdirectory="yyyyyy/snapapp/platforms/ios"

rm -f "$outoutdirectory"/"$projectname".xcarchive
rm -f "$outoutdirectory"/"$projectname".ipa

xcodebuild clean -project "$xcodeprojectdirectory"/"$projectname".xcodeproj -configuration Release -alltargets

xcodebuild -workspace "$xcodeprojectdirectory"/"$projectname".xcworkspace -list

xcodebuild archive -project "$xcodeprojectdirectory"/"$projectname".xcodeproj -scheme "$projectname" -archivePath "$outoutdirectory"/"$projectname".xcarchive

xcodebuild -exportArchive -archivePath "$outoutdirectory"/"$projectname".xcarchive -exportOptionsPlist exportPlist.plist -exportPath "$outoutdirectory"/"$projectname".ipa

Could you please let me know what is the issue and how to fix this. I am using xcode 8.3.2

Debopam
  • 3,198
  • 6
  • 41
  • 72

2 Answers2

8

I was having the same problem on my build, and just checking the Shared option on the Product > Scheme > Edit Scheme was not actually adding the scheme to Source control.

What happens is that when you share the scheme xcode will copy the scheme from the local user xcuserdata to a new folder xcshareddata/scschemes under the .xcodeproj but when you commit and push the change this new folder is not included by default and you need to force the commit.
Once I forced the commit of the new xcsharedata/xcshemes folder, the build server could now find the scheme successfully.

Hope this helps.

Claiton Lovato
  • 2,382
  • 1
  • 22
  • 23
  • First I shared the scheme om the Edit Scheme screen, after that I added the xcshareddata/schemes to my commit and pushed to the server. This make the scheme available on the build server. – Claiton Lovato May 25 '17 at 16:04
0

This can be done by sharing the scheme. it is available from Product > Scheme > Edit Scheme > Shared [check box] in the bottom pannel

Location of Shared check box

Debopam
  • 3,198
  • 6
  • 41
  • 72