Ionic-cli: Problems with Cordova flags when building for iOS

Created on 26 May 2017  路  7Comments  路  Source: ionic-team/ionic-cli

We're on [email protected] and normally make our production builds for iOS using a command like:

ionic build ios --device --prod --release --developmentTeam=FOO --codeSignIdentity="iPhone Developer" --provisioningProfile=BAR --packageType=development

Running the same command (with cordova added after ionic) while using the latest ionic(-cli) doesn't finish successfully, complaining about the signing process/archiving.

I've tried using -- and -- -- right after --release in that command but no luck.

It looks like a problem with the interpretation of the Cordova flags. At the moment a big block for moving on to the latest ionic-cli.

ionic info
global packages:

@ionic/cli-utils : 1.2.0
Cordova CLI      : 6.5.0 
Ionic CLI        : 3.2.0

local packages:

@ionic/app-scripts              : 1.3.7
@ionic/cli-plugin-cordova       : 1.2.1
@ionic/cli-plugin-ionic-angular : 1.2.0
Cordova Platforms               : ios 4.4.0
Ionic Framework                 : ionic-angular 3.3.0

System:

Node       : v6.10.3
OS         : macOS Sierra
Xcode      : Xcode 8.3.2 Build version 8E2002 
ios-deploy : 1.9.1 
ios-sim    : 5.0.13
bug

Most helpful comment

Thanks @dwieeb, I can confirm it's all good after the fix.

If anyone still wondering, the following command pattern applies for iOS now:
ionic cordova build ios --device --prod --release -- --developmentTeam=FOO --codeSignIdentity="iPhone Developer" --provisioningProfile=BAR --packageType=development
(Notice the extra -- after --release)

All 7 comments

@zarko-tg Does the output look like it forwards the arguments with you use -- -- ?

I think I know what's wrong.

A little bit hard to tell but if i remember well it was failing in the archive stage/signing regarding missing development team (value).

I'm stuck on cli 2.x.x until fix is in place. We do everything via command line and depend on working Cordova flags.

Oh, that's weird, cordova says this:

To provide platform specific options, you must include them after `--`.

But it looks like it only works if I don't include the --:

$ cordova build ios --release --device --developmentTeam=FOO --codeSignIdentity="iPhone Developer" --provisioningProfile=BAR --packageType=development

Is that right? Does that work for you? I can't find documentation on where to put these flags: https://cordova.apache.org/docs/en/latest/guide/platforms/ios/#using-flags

I'll stick to the original description of the issue for the time being. Tried all sorts of variants by pure guessing but no luck.

Thanks @dwieeb, I can confirm it's all good after the fix.

If anyone still wondering, the following command pattern applies for iOS now:
ionic cordova build ios --device --prod --release -- --developmentTeam=FOO --codeSignIdentity="iPhone Developer" --provisioningProfile=BAR --packageType=development
(Notice the extra -- after --release)

@zarko-tg 馃嵒

Oops, I forgot to include those in an example command.

I think i was fighting this or something like it all day... I ended up running ionic cordova build ios --prod --release and then (re-)signing the binary using ota-tools isa_sign (https://github.com/RichardBronosky/ota-tools)

Was this page helpful?
0 / 5 - 0 ratings