Build and sign for distribution

Usualy during development i build project with:

ionic cordova build ios --prod

it signs with development provisioning profile.

When i do:

ionic cordova build ios --prod --release

i have profiles conflict:

=== BUILD TARGET Project Name OF PROJECT Project Name WITH CONFIGURATION Release ===

        Check dependencies
        Code Signing Error: Project Name has conflicting provisioning settings. Project Name is automatically signed
        for development, but a conflicting code signing identity iPhone Distribution has been manually specified. Set
        the code signing identity value to "iPhone Developer" in the build settings editor, or switch to manual signing
        in the project editor.
        Code Signing Error: Code signing is required for product type 'Application' in SDK 'iOS 11.0'

        ** ARCHIVE FAILED **

At Xcode now i use “Automaticaly manage signing”

1 Like

And your question is what exactly?

I use deployment with Ionic PRO.

When I do build with:

ionic cordova build ios --prod

At first App start i have alert about application in test/debug/devel mode, so allow or disable updates.

I want to build for production instead devel, so use command:

ionic cordova build ios --prod --release

and it generate Error.

How to build for production AdHoc with ionic cli ?

This:

contradicts anything you posted after that:

These are commands to build locally.

Which is it?


This is the correct command. Do you want to fix the error you posted in your first post?

The error message says:

Did you manually mess with the .xcodeproj file in Xcode?

I build locally, upload ipa to diawi, propagate it to restricted testers.

They install, use.

I upload builds to PRO with
git push ionic master

An it deploys to tester’s devices by scenario:


cordova plugin add cordova-plugin-ionic --save \
--variable APP_ID="cf2434d7" \
--variable CHANNEL_NAME="Master" \
--variable UPDATE_METHOD="background"

I want to build for distribution, not development, use for this purposes “–release” directive, it not works.

Ok.

See my other questions in the last post.

No, any manual changes

What do you mean by “manual changes”? Manual changes to the xcodeproj file in platforms/ios?

mentioned, not manualy touched .xcodeproj, as per question

Did you manually mess with the .xcodeproj file in Xcode?

Open the project in Xcode, set the signing identity, close the project. Try again.

I customized all places for signing, provided proper profiles for Debug and Release, now have

EXPORT FAILED

        2017-09-11 20:24:00.872 xcodebuild[43177:73901066] [MT] IDEDistribution: -[IDEDistributionLogging
        _createLoggingBundleAtPath:]: Created bundle at path
        '/var/folders/ks/tmzgfbh52kzd2d0nnyvfwn5c0000gn/T/ProjectName_2017-09-11_20-24-00.871.xcdistributionlogs'.
        2017-09-11 20:24:01.703 xcodebuild[43177:73901066] [MT] IDEDistribution: Step failed:
        <IDEDistributionSigningAssetsStep: 0x7faf585b75e0>: Error Domain=IDEDistributionSigningAssetStepErrorDomain
        Code=0 "Locating signing assets failed." UserInfo={NSLocalizedDescription=Locating signing assets failed.,
        IDEDistributionSigningAssetStepUnderlyingErrors=(
             "Error Domain=IDEProvisioningErrorDomain Code=9 \"\"ProjectName.app\" requires a provisioning profile.\"
        UserInfo={NSLocalizedDescription=\"ProjectName.app\" requires a provisioning profile.,
        NSLocalizedRecoverySuggestion=Add a profile to the \"provisioningProfiles\" dictionary in your Export Options
        property list.}"
        )}
        error: exportArchive: "ProjectName.app" requires a provisioning profile.

        Error Domain=IDEProvisioningErrorDomain Code=9 ""ProjectName.app" requires a provisioning profile."
        UserInfo={NSLocalizedDescription="ProjectName.app" requires a provisioning profile.,
        NSLocalizedRecoverySuggestion=Add a profile to the "provisioningProfiles" dictionary in your Export Options
        property list.}

        ** EXPORT FAILED **

        Error: Error code 70 for command: xcodebuild with args:
        -exportArchive,-archivePath,ProjectName.xcarchive,-exportOptionsPlist,/Users/macbook/IOS/ProjectName/platforms/ios/exportOptions.plist,-exportPath,/Users/macbook/IOS/ProjectName/platforms/ios/build/device

Xcode 9 generated problems, switched to 8.3.3 and all solved

1 Like

Xcode 9 released, and this bug again present, so looks like problem back.

Stay on 8.3.3 when 9 released, some not correct.

1 Like

Solved, had manually edit build-release.xcconfig
and change rows to:

CODE_SIGN_IDENTITY = iPhone Developer
CODE_SIGN_IDENTITY[sdk=iphoneos*] = iPhone Developer

You should also be able to just set this in Xcode in the UI.

It somewhy readonly in the UI, or i not found location

it seems that this is not the real solution, how can i do a permanet solution ?

Just updated ios platform due to new cordova release, and again had this headache.

Again holly random with customizations and at N-iteration all successed.

Pretty usual practice lol.