bitrise-steplib / steps-xcode-build-for-simulator

MIT License
4 stars 18 forks source link

No option to toggle CODE_SIGNING_ALLOWED #30

Closed smmcdonald closed 2 years ago

smmcdonald commented 2 years ago

Troubleshooting

Useful information

Issue description

Currently, there is no option to toggle "CODE_SIGNING_ALLOWED=NO", which is required by some CocoaPod frameworks such as Firebase Remote Config to work properly.

Bitrise info

Running build
$ set -o pipefail && xcodebuild "-workspace" "/Users/vagrant/git/MyProject.xcworkspace" "-scheme" "My Project" "-configuration" "QA" "CODE_SIGNING_ALLOWED=NO" "-destination" "id=5210DB4C-7CD4-4DE7-AC08-6E2F259F04B4" "COMPILER_INDEX_STORE_ENABLE=NO" "clean" "build" | xcpretty
  

It is possible to work around this limitation by adding "CODE_SIGNING_ALLOWED=YES" in the 'Additional options for xcodebuild call' under the 'Debug' section but I wouldn't rely on this as it produces a command that looks like this with two CODE_SIGNING_ALLOWED flags that may not always work:

xcodebuild "-workspace" "/Users/vagrant/git/MyProject.xcworkspace" "-scheme" "My Project" "-configuration" "QA" "CODE_SIGNING_ALLOWED=NO" "-destination" "id=5210DB4C-7CD4-4DE7-AC08-6E2F259F04B4" "COMPILER_INDEX_STORE_ENABLE=NO" "clean" "build" "CODE_SIGNING_ALLOWED=YES" | xcpretty

Steps to reproduce

Run the build for the simulator step on a project that uses Firebase Remote Config key values. The values should be fetched on app launch but are never called.

shams-ahmed commented 2 years ago

@smmcdonald can you provide more context or links on why some Cocoapods frameworks needs this disabled?

smmcdonald commented 2 years ago

This is because some frameworks require codesigning in order to produce a valid build product, otherwise, there will be an error:

CodeSign error: code signing is required for product type 'Application' in SDK
                'iOS 15.2'

and missing _CodeSignature file in the framework. https://stackoverflow.com/a/11034618/2076025

abejfehr commented 2 years ago

I just added CODE_SIGNING_ALLOWED=YES in the xcodebuild_options for this

Edit: I just saw that the workaround was the same

shams-ahmed commented 2 years ago

PR #31 will resolve the issue. Expect a new version in the next 48 hours.