Hi, recently I tried to set up my iOS project, and there is a “CodeSign Failed” problem when it comes to distribution build. The development build works fine, I can upload an .ipa file to a remote physical device(iPhone 12) to run it. However, the distribution build fails to generate the .ipa file.
OS: macOS Big Sur 11.4
I published an iOS app before, so basically I know the use of certificate and provision. I can almost confirm the problem is not from using the wrong certificate or provision. The problem is easy to understand but tricky to solve, it is about the punctuation issue.
My iOS developer name(company name) follows this format: Xyz’s Games Inc.
I believe having space characters is acceptable, since it works in development build, but the apostrophe(’) is a problem, it is messed up with the quotation marks(") by the system.
- UATHelper: Packaging (IOS): Running: /usr/bin/env UBT_NO_POST_DEPLOY=true /usr/bin/xcrun xcodebuild build -workspace “/Users/Xyz/Documents/UnrealProjects/ProjectName/ProjectName_IOS.xcworkspace” -scheme ‘ProjectName’ -configuration “Shipping” -destination generic/platform=iOS -sdk iphoneos CODE_SIGN_IDENTITY=“iPhone Distribution: Xyz’s Games Inc. (N30VXQGVJE)” PROVISIONING_PROFILE_SPECIFIER=a85fe778-567c-43f7-96f1-5460b4ec0c80
- UATHelper: Packaging (IOS): Command line invocation:
- UATHelper: Packaging (IOS): /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild build -workspace /Users/Xyz/Documents/UnrealProjects/ProjectName/ProjectName_IOS.xcworkspace -scheme ProjectName -configuration Shipping -destination generic/platform=iOS -sdk iphoneos “CODE_SIGN_IDENTITY=iPhone Distribution: Xyzs” Games Inc. “(N30VXQGVJE) PROVISIONING_PROFILE_SPECIFIER=a85fe778-567c-43f7-96f1-5460b4ec0c70”
- UATHelper: Packaging (IOS): CODE_SIGN_IDENTITY = iPhone Distribution: Xyz
- UATHelper: Packaging (IOS): SDKROOT = iphoneos14.5
- UATHelper: Packaging (IOS):
- UATHelper: Packaging (IOS): xcodebuild: error: Unknown build action ‘Games’.
- UATHelper: Packaging (IOS): Took 3.221346s to run env, ExitCode=65
- UATHelper: Packaging (IOS): ERROR: CodeSign Failed
The problem is located at line 1 and 3:
Line 1: CODE_SIGN_IDENTITY=“iPhone Distribution: Xyz’s Games Inc. (N30VXQGVJE)”
Line 3: “CODE_SIGN_IDENTITY=iPhone Distribution: Xyzs” Games Inc. “
Line 1 is correct, but line 3 is messed up. My company name is broken into 2 chunks: Xyzs and Games. For some reason, the apostrophe is replaced by none and a new quotation mark is added behind it, then the string(CODE_SIGN_IDENTITY=iPhone Distribution: Xyzs) is being wrapped by a pair of quotation marks, which violates the syntax of this command line and causes the error.
My thought and potential solutions are:
- Is it still possible to compile it using Xcode directly to avoid this problem? How? I searched a lot, but couldn’t find a detailed tutorial of how to do it, like opening it in Xcode and configure. Xcode doesn’t have this concern, special punctuations are accepted.
- Run “xcodebuild build” in cmd: This will cause error of “ProjectName_IOS.xcworkspace doesn’t exist”, my project is pure blueprint, so no xcworkspace is generated inside the project folder.
- There is nothing to do with the provision, I can’t change the company name, otherwise it won’t be valid.
Can anyone provide solutions to this case? Thanks.