Tag Archives: xcodebuild error: Command PhaseScriptExecution failed with a nonzero exit code

[Solved] Xcodebuild error: Command PhaseScriptExecution failed with a nonzero exit code

Update the “p12” Certificate in the machine that compiles the IOS project, and then the xcodebuild command fails to package all the time. The error occurs in the “framework re signing phase in” *. App/frameworks “, that is, the re signing fails

the error message is as follows:


/Users/iOS-Build/.jenkins/workspace/iOS-test/_DerivedData/Build/Intermediates.noindex/ArchiveIntermediates/iOS-test/InstallationBuildProductsLocation/Applications/iOS-test.app/Frameworks/HyphenateLite.framework: errSecInternalComponent

Command PhaseScriptExecution failed with a nonzero exit code

reasons for errors :

When using the new p12 file signature, the first time I need to enter a password to unlock the “Keychain”, but I didn’t unlock it

solutions:

Although I use the command “usr/bin/security” to unlock the keychain in my code, it seems to be invalid in this case

My method is to find any. Framework file and execute it on the machine where the task is compiled

codesign -f -s "Name of the new p12 file in the keychain" HyphenateLite.framework

This will trigger the keychain to pop up the password input box, input the password, check “always valid”, and then execute the previous compilation

Note: you can’t use SSH to execute the above codesign command, because this command will pop up the UI box, so you can either connect the machine with VNC or directly connect the machine with the screen