我正在使用 Fastlane match和gym来构建我的应用程序并将其从 CI (Bitrise) 分发到 Fabric。如Fastlane 文档中所述,使用 AdHoc 配置文件将我的 Xcode 设置设置为手动并使用 Release 配置
现在我想从 CI 分发到 Appstore,但它失败了,因为 XcodeRelease
配置设置为使用 AdHoc 配置文件并且 Match 安装了 AppStore 配置文件。
+---------------------------------------------------------------+-----------------------------------------------------------------------------+
| Summary for gym 2.112.0 |
+---------------------------------------------------------------+-----------------------------------------------------------------------------+
| scheme | AeroNavMap |
| export_method | app-store |
| export_xcargs | -allowProvisioningUpdates |
| export_options.provisioningProfiles.net.tequilaapps.airnavmap | match AppStore net.tequilaapps.airnavmap |
| workspace | ./PEMap.xcworkspace |
| destination | generic/platform=iOS |
| output_name | AeroNavMap |
| build_path | /Users/vagrant/Library/Developer/Xcode/Archives/2019-01-06 |
| clean | false |
| output_directory | . |
| silent | false |
| skip_package_ipa | false |
| result_bundle | false |
| buildlog_path | /var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/fastlane_logs957341986/gym |
| skip_profile_detection | false |
| xcode_path | /Applications/Xcode.app |
+---------------------------------------------------------------+-----------------------------------------------------------------------------+
[13:47:38]: $ set -o pipefail && xcodebuild -workspace ./PEMap.xcworkspace -scheme AeroNavMap -destination 'generic/platform=iOS' -archivePath /Users/vagrant/Library/Developer/Xcode/Archives/2019-01-06/AeroNavMap\ 2019-01-06\ 13.47.38.xcarchive archive | tee /var/folders/90/5stft2v13fb_m_gv3c8x9nwc0000gn/T/fastlane_logs957341986/gym/AeroNavMap-AeroNavMap.log | xcpretty
[13:47:42]: ▸ ❌ error: No profile for team 'XXXXXXXX' matching 'match AdHoc net.tequilaapps.airnavmap' found: Xcode couldn't find any provisioning profiles matching 'G9MA9G2SST/match AdHoc net.tequilaapps.airnavmap'. Install the profile (by dragging and dropping it onto Xcode's dock item) or select a different one in the General tab of the target editor. (in target 'AeroNavMap')
[13:47:42]: ▸ ** ARCHIVE FAILED *
这一切都说得通,但问题是我应该如何设置 Xcode,以便我可以拥有两个 Fastlane 通道,一个用于构建 AppStore,另一个用于 AdHoc。
我可以创建一个新的 Xcode 配置AppStore
,在其中设置 AppStore 配置文件,但这会引发另一个问题,即我的自定义框架没有构建。类似于这个问题。我有许多自定义框架,我也需要在他们的 Xcode 项目中创建相同AppStore
的配置,但这太过分了。
我尝试如下强制gym
使用 AppStore 配置文件,但这无济于事。Xcode 中设置的 AdHoc 配置文件仍在使用中。
desc "Builds the app for the AppStore"
lane :build_appstore do
match(type: "appstore", readonly: true)
build_app(
scheme: "AeroNavMap",
export_method: "app-store",
skip_profile_detection: true,
export_options: { provisioningProfiles: { "net.tequilaapps.airnavmap" => "match AppStore net.tequilaapps.airnavmap"}}
)
end
我目前的解决方案是在构建之前手动更新 xcodeproj 但这也不是很干净
lane :build_appstore do
match(type: "appstore", readonly: true)
if Helper.ci?
UI.message "Patching Xcode proj to use AppStore profile"
`sed -i.bak -e 's/match AdHoc net.tequilaapps.airnavmap/match AppStore net.tequilaapps.airnavmap/g' ../PEMap/PEMap.xcodeproj/project.pbxproj`
end
build_app(scheme: "AeroNavMap", export_method: "app-store")
end