Resetting a Device in Xcode Organizer - xcode

I've made many mistakes in the process of adding a device to the organizer to deploy to it.
I want to completely start over, but every time I delete the device, unplug it from my computer, and re-add it, it already recognizes it, meaning the "Use for development" option is unavailable, and the error "Xcode cannot find the software image to install this version" always pops up.
How do I just start from scratch??
Any suggestions will be greatly appreciated. Thanks.
And this is very urgent, thanks!
UPDATE:: Have these errors constantly pop up -
Provisioning Profiles - VAlid Signing identity not found
2.Unable to codesign using identities in this team: no provate keys available
3.Software version - XCode cannot find the software image to install this version (5.1.1 (9B206) )

I figured it out.
You can start from scratch by going to "Keychain Access." Go to passwords, and delete your appleID. Then, it will prompt you for your apple ID again.
To resolve the specified issues, you need a development certificate, which will automatically be requested only if you login using your account. Then the administrator will log in to his account and approve your request. Once the certificate is created, it will still not work.
You need to download both the certificate to add to your certificates in keychains, and also the provisioning profile.

Related

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.

Xcode apple developer certificate expiration: (0xE8008018)

Just for the record: I had a stranger response from Xcode when I tried to run my app on my device.
Please verify that your device's clock is properly set, and that your
signing certificate is not expired. (0xE8008018).
My certificate expires today at midnight AND my several provisioning profiles need a serious cleaning.
What is the administrative process to get it all renewed to get a build AND run working?
You need to :
Connect to Apple Developer Member Center
Click on 'Certificates, Identifiers & Profiles'
iOS Apps must not have an expiration date notification or else
renew it, and come back here
Click on 'Provisioning profiles'
If no one has 'active' status, that is the problem
Add one for 'iOS App Development'
Choose the right 'App ID' : your BundleID, or wildcard
The next screen should show you valid certificates. If not, go create one (click on 'Certificates' item on the left menu) and come back here
Choose one certificate
Then you see all the devices you declared in 'Devices', select those on which you want to run your app
Give a profile name and generate it
You will download a file named : [profile name].mobileprovision
Double-click to install it
At this step, my problem was solved. Build and run on my phone is ok.
I had the same exact thing only... all my profiles, certificates and everything were up-to-date in the Dev portal. What fixed it for me was under the General tab of my app's target, changing the 'Team' dropdown to none... and then back to my company. Forced Xcode to re-request whatever it thought it needed from the Dev Portal.
Back in business... :-)
Or go to your Utilities/Keychain and delete all the certs there. Run from Xcode and it will sort it all out for you.
If you work in a group and suffer this problem, but your colleagues do not, you may ask somebody to export the developer profile as described in https://developer.apple.com/library/ios/recipes/xcode_help-accounts_preferences/articles/export_signing_assets.html
Then import the .developerprofile file.
Worked like a charm for me.
Hi All Just delete the developer certificate and install it again.delete the account fomr xcode preferences and add it again.
Works for me
Restarting XCode made XCode solve the problem for me showing this prompt:
Just pressed "Fix Issue" and it worked.
Delete all expired certificates from Keychain rest xcode will handle.

xcode organizer refreshing provisioning profiles

I have had a look around and everyone seems to be having loads of different issues with the xcode organizer, but they don't seem to be having the same issue so I can't quite isolate my issue.
The issue I am having is when I go to the organizer and refresh the provisioning profiles it produces a message saying
Sign in with your Apple ID
the username and password I provide are both correct but the window goes away and then immediately returns and doesn't say whether or not I enter correct details (I know they are correct) and it will continue asking me this for as long as it takes to refresh the profiles. This also happens when I select a device to use for development, but the device is never actually added to the team provisioning profile even though it says it has been.
Has anyone any idea how I can stop this?
I guess in your position I would carry out the following checks:
Can you log in to your account on the Provisioning Profile. If
you can then your Apple ID and password must be OK
When in Xcode and responding to the 'sign in' message are you
using the username & password remembered by KeyChain? Are you sure
these are both OK? Maybe enter them manually again to make sure
In Xcode go to the Provisioning Profiles screen in the Organiser
tab and right-click a profile and select 'reveal in Finder'. Does
the folder holding your local copies of provisioning profiles
contain any extra files that might be old/corrupted versions? If so,
delete them, return to Xcode and attempt to refresh again.
If the above three checks don't yield anything useful then I
think it must be something corrupted on the provisioning profile
(such as a provisioning profile or certificate) that needs to be
revoked - letting Xcode create it/them anew for you. Or something
out-of-date or corrupted locally (maybe a public or private key or
certificate in KeychainAccess - a local copy of a provisioning
profile). And you may have to start revoking/deleting digital assets
to get things working again (but only do this if you have no other
choices...)
I once had a horrible issue with an iPhone developer certificate that took ages to fix - but perseverance eventually paid off - good luck!

Permission Denied when running Mac app after upgrading to XCode 4.4

I had a working Mac application until I updated to XCode 4.4 and Mountain Lion. Now the application still compiles, but when I try to run it I get an error message.
error: failed to launch '/Users/username/James/mac/Browser/trunk/Browser/DerivedData/Browser/Build/Products/Debug/Browser.app/Contents/MacOS/Browser' -- Permission denied*
Can anybody explain why I might be getting this?
I found this on an iPhone 5 (iOS 6.0) newly set up for development. I had to manually launch the app on the phone, and it said "Are you sure you want to launch this app signed by this devloper?" Once I approved that, the "permission denied" went away and it now launches from Xcode.
Unlock the Device
Try simply unlocking your device before running on it. I was stumped by this very same issue. Upon building and running with no changes to OS, environment, code, etc., I was receiving the error.
Similar questions have been asked here and here, but were not helpful in this situation.
This is caused by an entitlement (and, presumably, having the wrong kind of certificate for it).
If you have the sandbox enabled, and try to sign with a Developer ID certificate, your application will crash on launch (as of Lion—I haven't tried this on Mountain Lion).
If you have iCloud enabled, and try to sign with a Developer ID certificate, your application will not launch at all—in Xcode, you'll get the error message in the question, and in Finder, the application will launch ever so briefly and then get SIGKILLed.
Presumably, there is a right kind of certificate with which one can sign an app in order to be able to test with a sandbox and maybe even iCloud that you can obtain if you have a Mac Developer Program membership. A Developer ID certificate is not that kind of cert.
(That solves my problem, anyway. Dennis, what kind of cert were you trying to sign with?)
Open the organizer and make sure you're mac is in developer mode.
Also check your gatekeeper settings.
The device is seeing the app as an "unauthorized app downloaded from the web" for lack of a better description. Go into Settings > Security & Privacy, and at the bottom, allow applications downloaded from Anywhere.
Throwing a few thoughts on the wall:
Are you perhaps building on an external disk? Some drives get special permissions (like the "ignore permissions" checkbox), or maybe have ACLs set in a weird way. Tried building on internal startup disk?
Are you code signing? Have you tried just turning that off, to see if there's a bug in code signing or entitlements? Not the first time a new codesign tool has a bug.
Have you tried using xcode-select and updating any command line tools that are installed to make sure they all match the version of Xcode used?
Do you have any shell script build phases or the likes that might be editing the application after it's been signed, thus breaking the signature?
Have you checked if your hard disk is full or there's a (broken?) symlink somewhere in a path, or a volume name that has been unmounted?
i am sure this is long been figured out, but I have been getting the Permission denied and it turned out I had to add my laptop to the provisioning profile. I had recently reimaged my machine and in doing so the provisioning profile was no longer valid for that machine. It worked fine until i enabled iCloud. That's when the permission denied started.
Check the organizer in XCODE, click on the devices tab and click on your machine on the left. Check to see that the UDID it shows is listed in the devices section in your mac developer portal.
The short answer is when you get this error message, there is no valid development provisioning profile in the built application.
That alone won't solve your problem! There are a number of common causes of this:
You've moved to a new machine and haven't installed the provisioning profile in Xcode. Also see below
You've moved to a new machine and it's not in developer mode OR not added to the provisioning profile
For both of these, let Xcode regenerate it, or do it yourself in the Member centre... You can validate the causes is something to do with your provisioning profile by running Console and filtering on taskgated where you can see which provisioning profile it is trying to use (it will pull the one embedded in the application first, then try to pull from any installed on the Mac).
Make sure you check in your build settings that the right one is being used for Debug builds. Simple steps that normally resolve (XCode 5)
Go to member centre and create a new development profile
Select the app and certificate
Validate that the machine you are using is in the list of machines to be included in the profile, tick the box
Generate the certificate
Download it, and drag it over the Xcode icon in the doc
Go to the Build Settings tab in your target and set the provisioning profile to the one you've just downloaded
You haven't configured your iCloud/APN/GameCenter entitlements correctly.

no valid keychain for xcode

after 6 month of break I try to finish my first app.
After I downloaded the new XCode and the new SDK (I needed it, because old XCode and SDK was 4.3, my iPhone was on 5.0.1) I try to build, but it told me my signiture was to old.
So I cleared all things I have found in my keychain: certificates, keys and so on.
I remember that it is a really really mess, but I tried the last 5 hours withour writing a single line of code...
At the moment I created a new certificate in the Apple Online Portal.
I downloaded and double click it, so it's in the Organizer now.
The error from XCode when try to start on my device is now:
There are no valid certificate/private key pairs in the default keychain
Can someone help me? (Skype would be nice), I am really lost in this after 5 ours of triend all I found on google and get very very lost.
When you are installing certificates first time you will have to install "Apple Worldwide Developer Relations Certification Authority".
Check whether it is available in the system tab of keychain access.
If you double click the certificate and provide password, it may be possible that it gets added to system tab. So make sure it is added to the login tab.You can just drag and drop the certificate from system to login.
In xcode organiser window you should see the provisioning profiles. If you don't see your profile there install the profile double clicking it. Also check profiles' expiry date.!
Hope this Helps!

Resources