I want to be able to do both adhoc
builds for Firebase Distribution
and appstore
builds for TestFlight/AppStore. I'm also using CI/CD system (CircleCI
). I use Fastlane match
for builds signing. My question is how to do switch between different type of certificates when do different type of builds?
My idea was to set up in Xcode for Debug configuration adhoc signing certificate, and for release configuration appstore certificate. However, when I tested this approach, turns out that adhoc builds are crashing immediately after the app launch, so it looks like this approach is not correct.
Here is my Fastfile:
platform :ios do
before_all do
setup_circle_ci
end
desc "Runs tests and build the app "
lane :testandbuild do |options|
commit = last_git_commit
# Uncomment the line if you want to increment build number
# increment_build_number(xcodeproj: "MyApp.xcodeproj")
scan(
scheme: "MyApp"
)
if(options[:branch] == "main")
increment_build_number
keyFilePath = File.join(Dir.pwd, "appStoreKey.p8")
app_store_connect_api_key(
key_id: options[:key_id],
issuer_id: options[:issuer_id],
key_filepath: keyFilePath,
# duration: 1200,
in_house: false,
)
match(type: "appstore", readonly: "false")
build_app(
scheme: "MyApp",
configuration: "Release"
)
upload_to_testflight(
skip_waiting_for_build_processing: true
)
else
match(type: "adhoc")
gym(export_method: "ad-hoc", scheme: "MyApp", configuration: "Debug" , output_directory: "../output")
firebase_app_distribution(
groups: 'dev-team',
release_notes: "Branch: #{options[:branch]}. Message: #{commit[:message]}",
firebase_cli_token: options[:firebase_cli_token]
)
end
end
end
I found the solution inside the gym
I added
xcargs: "PROVISIONING_PROFILE_SPECIFIER='match AdHoc myapp.com'"
for adhoc
build and for appStore
build I added xcargs: "PROVISIONING_PROFILE_SPECIFIER='match AppStore myapp.com'"
.
I removed for AdHoc build configuration: "Debug"
.