ios 如何用Flutter创建ipa文件

cwxwcias  于 2023-06-25  发布在  iOS
关注(0)|答案(3)|浏览(220)

我已经升级了我的flutter版本1.26.0 - 1.0.pre
现在我正试图建立ipa文件与命令

flutter build ipa --export-options-plist=ExportOptions.plist

File ExportOptions. plist包含以下内容:

<?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>destination</key>
    <string>export</string>
    <key>method</key>
    <string>ad-hoc</string>
    <key>signingStyle</key>
    <string>automatic</string>
    <key>stripSwiftSymbols</key>
    <true/>
    <key>teamID</key>
    <string>/*This is my team ID*/</string>
    <key>thinning</key>
    <string>&lt;none&gt;</string>
</dict>
</plist>

build命令的输出为:

Running pod install...                                           1,691ms
Running Xcode build...
 └─Compiling, linking and signing...                        17.3s
Xcode archive done.                                         33.7s
Built /Users/alexeyzhulin/Projects/flutter/shopping-list/build/ios/archive/Runner.xcarchive.
Building IPA...                                                  1,977ms
Encountered error while building IPA:
error: exportArchive: No profiles for 'ru.alexeyzhulin.shoppingList' were found

什么样的配置文件我必须添加到我的plist文件?
我正在使用自动签名,正如你可以在我的plist内容中看到的,如果我运行

flutter xcodebuild -h

我能看见

provisioningProfiles : Dictionary

        For manual signing only. Specify the provisioning profile to use for each executable in your app. Keys in this dictionary are the bundle identifiers of executables; values are the provisioning profile name or UUID to use.

如何使用命令行flutter工具构建ipa文件?

hsvhsicv

hsvhsicv1#

我的建议是用XCode手动生成IPA,至少第一次是这样。这将在创建.ipa文件的同一目录中生成一个名为ExportOptions.plist的.plist文件。
然后,您可以通过运行以下命令将ExportOptions.plist文件用于下一次交付:

flutter build ipa --export-options-plist=absolute/path/to/ExportOptions.plist

一切都在这里解释:https://flutter.dev/docs/deployment/ios#create-a-build-archive-with-xcode

dy2hfwbg

dy2hfwbg2#

我使用了下面的github动作,效果很好。

- name: 'Upload app to TestFlight'
    uses: apple-actions/upload-testflight-build@v1
    with: 
      app-path: 'path/to/application.ipa' 
      issuer-id: ${{ secrets.APPSTORE_ISSUER_ID }}
      api-key-id: ${{ secrets.APPSTORE_API_KEY_ID }}
      api-private-key: ${{ secrets.APPSTORE_API_PRIVATE_KEY }}

这里有一篇详细的文章来构建和发布Flutter iOS应用与github动作。在下面的文章中,在管道中添加上面的github动作。
Build and Publish Flutter iOS Apps

2guxujil

2guxujil3#

下面的步骤将生成.ipa
1.运行flutter build ios(它将生成AppName.app文件)
1.在项目结构build/ios/iphoneos/AppName.app中找到上面生成的文件(通过finder转到此位置)
1.复制AppName.app并在桌面或任何位置创建ProjectName文件夹,然后将AppName.app粘贴到新创建的文件夹中。
1.压缩ProjectName文件夹(看起来像ProjectName.zip
1.最后,将ProjectName.zip重命名为ProjectName.ipa并使用此.ipa

相关问题