Does Xcode require me to move Keychain contents to my new Mac? - xcode

I am moving to a new Mac for the first time since I published my App to the App Store.
I have noticed there are things inside Keychain of kind "certificate" and "private key" called "Apple Development: xxx" "iPhone Developer: xxx", "iOS Developer: xxx", "Developer ID Certification Authority" etc.
What are these and do I need to move them to my new Mac?
Or will the Xcode regenerate all of this?
Also, do I need to move anything else (from the Keychain or elsewhere) to my new Mac in order to be able to continue the development of my apps and be able to upload the updates to the App Store?
Any help would be much appreciated!

Related

Xamarin and Choosing Provisioning Profile for Distribution via Mac App Store

I'm trying to upload a mac app to the Mac App Store. I have done
this successfully with an iOS app, but this is the first time with
a mac app.
I have an Apple Distribution Certificate:
plus a Provisioning Profile for the Mac App Store which used the above cert:
The Cert is installed on my machine (downloaded it, double clicked). I can see it
in Keychain Access.
I now want to upload the Mac App to the AppStore.
Per this document, I need to set the developer ID and provisioning profile for the application and installer package.
So in Visual Studio 2019, I open preferences and head to "Apple Developer Accounts", select my dev account, my apple ID, and click "View Details". I see my certificates there, plus my Provisioning Profile "XXXX Mac App Store Provisioning Profile" (per the above diagram). Note that I have previously clicked "Download All Profiles" to get this profile installed locally.
I now open options for the Mac App project itself, select "Mac Signing".
Here's where things get weird:
a) The identities are correct. So I select the correct Developer ID.
b) the provisioning profiles are not correct. In fact it contains 2 old
entries, and 1 entry I have not heard of. It does not show any of the
provisioning profiles from the "VS | Preferences | Apple Developer Accounts".
c) It does show my "Developer ID Installer" cert for the installer.
Since I can't select any of my profiles, I select:
Identity: My Developer ID
Provisioning Profile: Automatic
Installer Package Identity: my "Developer ID Installer" cert.
I rebuild, "Archive For Publishing", and then attempt "Sign and Distribute".
I select "App Store" and get "No valid Provisioning Profile found"
What am I missing here? VS can see my profiles and certs.
But in the specific Mac project, those profiles do not show up, only some
old cruft.
I'd appreciate any advice. Thx.
Paul.
My comment above resolved the issue:
Apple Distribution certificate (which is SUPPOSED to be for MacOS,
tvOS and iOS) doesn't work in Xamarin for Mac apps. However if I used
Mac App Distribution certificate, and create a Mac App Store
Provisioning Profile using that Mac App Distribution certificate -
they both show up in the App Options | Signing. WTH?
Bottom line is that you need to use Mac App Distribution certs, not Apple Distribution certs.

Provisioning profile doesn't include signing certificate "Apple Development: xxxxx"

Few days before I got my active apple developer account after paid $99. This is the first time I'm trying to release my ios game app in app store.
I'm trying to release my Unity IOS game to the app store using xcode. But I'm facing error (Provisioning profile doesn't include signing certificate "Apple Development: xxxxx") in my xcode (version 13.3.1). Please check image https://prnt.sc/Hl66jVBnWYvP
I added my apple developer account & after that added provisional profile in xcode. After that I installed the distribution certificate in the keychain but no luck. Please check image https://prnt.sc/TIzXQwdbYKde
I found another issue, when I click "Download Profile" from xcode it pops up a "Provisioning Profile" window. In that window the right side shows a cross warning "Doesn't include sign certificate Apple development: Sxxxxxxxxx (xxxxxxxxx9)" Please check image https://prnt.sc/mXx3kz8X1dQu
At last, to solve this Provisioning profile problem I follow all the below steps but no luck -
Restart computer (macOS Monterey).
Restart xcode
Removed all Certificate from keychain
Re-download the distribution profile (double tap to install to Xcode)
Create new ios distribution profile (double tap to install to Xcode)
Re-download the Development certificate (double tap to install to Keychain)
Bundle id rechecked & it's matched everywhere.
Any one can help me to solve this?
Any solution?
Thanks

How do I fix "Missing Private Key" for xcode apple provisioning?

On a new mac, I installed xcode and needed to set up provisioning for a hello-world project to deploy to my iPad.
NOTE: I am using the new FREE provisioning (do not have a paid Apple account)
I went to Preferences/Account signed in to my Apple account
In the project, General tab, Team is set to my (free) Apple Dev account. (all seemed well, it recognized this as valid)
I tried to deploy to the iPad and I got a build error "codesign failed with exit code 1"
Supposedly this is to do with certificates. I went to Keychain Access and found "iPhone Developer: my#email.com (...)" in there, which was added when I signed in via my Apple Account.
I DELETED this key (thinking I would simply re-add my Apple Account and thus this key)
I then removed and re-added my Apple account from xcode preferences
I can sign-in, I can see it adds keys, and Keychain Access Get Info on the keys indicates no issues (valid, etc)
In xcode Preferences, when I click Manage Certificates, it shows "David's MacBook Pro (2)" and a bunch of "Untitled" keys ALL of which have a status of "Missing Private Key".
xcode/General/Status section says "The username or passphrase you entered is not correct" even though my "Team" is signed in and valid
Clicking "Try Again" shows "Waiting to repair", followed by "revoking...", followed by "Generating certificates" - which sounds promising, like it's doing exactly what I need, but then fails, private keys still missing, and back to step 9 here in a loop of hell.
ok? How do I get this resolved without flattening my OS back to factory and starting completely over?
Note: there are resolutions on SO that talk about Revoking the keys and generating new private keys from the Dev Console, like this one:
How can I add private key to the distribution certificate?
HOWEVER, on a "free" account I have NO access to the Certificates section! I can't manage anything from the Dev portal online. I do, however, see xcode specifically set up to handle certs (see step 9-10 above) but it is not working. I really don't know where to go from here. I'm new to all things Mac and iOS and xcode. Frustrated. Thanks Apple, so much for a simple on-boarding experience on a simple hello-world app.
After two bounties for this question which gave no results, I managed to find a solution to this problem.
Apparently, it was some keychain related problem.
To fix it:
Open Keychain Access on your Mac.
Right click on the "login" keychain in the left side of the window.
Press Lock keychain "login".
Then do the same to Unlock it.
Go back to Xcode and try to set your app to run with your personal account.
Solution was found using the first comment here:
https://github.com/desktop/desktop/issues/3625
I had this error and it occurred because I had moved to a new Macbook. Although there was a provisioning profile on our Apple account and it was not expired, the private key was on the old Macbook. So downloading and installing the profile did not help, as it was the private key that was missing. I revoked the provisioning profile and created a new one. I had the same issue for the distribution certificate.
If you are concerned whether revoking and creating new certificates/profiles will affect existing deployed applications, take a look at this question and the answers. The bottom line is, for applications on the app store it will have no affect, but for Enterprise Distributions, deployed applications will stop working if you revoke the provisioning profile. So if the application is on an Enterprise Account, then it is best to try find the private key in the keychain of the Macbook where it was created.

Correct certificate for signing application with WineBottler

I use WineBottler to convert a Windows program I wrote, Mineways, for use on the Mac. This process works fine, except that the application is unsigned and so runs afoul of OS X's new tightening of Gatekeeper, which scares off users. I have not been able to figure out how to get the proper "Mac Developer:" certificate as an Apple developer.
Winebottler has the ability to sign applications made with it, see this page. All I need to do is get a "Mac Developer" certificate. I registered as an Apple developer, paying my $99. However, I can't figure out how to get this particular certificate it wants me to provide. I was able to get a "Developer ID Application:" certificate, but that's evidently not the same thing. The "Mac Developer:" certificate looks to be something I need to get from Xcode, but I'm not using Xcode to build my application, I'm using WineBottler to make a Windows program run on Mac.
There is some other terse documentation at the WineBottler site, linking to pages on Apple's site about bundles and Gatekeeper, but it is of little help to me, a simple Windows programmer. The author of WineBottler has not responded to my emails asking for clarification. My goal is an exact explanation of what I need to do to get a "Mac Developer:" certificate for use with my Windows program in Winebottler.
My efforts so far are further documented here.
Here is one way to create and find the Codesigning ID with Xcode 7.3:
Start the program XCode
From the Xcode Menu select "Preferences"
Select the tab "Accounts"
From Apple IDs, select you Apple ID
From "Team" select "GIVENNAME SURNAME (Personal Team)"
Click "View Details..."
In the new Panel click "Create" to the right of "Mac Development"
Click "Done"
Start the program Keychain Access
select "login" from "Keychains"
select "Certificates" from "Category"
Look for a Certificate named Mac Developer: YOURAPPLEID (XXXXXXXXXX) or Mac Developer: GIVENNAME SURNAME (XXXXXXXXXX) => this is your signing identity you can use to sign your apps.
Note the exact name of the ID: Mac Developer: YOURAPPLEID (XXXXXXXXXX) and enter that name in WineBottlers "Codesign Identity" field.
To my knowledge you can create this signing identity without paying the $99 - at least it is still noted as "Free" in Xcode.
Hope that helps
Mike
Sidenote:
Codesigning is and was changing with nearly every release of OS X / macOS since it was required by Gatekeeper. It is being checked and tested as of this writing for the next 1.8.x Release of WineBottler especially for macOS Sierra.

XCode: New Mac, new developer cert, duplicate keeps reapearing

So: I got a new Mac. I went to the developer provisioning portal, then revoked my certificate. I created a new one.
Now whenever I open XCode it complains that I have duplicate developer certificates. And yes, when I check with Keychain, there are two. I then delete the oldest one, but XCode is apparently very much in love with the old one: It keeps recreating it.
What to do?
Answer here:
Xcode could not find a valid private certificate/valid key-pair for this profile in your keychain
Short version: Delete all certificates from your keychain. Delete all provisioning from XCode via the Organizer. Request and generate new certificates in the iOS provisioning portal. Download the new provisions and import them into XCode by doubleclicking. FInally, go to your project and make sure that the right signing is selected, just to make sure.

Resources