Got new iPhone, can't add as a device to develop on - iphone

When I plug my iPhone 5 in, Xcode recognizes it, but when I build my code and try to run it on my phone, I get this error:
A valid provisioning profile for this executable was not found.
So I go to the organizer, click the phone under Devices and click Add to Portal, but I get this error:
A device with number '...' already exists on this team.
What am I doing wrong?

You added it to the portal but did you add that device into your provisioning profile for your app as well? I would check to make sure that the device is actually listed in the prov profile and that you've downloaded & installed it. I'd also kill the previous copy of the prov profile out of Organizer. Also, sometimes XCode goes brain dead with device additions and will need a restart.

Had exactly the same problem earlier today.
Firstly check that you have a valid key pair for the provisioning profile you're trying to use.
Then reissue your certificate using a new certificate generation request. Create a new provisioning profile using your new key pair and set that manually rather than using the organiser in XCode.

Related

Do you have to re-archive your project after adding devices to the provisioning profile?

Say you have an existing provisioning profile with some devices and you archive a target with that provisioning profile. Then, you go into Member Center and add some more devices to the profile. Do you have to re-download/re-archive the project in order for those devices to install the target app?
No, as long as the name of the profile is the same, you can now distribute apps that include it to the new devices, as long as the new devices get the provisioning profile that includes their device ID.
Edit: A note of further explanation. Your archived app does not store the provisioning profile in its archive. You merely tell it what provisioning profile to look for in order to determine if it can run on a certain device. Therefore you can change your provisioning profiles all you want, and as long as it is the same profile the app is told to look for, you never have to recompile the app to recognize new devices.
Yes, if not - how can the previous profile know that you have added more devices to it ?
You have to delete the old profile in organizer and then you need to download freshly the same profile which is configured with new devices.
Note: don't forget to check the code signing in your project settings after installing the new profile.
(OR)
If you have already configured your iOS Developer Network profile in your system,
Just press the refresh button at the bottom right of your organizer
Yes the new profile will have to be built into your app for it to work with the devices added.
You have to download again the profile (or let XCode do the work for you).
You do not have to re-archive. Just share existing archive BUT sign-again with the new/updated profile.

cannot get app onto iphone to test

Im trying to test my first iphone app on a device. ive been through the walkthrough in the apple development portal that takes you through creating certificates, installing them and creating provisioner profile for the phone and installing it onto the phone. all was going well until i got to the end when it told me to select my device (that is connected to the mac) from the drop down menu in the top left of xcode then build and run the app. My device wasnt listed, i had two simulators and one that just said IOS device, i tried building to the 'IOS device' one and it built successfully but nothing was showing on the phone. So i tried googling the problem where someone suggested restarting, after i restarted i tried building again but got this error:
Code Sign error: The identity 'iPhone Distribution' doesn't match any valid certificate/private key pair in the default keychain
now i generated the everything from the same mac so i dont understand how the key pair doesnt match up. Help!?
I was getting the samething. Have a look on iOS provisioning portal page under provisioning profiles. You might have an out of date profile? If not open xcode and go to the organizer window under the window menu and look at your profiles. It could even be that you havn't added the device to the provisioning profile. sorry if im not making sense there are just alot of things to check.
iOS Provisioning Page

The executable was signed with invalid entitlements

So here we are yet again. I already have an app on the app store, that took me 2 days to get past all the errors and just get the thing on there.
Right now, I'm trying to put the 1.1 update on my brother's iPod Touch for testing. I pressed 'Use for development'. That's fine, works. Then i build and go, and it says 'The iPod “Dans Ipod touch” doesn’t have the provisioning profile with which the application was signed.' so i press Install And Run to install the provisioning profile, and then get 'The executable was signed with invalid entitlements'.
I'll be clear - all i want to do right now is to test the app on an iPod Touch, which is plugged into the computer. How do I get past this error and do that? I have what i thought was a valid provisioning profile selected in active target and active executable, but apparently that isn't enough. Any ideas?
Couple of easy things to try:
Do a Clean before building again.
Go to Xcode's Organizer and click on all the Profiles, checking they are valid. Xcode'll throw up warning text if say, something is missing in Keychain.
Make sure your profile contains your iPod device UDID. Make sure that the certificate with which the profile is signed is installed in your keychain. Also make sure the bundle id in your profile and app info.plist match.
Outdated provisioning profiles can often be a problem. Click on your Project and your Target and then individually check the provisioning profile for each code signing identity (Ad Hoc, Debug, Release etc.) by actually clicking on it. Note that it might look like the right profile, but when you click on it, it appears at the bottom of the list in 'others'. This usually means XCode is referring to an older profile. Make sure you now select the current, up-to-date profile from the list above. It is best to check ever Code Signing Identity individually just to make sure.
Once done, I recommend cleaning the project and deleting the app from your device before running it again.
Also, check your profile in Organiser and make sure it has a Green Tick (Valid Profile) and in the Provisioning Portal to ensure the required device is included in the profile.
Go to Window -> Organizer -> Devices
and then go to the connected device's Provisioning Profiles tab.
Note the name of the currently valid profile (must have a green tick icon).
Click the project then go to Project -> Build Settings -> Code Signing
Then copy the appropriate profile name into the Code Signing Identity field.
Clean the project
Then run the program on the device
In one case, to solve this issue, I also had to add the provisioning profile on the iphone's provisioning profiles, available only on this phone, from Organizer>Devices. It is strange, because this device is the only one that require that action. (Anyway I'm Newbie)

Adding devices to team provisioning profile

I need to add a device to my team provisioning profile, however I do not physically have the device so I can't hook it up to my computer so Xcode can't add the UDID to my devices and to the team provisioning profile. Is there a way to add it manually to the team provisioning profile, I can't figure out how to edit it. Also when I add the device in my provisioning portal it doesn't get added to my team provisioning profile automatically.
This worked for me:
Login to your iPhone provisioning portal through https://developer.apple.com
Add the UDID in devices
Go back to Xcode, open up the Organizer and select "Provisioning Profiles", ensure that "Automatic Device Provisioning" is checked on the top right pane, then click on the "Refresh" button, and magically all your devices set in the provisioning portal will be automatically added.
right click on the device, then select 'add device to provisioning profile'
For Xcode 6 it is a little different.
After adding the device UDID in the developer site (https://developer.apple.com/account/ios/device/deviceList.action), go back to Xcode.
Xcode -> Preferences -> Accounts
Select the Apple ID you added the device under and in the bottom right, click "View Details..."
Hit the refresh icon on the bottom left and then try to run the app again.
Per May 16th 2013, using XCode 4.6.2, I had to do the following to add a device (which I do not have physical access to) to the team provisioning profile:
Login to the provisioning portal through developer.apple.com
Add the UDID in Devices
Select the Team Provisioning profile in Provisioning Profiles
Click the Edit button
And under devices for that provisioning profile, click Select All, or just the devices you want included.
Click Generate
Then go back to XCode and click refresh icon (bottom right) under Organizer -> Devices -> Provisioning Profiles
Sometimes it takes a while before the certificate is updated and fetched from XCode.
Hope this helps new readers.
I faced multiple time the same issue that I add device info to portal so I can publish build to fabric testing but device is still missing due to how Xcode is not updating team provisioning profile.
So based on other answers and my own experience, the best and quickest way is to remove all Provisioning profiles manually by command line while automatic signing will download them again with updated devices.
If this can lead to some unknown issues I don't know and highly doubt, but it works for me just fine.
So just:
cd ~/Library/MobileDevice/Provisioning\ Profiles/
rm *
And try again...
Workaround for adding a device to an existing (automatically or manually created) provisioning profile (tested in Xcode 8.2.1):
Add the device in the developer portal.
Only when using a manually created profile: add the device to the profile.
In Xcode, go to Xcode > Preferences > "Accounts" tab > select your Apple ID (left pane) > double click on your Team Name.
Locate the existing provisioning profile. (automatically created profiles will begin with 'iOS Team Provisioning Profile' or 'XC iOS' or similar.
Right click on the profile.
Choose 'Move to Trash'.
The profile will disappear. A new profile with the same name might appear again, that is OK.
Xcode should now be aware of the newly added device.
Get the UDID from iTunes:
http://www.innerfence.com/howto/find-iphone-unique-device-identifier-udid
Once you have that:
Login to your iphone provisioning portal through developer.apple.com
Add the UDID in devices.
Add the device to the provisioning profile.
Download the profile again and enjoy.
There are two types of provisioning profiles.
development and
distribution
When app is live on app store then distribution profiles works and do not need any devices to be added.
Only development profiles need to add devices.In order to do so these are the steps-
Login to developer.apple.com member centre.
Go to Certificates, Identifiers & Profiles.
Get UDID of your device and add it in the devices.
Select a developer provisioning profile and edit it.
Click on check box next to the device you just added.
Generate and download the profile.
Double click on it to install it.
Connect your device and retry.
This worked for me hope it works for you.
Note that testers are no longer added via UUID in the new Apple TestFlight.
Test Flight builds now require an App Store Distribution Provisioning Profile. The portal does not allow UUIDs to be added to this type of provisioning profile.
Instead, add "Internal Testers" via iTunes Connect:
Internal testers are iTunes Connect users with the Admin or Technical role. They can be added in Users and Roles.
After adding a user, be sure to click on their name and flip the "Internal Tester" switch.
Then, go to App > Prerelease > Internal Testers and invite them to the build.
Login to your iPhone provisioning portal through developer.apple.com
Add the UDID in devices
Go to Provisioning Profile sections. Click on your provisioning profile, click on Edit.
In Device section select your added device and generate provisioning certificate again.
Download it and double click. It will automatically added in your Xcode.
To check UDID present in .ipa file or not. Generate .ipa file and upload on diawi.com, get diawi link and hit on Safari browser. You can check their how many UDID are integrated in generated .ipa.
After you've added the UDID to the devices in Provisioning Portal manually, you should trick Xcode into generating a new Team Provisioning Profile (with the newly added device included). Follow these steps:
Open Organizer > Devices > Library > Provisioning Profiles. Find the existing (old) profile (that does not include the newly added device). Delete it.
Connect one of your own devices. Right-click on it in Organizer > Devices > Devices. Choose 'Add Device to Provisioning Portal'.
This will trick Xcode into generating a new Team Provisioning Profile, which automatically includes devices you've added in Provisioning Portal.
If you have recently created new provisioning profiles, you will have to disconnect your phone, close XCode. Then open XCode, refresh your accounts then build and deploy at least once to your phone.
After adding UDID in developer.apple.com, do the following steps:
1, Go to Xcode, open Preferences (cmd + ,) -> Accounts -> Click your Apple ID -> View Details
2, In the new window, click on "Refresh", then "Request"
3, Now try to run your app on the new device, if you get an error saying "unfound provisioning profile", keep reading
4, Click on your project
6, Find "Fix It" button in Identity section, click it
7, Now try to run again, it should work
Update for Xcode (Version 9.1). Please follow below steps for refreshing Provisioning profiles
Using Xcode Organizer
Select Export
Select desired distribution facility
Now Select Automatically Manage Signing Identity
In next Screen Please click on Profile tag detail discloser button which will navigate you to Provisioning profile Folder
Select all profiles and trash them. Now in Xcode click on the Previous button and click again on Automatically Manage Signing, Now Xcode will create new signing identity for you with latest features (including new device id's)
In short, you can navigate to MobileDevice/Provisioning Profiles/ folder path and delete all profiles and then Archive. Now you can see there are new profiles for you. Cheers :)
#JasonH hope it will help you.
Now for Xcode 12.5
You need to create a new Apple Distribution Certificates
Go to Xcode Preference
Click Account, choose your Team you want to update
Click Manage Certificates
Click + Apple Distribution Certificates
Go to Keychain and delete the old certificate
This is what worked for me in XCode 7.3
Login to developer.apple.com
Add the device.
Head straight back to XCode (DO NOTHING) and create the .ipa
Install the build on the device, it will work.
I have no idea how this worked since I didn't download a new provisioning profile which included the newly added device, neither did I touch anything in XCode after adding the new device. That's Apple magic for you.
I will try to add an explanation to this if I find one.
As of Sept 2018, Apple seems to (or a bug) block the normal way to get your XS and XS Max's UDID. Even XCode could not properly register new phones for you.
After a couple hours of digging, I figure it out:
Connect your iPhone to your Mac.
Navigate to  -> About This Mac.
Click on System Report and select USB.
Click on iPhone, and copy the value next to the Serial Number label.
Copy and paste the value. You then need to add a – after the 8th digit.
This is the UDID for the iPhone XS and iPhone XS Max.
Source
All answers I've seen above assumed that the developer owns an iPhone. No one knows the right answer. As far as I know, you need:
a physical iPhone that you own
or UDID of someone else's iPhone.
But it is a must to have an iPhone before you publish your app. Correct me if I am wrong.
login to developer account of apple and open the provision profile that you have selected in settings and add the device . The device will automatically displayed if connected to PC.
Xcode 10.3
In finder navigate to: MobileDevice/Provisioning Profiles/
and delete all files there.
Then Archive and Automatically manage singing.
You are done!

Code Sign Error When Building iPhone Application

I am new to iPhone development. I just registered with Apple for the iPhone Developer Program. When I try to build, I am receiving an error:
Code Sign error: a valid provisioning profile matching the application’s identifier could not be found
I'm not sure what is wrong. I tried browsing the Internet but I get confused. Can anyone help me with what I should do?
At first it seems a complex process, but it's pretty straightforward when you've been through it a few times.
In a nutshell the process is this:
(I'm assuming you've set up your iPhone/iPod touch as a test device)
Via the iPhone Developer Portal
Create an App ID
(give your application a name, this is just for reference on the website and nothing to do with your own build of your application)
enter a string to identify it, like com.yourcompany.appname
(this is important and should be the same as in your .plist file inside Xcode)
Click and Save this
Go to Provisioning
There are 2 provisioning profiles you'll need
a) development - so you can install your application on a test device (i.e. your iPhone / iPod touch)
b) distribution - if you want to sell the application via the App Store
You can create the profiles by selecting your App ID, created in the previous step, from the drop down list and clicking Save
In a few moments (usually, though it can be longer) the certificate is available for download. Download this to your Mac and drop it onto the Xcode icon. Sometimes the development profile doesn't work for me like this and I drop it directly into the Organiser window in Xcode that shows my connected device.
Besides, if you are in a team account, team admin need to edit Development Provisioning Profiles, and add modify your certificates privilege.
In Xcode inside 'Edit Project Settings' you can select the certificate you wish to code sign with. Usually for debug I sign with the development certificate. Follow the instructions on the apple site and clone the release profile and call it something like release and sign this with your distribution profile. (You won't be able to load the app onto your phone with the distribution profile selected)
Make sure you select the target device as Device and not Simulator when building for the App Store!
Hope that helps, it's from memory so apologies if I've skipped some small steps.
xcode top left corner make sure you're running as "similator" "iphone"
Did you set up an iPhone provisioning profile for either development, ad hoc distribution, or app store distribution?
If not go to the iPhone developer program portal, which is linked from the developer.apple.com/iphone. Apple has provided a great series of video tutorials.
Just make sure you install the certificates or the profile won't be selectable in the project configuration. When you download the certificates double-click on them to install.
Possibly more use for others seeing this issue on a previously configured dev environment.
This error is also shown if your provisioning profile has expired, in this case you can go through the steps in Neosionnach's answer or you can go to Organizer, click on the profile and click Refresh.
This was the winner for me when I had this issue.
As of July 2012, you can go here:
https://developer.apple.com/ios/manage/overview/index.action
Then launch the "Development Provisioning Assistant." It walks through all the steps outlined by FiddleMeRagged.
You can use this process to create a Wildcard ID, if you're just looking to test your app on your iOS device and don't need to deploy to the App Store right away.