We are using fastlane and jenkins in an iOS app to build it. Wer have already configured fastlane to build the app but the problem is that we couldn't find a solution to use the same configs to build both ad-hoc and app-store apps.
under /fastlane folder we have gymfile and fastfile with these configuration:
Gymfile:
scheme("XXXApp")
workspace("XXXX")
output_directory("./fastlane/Builds")
export_method("ad-hoc")
include_symbols(true)
include_bitcode(false)
xcconfig("......XXXX")
sdk("iphoneos")
Fastfile: for Test app (where we want to build it with ad-hoc)
lane :test do |options|
get_info_plist_value(path: ENV["INFO_PLIST_PATH"], key: "CFBundleVersion")
increment_build_number(
build_number: options[:build_number],
xcodeproj: "./XXXXX"
)
build_test
end
for production app (where we want to use app-store export method):
lane :candidate_prod do |options|
get_info_plist_value(path: ENV["INFO_PLIST_PATH"], key: "CFBundleVersion")
increment_build_number(
build_number: options[:build_number],
xcodeproj: "./XXXXXX"
)
update_project_provisioning(
xcodeproj: "./XXXXXX",
profile: "./fastlane/productionprovisionprofile",
target_filter: "productionappname",
build_configuration: "Release",
code_signing_identity: "XXXX"
)
build_prod
and also we have this private lane in fastfile(this is for prod but we have another one for test app):
private_lane :build_prod do
build_ios_app(
workspace: "XXXXXX",
#configuration: configuration,
scheme: "productionappname",
silent: false,
codesigning_identity: "XXXXX",
include_bitcode: false,
)
puts "$IPA_OUTPUT_PATH::\"#{lane_context[SharedValues::IPA_OUTPUT_PATH]}\""
end
In jenniks, we have a step where it runs this:
fastlane candidate_prod build_number:${BUILD_NUMBER}
or test instead of candidate_prod in case we want test app
The question is: what changes can we make in order to have lanes with different export methods according to the app that we want to generate (add-hoc or app-store) and how to specify the provision profile for each build(test and prod) so we make sure we build the app with its provision profile?
There are several options - my guess is that in anyway you have more than 1 bundle identifier to the different apps...
something like this
Prod
build_app(
workspace: "XXXX.xcworkspace",
scheme: "XXXXX",
......
export_options: {
method: "app-store",
signingStyle: 'manual',
provisioningProfiles: {
"bundle id": "Prod profile full name",
}
})
Ad-hoc
build_app(
workspace: "XXXX.xcworkspace",
scheme: "XXXXX",
......
export_options: {
method: "ad-hoc",
signingStyle: 'manual',
provisioningProfiles: {
"bundle id": "Ad-hoc full name",
}
})
Not sure if the naming are correct for the methods - See for more details
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.