To run builds in Cordova Ionic without having to generate the project and opening it in XCode and selecting it from command line:
- First run:
security find-identity -p codesigning -v
Command will return list of certificates such as: 13D6BF214D52A777C59114591DBBA36D875538F7 "Apple Development: [email protected] (2PZG12NNCV)"
- Fetch the correct required ID, by pasting in the selected certificate name as shown above:
security find-certificate -c "Apple Development: [email protected] (2PZG12NNCV)" -p | openssl x509 -subject
It will return the certificate but will start with: subject= /UID=SOMEUID/CN=Apple Development: [email protected] (2PZG12NNCV)/OU=4201ZNUA12/O=Saifur Rahman Mohsin/C=US The OU is the ID that is required i.e. 4201ZNUA12.
Create the build.json config file within the project as:
{
"ios": {
"debug": {
"codeSignIdentity": "iPhone Developer",
"developmentTeam": "4201ZNUA12",
"packageType": "development",
"automaticProvisioning": true
}
}
}
Now the project can be run as ionic cordova run ios --debug
And you should be able to use it without any hassle.
(All Apple IDs, cert IDs, etc. in this gist are modified to garbage values. Numbers are just for representation.)