0

BuilSettings[REFERENCE IMAGE1][1]I'm creating an script to automate ios build to generate .ipa ... Below is my script,

# xcodebuild -workspace "project.xcworkspace" -scheme "Schemename" clean

# xcodebuild -workspace "project.xcworkspace" -scheme "Schemename" build

# xcodebuild archive -workspace "project.xcworkspace" -scheme "schemename" -archivePath "project.xcworkspace.xcarchive"

# xcodebuild -exportArchive -archivePath "project.xcworkspace.xcarchive" -exportPath "project.xcworkspace" -exportFormat ipa -exportProvisioningProfile "Digi Form Development": *"

while executing above script getting an error of,

--- xcodebuild: WARNING: -exportArchive without -exportOptionsPlist is deprecated error: no provisioning profile matches 'Digi Form Development: *' ** EXPORT FAILED **

Since I'm new to this ios build deployment using xcode cli kindly help me on to correct my problems,

SudhakaranR
  • 43
  • 10
  • It says that your provisioning profile is wrong. Please check whether `Digi Form Development` is the correct provisioning profile or not. – KrishnaCA Jan 13 '17 at 06:36
  • @KrishnaCA : Thanks the provisioning profile is exist on developer.apple.com under my account. Not sure with the exact problem kindly help. – SudhakaranR Jan 13 '17 at 06:41
  • Are you using the same bundle identifier on Xcode which you are using to create your provisioning Profile. Both are same? – Mandeep Singh Jan 13 '17 at 06:44
  • @MandeepSingh : Yes I'm using the same bundle identifier and both are same. – SudhakaranR Jan 13 '17 at 06:49
  • Have you add your account to Xcode and add your team on Build settings before where we select the provisioning profile? – Mandeep Singh Jan 13 '17 at 06:52
  • Untick the Automatically manage signing and select your provisioning profile in general(Tab) again. Then run your command. – Mandeep Singh Jan 13 '17 at 07:14
  • From the image, we can see that your provisioning profile is not set properly – KrishnaCA Jan 13 '17 at 07:27
  • Thanks @MandeepSingh Okay I will unchecked the automatically manage option and do check. – SudhakaranR Jan 13 '17 at 07:30
  • Thanks @KrishnaCA – SudhakaranR Jan 13 '17 at 07:30
  • Facing an same issue.@MandeepSingh @KrishnaCA – SudhakaranR Jan 13 '17 at 08:51
  • Now I changed the profile name to "iOS Team Provisioning Profile: * " after changed getting an different error, --- xcodebuild: WARNING: -exportArchive without -exportOptionsPlist is deprecated error: Code signing operation failed ** EXPORT FAILED ** – SudhakaranR Jan 13 '17 at 08:58
  • Please show images of your Build settings -> Code signing so that we can check whether you're setting it correctly – KrishnaCA Jan 13 '17 at 09:46
  • @KrishnaCA I'm doing it from cli. When I build and archive from xcode gui I didn't face such issue...it's only when I doing it from CLI – SudhakaranR Jan 13 '17 at 10:30
  • @KrishnaCA : Attached the build settings please verify. – SudhakaranR Jan 13 '17 at 10:51
  • Verified. As I told you, your build settings are incorrect. 1) Change the provisioning profile from automatic to your `iOS Team Provisioning Profile` 2) Change the code signing from `Don't code sign` to valid setting. Click on it to get more options and choose the valid code signing option. It will be like `iOS Distribution` or something similar – KrishnaCA Jan 13 '17 at 10:55
  • @KrishnaCA : Can you correct if any mistake here, # xcodebuild -exportArchive -archivePath "project.xcworkspace.xcarchive" -exportPath "project.xcworkspace" -exportFormat ipa -exportProvisioningProfile "Digi Form Development" -alltargets -parallelizeTargets -configuration Debug CODE_SIGN_IDENTITY="iPhone Developer: sudhakaran.rajendran@---.com (5PZNHKLMM)" also I have multiple code-signin certificate is that cause any conflicts? – SudhakaranR Jan 13 '17 at 11:17
  • what about Release CODE_SIGN_IDENTITY? you're supposed to set it for both Release and Debug I believe. Is it working now? – KrishnaCA Jan 13 '17 at 11:28
  • @KrishnaCA: Yep...I done for both release and debug but no luck still get the same issue. – SudhakaranR Jan 13 '17 at 11:36
  • @KrishnaCA : Any further try out or I miss out something as said I have multiple certificates is that causing any conflicts? – SudhakaranR Jan 15 '17 at 06:37
  • Still getting the same issue as in the question? – KrishnaCA Jan 15 '17 at 06:48
  • @KrishnaCA: yes still has the same issue. – SudhakaranR Jan 15 '17 at 08:02

1 Answers1

0

You need to create a exportOptions.plist file, then add the command line flag as so:

-exportOptionsPlist exportOptions.plist

The export options plist should look something like the following:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>compileBitcode</key>
  <false/>
  <key>method</key>
  <string>ad-hoc</string>
  <key>provisioningProfiles</key>
  <dict>
    <key>my.bundle.idenifier</key>
    <string>My Provisioning Profile Name</string>
  </dict>
  <key>signingCertificate</key>
  <string>iPhone Distribution</string>
  <key>signingStyle</key>
  <string>manual</string>
  <key>stripSwiftSymbols</key>
  <true/>
  <key>teamID</key>
  <string>YOURTEAMID</string>
  <key>thinning</key>
  <string>&lt;none&gt;</string>
</dict>
</plist>

Note that signing style can be manual or automatic. If you are explicitly setting the provisioning profile, which I tend to do, use manual and specify the provisioning profile name explicitly. If automatic, Xcode will try to automatically find a matching profile.

For the method field, the options are: development, ad-hoc, distribution and enterprise.

Here is a link with a more general description on this feature: http://devcenter.bitrise.io/tips-and-tricks/xcodebuild-export-options/

Jerry Horton
  • 865
  • 7
  • 11