Keychain and Provisioning Profile have to be accessible on the the build node. This Jenkins plugin helps you to copy keychain and profile to your build node. It also creates variables to reach them later on within your Jenkins job.
We observe issues with this plugin on (Jenkins) servers that are running Windows as OS though. I.e. it mistakes slashes with backslashes in paths, which renders the paths un-find-able.
In this case you have to copy the keyChain containing your certificate(s) to your build node and specify it in your build command. Before you use the keyChain, unlock it:
security unlock-keychain -p "keychain_password" "/path/to/MyKeychain.keychain"
And also the Provisioning Profile. It might be helpful to check in your profile to git. That way you have your (global) keyChain stored on the node and can reach your (project specific) Provisioning Profile in your repo and your whatever solution (e.g. xcodebuild script) generally works for all jobs, as long as the provisioning profiles path is generalized for all projects (for instance: provisioning_profiles/Release/profile.mobileprovisioning).
In this case I prefer xcodebuild
over the Xcode Jenkins Plugin.