ionic build package error for ios - code sign error - xcode

I'm struggling in getting my app ready for submission to Apple App Store...
I have valid ios development and distribution certificates and provisioning profiles.
I can successfully build my app via Xcode using development certificates and provisioning profile and works fines on test device i.e. iPhone 4s.
However, when I change the 'Code Signing Identify' setting in Xcode to use my Apple distribution certificates and set the Provisioning Profile to the production profile, the app builds successfully but when Xcode tries to run the app on the iPhone, it throws an error: 'App installation failed. A valid provisioning profile for this executable was not found'.
Not sure if the above is related, when I try to build the app using ionic package CLI command; 'ionic package build ios --release --profile [PROFILE-TAG]' I get this error:
CheckCheck dependencies
Code Sign error: No code signing identities found: No valid signing identities (i.e. certificate and private key pair) were found.
For info, I have created the ionic security profile as suggested here: Security Profiles
I'm using:
OS X El Capitan
Xcode 7.2.1
Cordova 6.0.0
Ionic version: 1.2.4
Happy to provide more info if required. Thank you.

As you have mentioned in the question
However, when I change the 'Code Signing Identify' setting in Xcode to use my Apple distribution certificates and set the
Provisioning Profile to the production profile, the app builds
successfully but when Xcode tries to run the app on the iPhone, it
throws an error: 'App installation failed. A valid provisioning
profile for this executable was not found'.
You can't directly run the build with the production profile/certificate in the device, to directly run from the xcode you have to build it with the development provision profile
If you want to test your production build before submisson you can download it with the TestFlight, it will be easier and better way of checking the build as same build will go for the submisson
If you need help with testflight you can refer doc here:
Apple Doc:Beta testing with testfligjt
Apple Doc: Distribute your app with testflight
Ray wenderlich Testflight tutorial

App which signed with an App Store provisioning profile can only be installed that downloaded from App Store, and for testing production behavior, you can generate an Ad-Hoc profile to sign your app. Ad Hoc Provisioning Profiles in Depth and How to

Related

CI/CD Mac Builds Fail IPA-Path or PKG-Path

I am deploying a mac build with bitrise and it is failing at the step
Deploy to App Store Connect with Deliver
Here is the error
Issue with input: no IpaPath nor PkgPath parameter specified
When I try to upload the mac app through organiser it fails with error
asset validation failed missing provisioning profile apps must contain a provisioning profile

Xamarin.ios Error MSB6006: “codesign” exited with code 1 When Trying to Archive for Publishing

I am having an error like Xamarin.ios Error MSB6006: "codesign" exited with code 1 except this is when I am doing "Archive for Publishing" which is a step to publish Xamarin.ios. Can you guys please assist me with this? Thank you.
About publishing to App Store :
First , need to Create and install an App Store provisioning profile .
iOS uses provisioning profiles to control how a particular application build can be deployed. These are files that contain information about the certificate used to sign an app, the App ID, and where the app can be installed. For development and ad hoc distribution, the provisioning profile also includes the list of allowed devices to which you can deploy the app. However, for App Store distribution, only certificate and App ID information are included since the only mechanism for public distribution is the App
Store.
Second, Update the Release build configuration
The last , Build and submit your app .
Note : If using Automatical Provisioning will see a Team Account there .
Or Manual Provisioning will select the provisioning file directly .

Managing (release) and (product) provisioning profiles and certificates

This is my first time cloning a repo for a project that is on the store and using apns (not my app).
In Github I cloned the repo using the clone to Xcode option and it's in my local directory. Naturally they have a team of devs and certificates and company profile already set up.
When I open the Xcode project the signing (Debug) (Release) (Product) Provisioning Profiles in Xcode are red.
I cannot just use my own Apple ID Team profile right? So do I need to ask them for their keys or certs so I can copy them to the local cloned project directory?
The app uses apns. When I test and run the app how do I have authorization to run that app on my device? Do they also need my device ID?
You need to get the certificate along with key exported in .p12 format from the person who has created it or you should log in to their developer account and create a new certificate and using that certificate create new provisioning profile.
To run the app in your device, that device must be added in the device list and should be included in the provisioning profile.
There is automatic signing in option available using the personal developer account, using that xcode itself create certificate, but since you are using APNS i don't think that can be used.
If they are using automatic code signing, and having you work on the project, you should request them to invite you to their team. Give them your Apple ID email address and they can add you as a team member. Then, when you build, Xcode will automatically generate a new Development certificate and provisioning profile, complete with all the app IDs, entitlements, etc. that you need.
Depending on the role they gave you, you will likely only be able codesign the app for development, not distribution. Team members can generate code signing identities for iOS Development, meaning installation and running on test devices that have their device IDs added to the development profile. Team members cannot generate or request certs or profiles for iOS Distribution (for submitting to the app store or TestFlight). Devs with the team admin role can generate or download the iOS Distribution cert and profiles. IF you are not going to be the one submitting to the store, this shouldn't be a problem.

PhoneGap Build and OneSignal - Ios Certificates and Provisioning profiles

I have used OneSignals Provisonator to generate a .p12 and .cer file.
The problem comes when I have to upload the certificate to PhoneGap build, because PhoneGap Build also wants a Provisioning Profile.
On the Apple Developer website, I create a provisioning profile but I do not see the certificate created by the provisonator.
I have no idea how to create it using the certificate created previously. Also because the Provisonator does not give me a .csr file :(
Any help...PLEASEEEE!!
OneSignal's Provisionator is used to generate a certificate for push notifications, not for code signing apps. You need separate code signing certificate for development and distribution. You cannot set up a provisioning profile with an APNS (Apple Push Notification Service) certificate.
If you look in the Phonegap documentation, it will explain how to set up your code signing.

Run on device from xcode after making archive

I have a project in Xcode 4.5.2. I was able to run the project to a device from Xcode until I built an ad-hoc version with the "archive" function. (After changing the code signing).
Now, when the device is plugged in I get the error "CodeSign error: code signing is required for product type 'Application' in SDK 'iOS 6.0'".
I have checked which profiles are selected under "Code Signing" in build settings, trying both the generic "*" profile, and the profile I used to build the ad-hoc release (For both debug and release builds).
What confuses me is I can build the project and install it to the device through ITunes without issue. It seems it's now running the 'release' version and not the 'debug' version when building with a device connected now. The device is in the provision profile however, so shouldn't it work either way?
I've tried
Restarting xcode,
Deleting the derived data (From finder, not through the organizer),
Deleting and reinstalling the provision profile.
Any help would be appreciated!
When you create your provisioning profile, make sure its a Distribution profile with your devices UDID on it.
I use a site called www.testflightapp.com, which will also help automate this process for you. Hope that helps

Resources