Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot pass arguments to cordova CLI #3602

Closed
georgechr opened this issue Sep 26, 2018 · 1 comment
Closed

Cannot pass arguments to cordova CLI #3602

georgechr opened this issue Sep 26, 2018 · 1 comment
Labels
bug cordova Ionic projects integrated with Cordova project type: angular Ionic Angular 4+ projects

Comments

@georgechr
Copy link

Description:
Cannot pass arguments to cordova CLI when running ionic cordova run/build etc

Steps to Reproduce:
e.g. To run on iOS 12 you need to provide a buildFlag arg.
ionic cordova run ios -- --buildFlag="-UseModernBuildSystem=0"

Output:

ng run app:ionic-cordova-serve --host=0.0.0.0 --port=8100 --platform=ios --buildFlag=-UseModernBuildSystem=0
[ng] Unknown option: '--buildFlag'

It seems that the flag is passed to ng (angular)

I have also tried adding another set of '--' e.g. ionic cordova run ios -- -- --buildFlag="-UseModernBuildSystem=0"
But then the cordova command is run with an extra set of '--' and thus is not applied

@ionitron-bot ionitron-bot bot added the triage label Sep 26, 2018
@imhoffd imhoffd added the bug label Sep 26, 2018
@ionitron-bot ionitron-bot bot removed the triage label Sep 26, 2018
@imhoffd imhoffd added this to Backlog 🤖 in Tooling 🔧 via automation Sep 26, 2018
@imhoffd imhoffd added project type: angular Ionic Angular 4+ projects cordova Ionic projects integrated with Cordova labels Sep 26, 2018
@imhoffd imhoffd moved this from Backlog 🤖 to In progress 🤺 in Tooling 🔧 Sep 26, 2018
Tooling 🔧 automation moved this from In progress 🤺 to Done 🎉 Sep 26, 2018
@imhoffd
Copy link
Contributor

imhoffd commented Oct 1, 2018

@georgechr Thanks for the issue! This was a bug in the v4 build/serve code. Separated args (e.g. args after the -- separator) should be forwarded only to the Cordova CLI for the Cordova run/emulate commands. Before the fix, it was forwarding them to both, but because --buildFlag is an unknown arg, the Angular CLI exits with an error.

Unfortunately, because we wrap two CLIs in one command, this means that currently with the Cordova run/emulate commands, you can't pass extra args to the Angular CLI. See #3652 for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug cordova Ionic projects integrated with Cordova project type: angular Ionic Angular 4+ projects
Projects
Tooling 🔧
  
Done 🎉
Development

No branches or pull requests

2 participants