简体   繁体   中英

Using --dart-define with Xcode archive and distribute

When building an appbundle for android I am able to use --dart-define with the flutter build appbundle shell command to define env variables for this bundle. How can I do that with Xcode workflow of Archive and Distribute?

You can generate the.ipa with this command flutter build ipa --dart-define="HomCaepf=true" --export-options-plist=ios/fastlane/ExportOptions.plist

And the ExportOptions.plist is something like that

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
        <key>destination</key>
        <string>export</string>
        <key>method</key>
        <string>app-store</string>
        <key>provisioningProfiles</key>
        <dict>
                <key>your.app.id</key>
                <string>Provisioning Profile Name</string>
        </dict>
        <key>signingCertificate</key>
        <string>Apple Distribution</string>
        <key>signingStyle</key>
        <string>manual</string>
        <key>stripSwiftSymbols</key>
        <true/>
        <key>teamID</key>
        <string>YOU_TEAM_ID</string>
        <key>uploadSymbols</key>
        <true/>
</dict>
</plist>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM