Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to pass command line arguments like "-FIRAnalyticsDebugEnabled" to a flutter app [duplicate]

Tags:

flutter

Is there any way to pass -FIRAnalyticsDebugEnabled flag to a flutter app when using flutter run on the command line?

I've added it to the scheme in XCode, so that when I run through XCode (by building and running the Runner scheme) the flag is passed, but when I run from the command line it doesn't get passed.

There does seem to be a --flavor command line flag for flutter run which claims it would let me select a scheme to run, but passing --flavor=Runner results in an error saying the scheme isn't found. I'm not sure how to use this flag or find docs for it.

like image 688
Daniel Brotherston Avatar asked May 16 '18 20:05

Daniel Brotherston


1 Answers

Spent a lot of time on this. Basically currently after you add launch argument to XCode scheme there is no simple way to flutter run with these arguments, here is the issue related to this.

The workaround I used is to run the app from XCode.

like image 149
almeynman Avatar answered Sep 28 '22 08:09

almeynman