Cannot "save for Enterprise Deployment", ios ipa - xcode

I've developed a ionic 2 app which I want to be able to send through mail or host online somewhere as an iOS app for ipad - so I need to make it ipa.
I've got an Apple Developer Enterprise Program account type, and XCode 8.2.1. I've managed to archive the app with success but when I'm trying to export it I cannot use any method except "Save for Development Deployment" which indeed generates an ipa file, but when I try to install it on ipad disappear - the installation starts, works for a half then just disappear.
When I try to "Save for Enterprise Deployment", I choose my team an then it gives me this:
I've download and install every certificate available from my developer account but with no luck.
Am I doing something wrong?
P.S. I've host the app with diawi and when I try to install it from there it gives me his error: Cannot download the app - "Myapp" cannot be installed > OK or Retry

Provisionning Profile needs > Certificate needs > Signning Identity
(Certificate Signing Request CSR)
The signning identity used to create the certificate is not on your machine.
Two solutions:
Export the developer profile from the machine that have the signning identity then import it to your machine.
OR
Create a new provisionning profile:
Create a CSR from your machine.
Create a certificate on the apple member center and upload the CSR.
Create provisionning profile and select the new certificate.
Note: When you create a certificate on apple member center you will be instructed how to create a CSR.

Related

Unable to test Flutter app on iPhone due to certificate issue

I built a Flutter app using Android Studio. Works fine on iPhone simulator.
When I go to test on my iPhone however by opening up workspace on Xcode and running it with my iPhone connected to my laptop, I get this error:
The certificate used to sign "Runner" has either expired or has been revoked. An updated certificate is required to sign and install the application.
I'm at a loss at what to do here. I am using a free apple developer account.
Any help appreciated!
You need a new certificate (development certificate) installed on your mac's keychain.
First go to the the apple developer console, then Certificates, Identifiers & Profiles => Certificates => Add Certificate (Plus Button) => Apple Developer Certificate.
In order to generate a new certificate you will need to export a new certificate request from your Mac's Keychain Assistant, in order to be able to sign new applications.
To do this: Go to the Keychain Assistant App => Keychain Access => Certificate Assistant => Request a Certificate from a Certificate Authority.
Go through the steps to generate this new certificate request and Save it to your Desktop.
Go back to your Browser, where you are trying to create a developer certificate through the Apple Portal, and upload the generated Certificate Request file.
A new certificate will be created, then download this certificate, and click on the downloaded file, and your MacOS (Depending on any Security Policy) will ask you to type your password to add the new certificate to your keychain.
This certificate will now be used by your Mac to sign all developer applications.
Please note that for production, you will also need another certificate (depending on whether you are uploading to the App Store or distributing via AdHoc).
Once you've done all this, go to the App's Provisioning profile on your Mac Account (via your Browser), then select your provisioning profile of your app, then click Edit. There should be a certificates section, please choose all of them to sign your app.
After this is all done, go to Xcode, then Manually download the provisioning profiles to your device => Clean => Rebuild => Deploy via Flutter. Please also make sure to remove any revoked (expired) certificates from your keychain (to clean up the memory bank).

How to properly sign a Mac application for self-distribution?

I created a Mac file upload client application that implements a high-performance reliable data transfer over UDP protocol, based on the UDT library.
My setup:
MacOS Mojave
Xcode 10.3
Deployment Target: 10.10 (minimum for storyboard-based forms)
Now I'm trying to figure out how to sign it properly so end users can run it without doing a Gatekeeper override.
Here's where I'm at:
I have a paid Apple Developer account, delegated to me from an organization paid Developer account
I have roles assigned to me allowing me to manage apps, certificates, provisioning, etc.
I am signed into this account under Xcode accounts under Preferences.
I have created a bundle registration under the account, copied exactly from Xcode
I have created a Mac Distribution certificate, starting with a CSR from my development machine.
I have downloaded and imported the certificate into my machine's keychain (listed as "3rd Party Mac Developer Application:...")
I have created a provisioning profile for this app, with above certificate assigned, the profile type is App Store, but I will be distributing the app myself (is there a more correct provisioning type?)
Under Entitlements I chose "Custom Network Protocol", which sounds like an accurate description of my application.
I have imported the provisioning profile into Xcode and chose it under Signing (Debug) and Signing (Release) of my project's target, it automatically populated Team (the parent organization) and the above certificate.
I changed the scheme in the project to "Release" and built it for "Running", I get a keychain access prompt during build, and signing step completes successfully
codesign -vvv -d xyz.app returns the registered bundle, certificate, team, etc, all matching the above choices.
I placed the produced .app into a .dmg image and emailed it to myself
I downloaded the .dmg on another Mac and mounted it
I tried running the .app but got the following Gatekeeper message:
"XYZ" can't be opened because it is from an unindentified developer.
Your security preferences allow installation of only apps from the App Store and identified developers.
How do I get around this so a downloaded application will have an "Open" button in the Gatekeeper prompt by default. Some applications, GIMP for example, are correctly identified, even though they did not originate from the App Store.
What do I need to to resolve this?
I kept digging at it and I found my answer:
https://developer.apple.com/documentation/xcode/notarizing_macos_software_before_distribution?language=objc
The type if certificate I needed was Developer ID and the type of provision Developer ID Application, which is what is intended for self-distribution of a signed Mac application.
After that it needs to be submitted to Apple for notarization to satisfy the requirement for 10.14.5+. After notarization had completed I was able to send the exported app to myself and it offered me an "Open" option for the app downloaded from Internet. This is the desired behavior.
It required me to request the account holder to issue me the Developer ID certificate by sending them a CSR, as Developer ID certificate option is greyed out for delegated users that are not the original developer account holder (admin role may satisfy, but I am not one so can't say).
Yay.

macOS App manually signing with provisioning profile for App Store got error Code signature invalid

I try to use manual signing in macOS using provisioning profile. But everytime I try to run it will crash with error
EXC_CRASH (Code Signature Invalid)
If I try to use automatically manage signing or manually manage signing but without provisioning profile it works fine. What is wrong with my provisioning profile? I need to use manual manage signing because my app actually is Xamarin.mac which is not possible in VS for Mac to sign automatically or sign manually without provisioning profile. I am not using weird entitlement. I only need app sandbox to release app store so in my provisioning profile I don't add any capabilities
If your signature is invalid it is likely that you haven't created the correct type of certificate. There are several certificate types that can be instanced and your app will not build correctly if you have created the wrong certificate type.
Common certificate types include:
iOS development
iOS distribution
Mac app development
Mac app distribution
Mac installer distribution
Developer ID application
Developer ID installer
For more information about manually creating your certificate, see my answer to this question: macOS installer certificate evaluation error in Keychain: Invalid Extended Key Usage
Also note that during development you would use an iOS development certificate, but for uploading to the App Store via iTunes connect, you will need an iOS distribution certificate and it needs to be enabled on an Apple ID that has paid for iOS distribution. For more information on enrollment to the Apple developer program, which will enable you with privileges to get a valid distribution certificate see here: https://developer.apple.com/support/enrollment/
If you are sure that it is not a problem with the certificate itself, do note that there other parameters involved when creating a provisioning profile manually - it's not just a certificate + private key. This is a profile that needs to be created in the Apple developer portal, but as long as you have a valid Apple ID to use for creating the provisioning profile it shouldn't be difficult. There are detailed instructions here: https://learn.microsoft.com/en-us/xamarin/ios/get-started/installation/device-provisioning/manual-provisioning but allow me to paraphrase:
1) Go to the Apple Developers Member Center (https://developer.apple.com/membercenter/index.action), and under the section Certificates, Identifiers & Profiles select "Provisioning Profiles".
2) Click the + button, in the top right corner to create a new profile.
3) From the Development section, select the radio button next to iOS App Development, and press Continue:
4) From the dropdown menu, select the App ID that to use
5) Select the Certificate(s) to include in the provisioning profile, and press Continue
6) Select all the devices that the app will be installed on, this will be all the devices and computers that belong to your Apple ID that will get a distribution certificate installed on it.
7) Provide the Provisioning Profile with an identifiable a name, and press Continue to create the profile
8) Press "Download" to download the provisioning profile onto a Mac
9) Double-click on the file to install the provisioning profile in Xcode. Note that Xcode might not show any visual clues that it has installed the profile except for opening. This can be verified by browsing to Xcode > Preferences > Accounts. Select your Apple ID and click "View Details..." Your new provisioning profile should be listed, as illustrated below:
After the provisioning profile has been successfully created it may be necessary to restart Xcode so that all the development certificates are correctly loaded and available for use.
Checklist:
Is my code signing certificate the correct type
Was my provisioning profile properly registered in the Apple Developer portal (https://developer.apple.com) for the Apple ID that is used on the machine building the app
Is my Apple ID correctly enrolled in the Apple Developer program with no outstanding fees to be paid, or licenses like EULA to accept.
Have I downloaded my provisioning profile from my Apple Developer portal and correctly installed it on my machine that is trying to build / release the app.
NOTE:
In order to distribute apps to the app store there is no choice but to create and pay for the provisioning profile within the developer portal, and install it on your machine by downloading it from Apple.
Best of luck!

Cannot import certificate into keychain

I am trying to deploy an iOS app to a device. There are two members in my team with developer enrollments.
My team member created a certificate from another mac and exported it. I then imported the certificate into my keychain app. The keychain app is showing the certificate but in Xcode organizer when I refresh from my own developer account xcode says Valid signing identity not found
Xcode version : 4.6.3
check these steps:
export p.12 file from certificate in first mac.
set password to file. (iv'e sometimes seen issues raised when password is not set)
open p.12 file in second mac.
type in password.
download and open appropriate provision file.
Did you try import from another mac and export team in organizer? I had such problems before but i can't remember truely. Your team is valid with green mark in Teams section in organizer?

"Profile" is a valid identity. However, you do not have the associated package identity. Developer profile from a different mac can be imported

I am trying to submit my mac app to mac app store. Bust I'm unable to code sign the build properly.
I have create a distribution certificate in Develop Certificate utility and also I have created a production profile.
I have imported the certificate in my keychain properly with the private key. Also The provision profile is imported successfully in Organizer -> Window.
But When I Archive the project, and validate the iPA to mac app store, I'm getting the error:
**** "Profile" is a valid identity. However, the private key for the associated package identity "Profile" is not installed on this Mac
Some more details about project:
I'm using an external framework and open source project in my project named XMLRPC.
I have set "Skip Install" property of the project to YES.
This is not code sign.
Can you please let me know what is going wrong?
You are missing the installer certificate. You need both the distribution certificate to sign your app and the installer certificate to sign the package installer on submitting to the Mac App Store. Xcode finds the key automatically based on the name of code signing identity, the name is the same but with "Installer" append.
To fix the issue log into the Certificate section of Apple developer. Request a new certificate via the plus button and choose the Mac App Store installer type. Follow the steps to submit a CSR request and then simply download the certificate and drag it over to your keychain.
I got the same warning even though I had the right profiles and code signing identities.
“Profile” is a valid identity. However, you do not have the associated package identity.
I refreshed my code signing identities in Xcode and relaunched Xcode. The warning disappeared afterwards.

Resources