We build UnrealGame.stub on macOS and then copy it to Windows to package the final iOS application. Starting with UE 5.8, the generated iOS application can no longer be installed on a device because the code signature validation of an embedded framework fails during installation.
The error log is shown below:
/usr/bin/xcrun executing 'devicectl device install app UE5/GauntletTemp/DeviceCache/IOS/default/TempBuildCache/Payload/UnrealGame.app -v --device 000080xxxxx'
ERROR: Failed to install the app on the device. (com.apple.dt.CoreDeviceError error 3002 (0xBBA))
NSURL = file:///UE5/GauntletTemp/DeviceCache/IOS/default/TempBuildCache/Payload/UnrealGame.app/
----------------------------------------
Unable to Install ?UnrealGame? (IXUserPresentableErrorDomain error 14 (0x0E))
NSLocalizedFailureReason = This app cannot be installed because its integrity could not be verified.
NSLocalizedRecoverySuggestion = Failed to verify code signature of /var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.WpDBPv/extracted/UnrealGame.app/Frameworks/MarketplaceKitWrapper.framework : 0xe8008014 (The executable contains an invalid signature.)
----------------------------------------
Failed to verify code signature of /var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.WpDBPv/extracted/UnrealGame.app/Frameworks/MarketplaceKitWrapper.framework : 0xe8008014 (The executable contains an invalid signature.) (MIInstallerErrorDomain error 13 (0x0D))
SourceFileLine = 80
FunctionName = +[MICodeSigningVerifier _validateSignatureAndCopyInfoForURL:withOptions:error:]
LegacyErrorString = ApplicationVerificationFailed
LibMISErrorNumber = -402620396
This workflow has been working in previous Unreal Engine versions and has not exhibited this issue before UE 5.8.
The detailed repro steps are attached. Could you please advise whether this is a known issue in UE 5.8 and provide guidance on the correct workflow or fix for generating a valid iOS package in this scenario?
Prepare the UnrealEngine-5.8.0-release source on both macOS and Windows.
On a MacOS, build UnrealGame.stub : sh Engine/Build/BatchFiles/Mac/Build.sh UnrealGame IOS Development -CreateStub
Copy all files from Engine/Binaries/IOS on the MacOS to the corresponding Engine/Binaries/IOS directory on a Windows machine.
On Windows, build UnrealEditor and create a simple iOS project.
Use Project Launcher to build and cook the project using the following configuration:
Platform : IOS
Configuration : Development
Content scheme : Development package
Build The Game is unchecked.
Run to an iphone that is connected to Windows
If the iphone is connected to Mac machine:
Copy the generated .ipa file back to the Mac.
Install the .ipa using Xcode or xcrun devicectl device install app command.
Observe that the installation fails due to an invalid code signature in one or more frameworks contained within the application package.
ERROR: Install failed. Got error "ApplicationVerificationFailed" with code 0xe8008014: Failed to verify code signature of /var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.Jcxjbm/extracted/Payload/UnrealGame.app/Frameworks/MarketplaceKitWrapper.framework : 0xe8008014 (The executable contains an invalid signature.)
Thank you for reporting this issue. It seems 5.8 added a framework included by default, however, the windows codesigning mechanism only signs the executable. We are looking at what is involved to fully sign all code artifacts on the Windows side, however, in its current state, building from Windows would not yield an installable app bundle.
Are you able to provide of log of the remote packaging? Looking at things on this end, it looks like the embedded framework should be getting signed on the Remote Mac but would like to confirm if that is the case on your end.
It does appear based on the log that embeded frameworks aren’t getting signed on the Remote Mac. Could you confirm that by running:
otool -l path/to/MarketplaceKitWrapper.framework/MarketplacekitWrapperin the generated stub file? (not that this is just a zip which can be extracted). Output would show a section named LC_CODE_SIGNATURE if a signature exists.
If no signature is found, can you confirm if the remote Mac logged in to the Apple Developer portal? The issue on this end is that the Windows IPhonePackager utility only signs the main executable. So if the stub returned from the Remote Mac has unsigned or mis-signed frameworks, this will yield an IPA that is incorrectly provisioned for device deployment. We hope to fix it at that level, however, please confirm the above about your stub as the solution does rely on an existing signature to inject a new on on Windows. Do you have Perforce access or are you solely on GitHub?
Thanks for the clarification. Do you happen to know the Perforce changelist associated with this solution, if it is already available? It would be helpful for tracking and verification purposes.
I believe we have a solution to this issue, however, hoping to test out against your specific use case as we are having trouble getting repro on this end. Can you extract the contents of the attachment to Engine/Binaries/DotNet/IOS and let us know if the signing issues are resolved as a result? Note that the attached version of iPhonePackager is compiled against .NET 10.0 and would require that runtime be installed to the Windows PC executing the iOS build.