<p dir="auto">I know this has been asked several times, however I'm surprised I couldn't find an entry suggesting an approach similar to Webpack+Nativescript where webpack reads vars from the environment and passes down a static object with the values set. In this case it could work by reading a very specific pattern from the cli's parameters, like:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="$ flutter run/build --env.DEBUG"><pre class="notranslate"><code class="notranslate">$ flutter run/build --env.DEBUG
</code></pre></div>
<p dir="auto">And then it would just be a matter of initializing a static data structure that would hold the passed parameters:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="if (flutter.env.DEBUG) {
    print(&quot;DEBUG&quot;)
}"><pre class="notranslate"><code class="notranslate">if (flutter.env.DEBUG) {
    print("DEBUG")
}
</code></pre></div>
<p dir="auto">I am aware of the <a href="https://flutter.rocks/2018/03/02/separating-build-environments-part-one/" rel="nofollow">multiple entry points approach</a>, but I think it becomes unintuitive when the dev environment changes constantly (e.g. having a PC at work and also working from home or while traveling), let alone when working with more people and each has their own dev environment and you end up polluting the working tree just to change an IP to test a change with a local server.</p>
<p dir="auto">Use xcode export ipa file, reported the following error, xcode 9.2 version</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="ipatool failed with an exception: #&lt;TypeError: no implicit conversion of nil into Array&gt;
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2767:in `&amp;'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2767:in `bestDeviceTraitsForBundle'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:1209:in `block in makeDeviceTraitsToDeviceTypesMapForDeviceIdentifiers'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:1194:in `each'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:1194:in `makeDeviceTraitsToDeviceTypesMapForDeviceIdentifiers'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2464:in `block in ProcessIPA'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2442:in `each'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2442:in `ProcessIPA'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2938:in `&lt;main&gt;'"><pre class="notranslate"><code class="notranslate">ipatool failed with an exception: #&lt;TypeError: no implicit conversion of nil into Array&gt;
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2767:in `&amp;'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2767:in `bestDeviceTraitsForBundle'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:1209:in `block in makeDeviceTraitsToDeviceTypesMapForDeviceIdentifiers'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:1194:in `each'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:1194:in `makeDeviceTraitsToDeviceTypesMapForDeviceIdentifiers'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2464:in `block in ProcessIPA'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2442:in `each'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2442:in `ProcessIPA'
    /Applications/Xcode.app/Contents/Developer/usr/bin/ipatool:2938:in `&lt;main&gt;'
</code></pre></div>