When I try to build my app trough ssh with xcodebuild
xcodebuild -sdk iphoneos10.1 -target <app_target> -configuration Debug CODE_SIGN_IDENTITY="iPhone Developer" PROVISIONING_PROFILE=<profile> CONFIGURATION_BUILD_DIR=<some_dir>
It spits an error
No signing certificate "iOS Development" found: No "iOS Development" signing certificate matching team ID "team_id" with a private key was found. Code signing is required for product type 'Application' in SDK 'iOS 10.1'
If I run it without ssh it builds. The CODE_SIGN_IDENTITY is different than the "certificate_name". Shouldn't they be the same? The one I ask for is "iPhone Developer" and the build error is about "iOS Development".
I have tried this answer (if at all relevant to my problem).
When ssh-ed and I try security list-keychains
it lists the system keychain twice. If I have not ssh-ed it shows the user login keychain-db as well.
I unlock the login keychain when ssh-ed to see if it will be displayed in the list and it is not.
Well the easiest solution was to copy the certificate from the login keychain to the system keychain. Don't know how secure or correct that is.