Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upCreate iOS IPA from command line #13065
Comments
|
I don't know the details, but if it's really a simple as just one command we could certainly wrap that in |
|
cc @mit-mit @devoncarew for CLI |
|
Also running
with
|
|
cc @cbracken |
|
@cbracken can you elaborate? |
|
Thanks for filing this issue! Our currently supported iOS releasing process is described in Releasing for iOS and as noted, makes use of the Xcode UI. We don’t yet support a pure command-line mechanism for releasing to the App Store, and it’s not something we currently have prioritised but I’d certainly be more than happy to review pull requests. |
|
@cbracken thanks for your response. The error also happens when archiving within the Xcode UI. Please look into my issue: #13070. Based on the reactions I guess there are a couple of others who have this issue and can't release their app with the new version of Xcode. If you have any questions please let me know. |
|
Thanks for pointing to #13070, I'll take a look at that today. |
|
xcodebuild: Deploy iOS app from Command Line |
|
change to project ios directory,excute following command: xcodebuild -workspace Runner.xcworkspace -scheme Runner -sdk iphoneos -configuration Release archive -archivePath $PWD/build/Runner.xcarchivexcodebuild -exportArchive -archivePath $PWD/build/Runner.xcarchive -exportOptionsPlist exportOptions.plist -exportPath $PWD/build/Runner.ipaexportOptions.plist is on ios directory. <?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>compileBitcode</key>
<true/>
<key>method</key>
<string>enterprise</string>
<key>provisioningProfiles</key>
<dict>
<key>com.company.appname</key>
<string>provisioningProfiles name </string>
</dict>
<key>signingCertificate</key>
<string>iOS Distribution</string>
<key>signingStyle</key>
<string>manual</string>
<key>stripSwiftSymbols</key>
<true/>
<key>teamID</key>
<string>xxxxxx</string>
<key>thinning</key>
<string><none></string>
</dict>
</plist> |
|
This is theoretically possible. I got it to work using Fastlane (which really just invokes xcodebuild archive). We can document the flow more or possibly integrate Fastlane into flutter tools, though there are no immediate plans yet. In the meantime, you can |
|
+1 on this. I think building iPa's would be great. During beta phase of apps I sometimes have to release new versions every couple days, and it takes forever when I have to test the app by running it on a device, then do flutter build --release, and then open xcode, and do product archive, and then in organizer upload to app store, and finally wait for apple to process my app. I think this could be streamlined to just: If you're not aware of application loader, you can open it through xcode XCode > Open Developer Tool > Application Loader, but you can also pin it to your task bar to open it without opening xcode (or install it separately, though that generally is very out of date). |
|
I would also appreciate this since we want to build ipas for distrubution through CI. One (fairly crazy) issue I'm having with the current build system is that changing between Also because of this, we have to run It seams like a lot of the build system could use refactoring. In general:
I'm actually more than willing to help with this with some direction from the flutter team on what they think the best approach would be. |
|
This is what I ended up using as a complete release script, ready for uploading to the Play Store/App Store.
Edit: More detail. You need to create the You need to create a |
|
Hi, I am using Mac and in cmd I am running flutter build ios this command which will generates my Runner.app in build folder. I want to know how to run this Runner.app in real iOS device. |
|
@MisterJimson thats a good suggestion for an initial pass - we could support accepting the plist via command line parameter. I don't know if it would also be useful to support generating the config from command line options, since that would probably take a bit more research on my end. Bear with me, because I've literally never released software on the App Store, but is it common to generate the export options on the fly with other software, or is it something that is treated as a secret like the Android keystore |
|
Another option we have is to still break out the current |
|
@xster that is what the suggestion for --config-only basically is. Though at the point where you are archiving through another tool there isn't anything else for the flutter CLI to do. |
|
ya, we're saying the same thing. My only addition on the above comment is adding more ergonomics with fastlane, but that's a separate bonus step either way. |
|
@jonahwilliams I've definitely seem both ways. I generally see 2 types of approaches that companies use, depending on the use case and preference. (And to be clear this is just for Ad hoc / App Store release, not day to day debugging) Fastlane, which I think Flutter should integrate with or provide some type of easy path for usage at some point. I feel it would be difficult to replicate and maintain a similar feature set in Flutter. Static |
|
I think its unlikely we'll consider deeper Fastlane integration in the short-term. Integration with any sort of 3rd party service tends to have a high maintenance cost, both in terms of the actual integration, updates and the inevitable support requests ( mostly involving the service itself) which will start getting routed through our issue tracker. We should only do so where absolutely necessary - i.e. we integrate with Xcode even though it is a pain because that is existential for iOS development. |
|
I'm totally in favor of breaking That would require very little change to current developers' build process / CI/CD while speeding it up significantly, and on the other hand won't require any integration on Flutter's part. |
|
Would love if someone wanted to checkout + sanity check #64848 :) |
|
Just a crazy idea after reading everything: Would it be possible to only run "fastlane gym" and add a build step to the project that does the "flutter --config-only" stuff? Or will this create all kinds of other problems? |
|
Not crazy. That's the intent here. Once you flutter --config-only, you can then build the iOS app via standard iOS mechanisms such as |
|
That would be perfect, thanks! I first had understood that we still need to call it before xcodebuild. |
|
Seems like @xster misunderstood you. It's not possible, because --config-only changes some variables that affect the xcode project, and it also takes parameters that need to be be specified somehow, like entry file or dart defines. |
|
@Pe-te I think you're asking if you can just build with @szotp I might have misunderstood :) what do you mean by "it also takes parameters that need to be be specified somehow, like entry file or dart defines"? If you meant things like |
@xster Pe-te was asking if it was possible to automate |
|
Ah I misunderstood. You mean rather than in your CI script or in your Fastfile, whether you can recursively invoke (Not tested) I think that works if you invoked it early enough before the build Flutter phase or the compile sources phase but doesn't that defeat the point? In other words, the whole point is to tell Xcode what configuration to build and archive etc. If Xcode already knows, then it could just hardcode those values from |
|
Thanks for all the clarifications, just as an addition why I asked: Right now I have in my buildscript: fastlane init_keychain So it would be nice to reduce it to "fastlane build_my_app" and do all the other stuff inside the Fastfile to have the fastlane error handling for everything. I know, I could call flutter through a fastlane sh() call, but that feels weird. So the idea was to pack the --config-only also into the build phases, but I am not sure what it does exactly and how it affects the build process if you change stuff while it runs. |
|
Can we track the As for
And that will just export the archive, it doesn't run any validators. |
Never mind, it was already merged :-( |
|
The value add from The last step of making the
vs
is not that valuable (though we could add that wrapper, it's just not the hard or valuable part). |
|
Created #66619 to discuss there. |
|
@jmagman I see your point but instead of mapping all of the exportOptionsPlist options we could just take a path to that file. Similar to how your keystore needs to exist on disk and how you have to manually setup your build.gradle file before you want to release for Android. There can be a happy medium for |
|
|
|
Command has been renamed |
Flutter doesn't allow me to build an .ipa which can be published to hockeyapp/fabric or the app store.
# creates an .app not an .ipa flutter build ios --releaseManual bundling is required:
Flutter includes tools such as measuring the ipa size #4609, but I can't find a way to create an .ipa.
A followup issue for Generate a production-ready IPA from a single command is still missing