Is there currently a way to change code signing from Automatic to Manual for remote Swift packages in iOS builds with Unity Build Automation?
With the deprecation of Cocoapods, libraries such as Firebase are moving over to Swift packages instead. Unity updates all targets in the Xcode project to use manual signing in a fastlane step, before building with gym. This works for targets in pods, however targets in Swift packages can’t be updated in the same way before building, causing errors such as this:
/BUILD_PATH/Library/Developer/Xcode/DerivedData/Unity-iPhone-brovzeypbjhftbhdfulmghmumktu/SourcePackages/checkouts/firebase-ios-sdk/Package.swift: error: Signing for "Firebase_FirebaseMessaging" requires a development team. Select a development team in the Signing & Capabilities editor. (in target 'Firebase_FirebaseMessaging' from project 'Firebase')
I reproduced the issue locally, and recreated UBA’s Fastfile steps as best as I could based on the build logs. The only way I could build successfully was by passing CODE_SIGN_STYLE=Manual with the xcargs during the build step. This seems to be the solution others use too when using SPM in their own CI, or in non-Unity projects.
Is there a way to set this in UBA without the custom xcargs being overwritten by the gym_options that’s being passed into the gym call? How are those options constructed? Would there be any downside to Unity passing in CODE_SIGN_STYLE=Manual by default, along with the other argument currently used? (-UseModernBuildSystem=YES)
I’ve reverted to using the Firebase pods instead in the meantime, but I’d like to fix this before it’s fully deprecated later this year - and avoid the need to modify the Firebase package each update.