Deploying iOS app for development on multiple devices - ios

I'm working on developing an application for iPhone. I recently acquired a new development device, and would like to deploy the application to this device for testing, in addition to the device I have already been using.
When I try to deploy the application, I get an error saying that:
No matching provisioning profiles found: None of the valid provisioning profiles include the device "name of my device"
I have read the documentation on Apple's official developer portal, but it's unclear to me what I can re-use on this new device and what has to be created for it uniquely.
Can I use the same AppId? (I would hope so, since I can only have one app Id for a given Bundle ID)
I generated a new certificate request and named it something different. I also tried to add the new development device as a device allowed to use the provisioning profile I am already using in the application. Apparently, my code signing identity is still not found when trying to build on the new device. Any suggestions?

You have to add your new device identifier to the Provisioning Profile in the Development Portal. The process should be automated if you connect the device while Xcode is open, check out the Organizer for registration progress.

Delete old profile from xcode and download fresh copy of provisioning profile with new device identifier. Add this profile to xcode.
Go to Project -> Build settings-> Code Signing -> there select latest downloaded profile.
It will work

Related

Do I need an iPhone for TestFlight? [duplicate]

I have enrolled to Apple Developer Program to release my first app. My app's bundle ID is the same at developer.apple.com, at appstoreconnect.apple.com and in my XCode project. However, XCode still gives the error in "Signing & Capabilities" tab:
Failed to create provisioning profile.
There are no devices registered
in your account on the developer website. Plug in and select a device
to have Xcode register it.
And another error:
No profiles for ‘com.xxx.yyy’ were found
Xcode couldn't find any iOS
App Development provisioning profiles matching ‘com.xxx.yyy’.
First error message made me think that a physical connection to an iPhone is required to create a provisioning profile.
I have never connected a physical device to my Mac before. I made my tests by iOS simulator. I was planning to do my physical device testing via Testflight.
Do I have to physically (via a USB cable) connect an iPhone to my Mac in order to create a provisioning profile? If not, what might be wrong?
Is it required to have provisioning profile in XCode to be able to use Testflight or publish an app to App Store?
Do I have to physically (via a USB cable) connect an iPhone to my Mac in order to create a provisioning profile?
Yes, if you want to use automatic signing. An automatic provisioning profile unites a computer and a device and an app; it says that this computer is allowed to build this app onto this device. Until Xcode sees the device, it can’t create the profile.
The alternative is to switch to manual signing. It’s more work but now you can generate the profiles yourself.
You do NOT need a physical iOS device (iPhone or similar) to upload an app to App Store! Whether for real or TestFlight.
I realize this qn is old now, but I'm writing this for people like me, who stumble in here fighting the same problem... 😏
What you need to upload apps on App Store:
A MacOS machine (not too old)
A paid Apple Developer Account
An app signing certificate from the above account
A provisioning profile, with or without a physical device
When trying to create a new provisioning profile in your Apple Developer Account, the first option is:
iOS App Development
Create a provisioning profile to install development apps on test devices.
See:
If you chose this option, you need a physical device! In fact, the way I understand it, you are supposed to register the UDIDs of ALL the phones and tablets that you want to test your app on...
If, like me, you don't have an iOS device, you can instead chose the last option in the list:
Developer ID
Create a Developer ID provisioning profile to use Apple services with your Developer ID signed applications.
See:
This one only requires an Apple Developer ID!
At the end of your create-provisioning-profile process, you have to download your profile and open it in Finder to install it (in XCode or whatever you're using). In your project, you have to switch from "automatic signing" to "manual signing". In XCode, this is done here:
If, like me, you had already downloaded your app signing certificate and installed it in your KeyChain app, you may run into this error when trying to apply your provisioning profile:
"Provisioning profile 'your profile name' doesn't include signing certificate 'your certificate name'".
The way I solved this error was:
In KeyChain:
Exporting my Apple Developer certificate to a .p12 file.
Deleting my Apple Developer certificates.
Re-importing the exported certificate file to keychain.
In XCode:
Close and re-start XCode
In the "Signing & Capabilities" tab in the project, de-select the newly downloaded profile and then select it again.
Now, it works! 🙂 From there, you should be able to follow any tutorial for uploading an app to App Store.

Xcode 11 Archiving to Generic iOS Device errors relating to registering bundle identifier and iOS App Dev provisional profiles matching my app id

As the title says, I'm on Xcode 11 and trying to archive to a generic iOS device to add a new version of the app to TestFlight. It builds fine on all simulators. I don't believe I can change the bundle identifier as I'm adding an update to an app that's already on TestFlight. See below for archive errors.
Errors:
"Failed to register bundle identifier. The app identifier "com.'myappnameishere'" cannot be registered to your development team because it is not available. Change your bundle identifier to a unique string and try again."
No profiles for 'com.myappnameishere' were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'com.myappnameishere'
What I've done:
A. Gotten an Apple Developer Account and registered my devices
B. Cleared the local Provisional Profiles using this method:
Xcode Error: "The app ID cannot be registered to your development team."
Apologies if this has already been posted but I couldn't find anything. Any help would be appreciated!
If the app is already on TestFlight, you cannot just use any apple developer id, you need to be logged in with the same apple dev account which was used to upload the app to TestFlight before
To archive, and upload an update to the app, you will also need the following installed in your machine
app store provisioning profile for the bundle id
certificate assigned to the app store profile
private key for the certificate's
(or you need to create these artefacts, and install / download them on your machine)
It is not clear if you already meet these criteria.
EDIT: answers to questions in your comment -
You may also face issues running the app on the device if you do not have developer profile for the bundle id, but with free provisioning / wildcard profile, you can circumvent this, and not need access to the specific dev account.
You can create and export archive (generate ipa file) ready for testflight using those artefacts, but to upload the ipa to testflight using any method, you will need credentials for the specific dev account. Alternatively, you can generate the ipa and share it with someone who has access and can upload the ipa.

How do I update someone else's iOS TestFlight build in App Store Connect?

I'm trying to upload a new build to TestFlight. I was invited to App Store Connect as an admin, and I added my Apple ID in Xcode. There is already an existing TestFlight build a bygone developer has put up there, but I've taken over the project and need to update it. I can build the app in the simulator just fine, but when I try to make a build for a generic iOS device I get these two errors:
Failed to register bundle identifier. The app identifier "com.blahblahlbah.blahblahblah" cannot be registered to your development team. Change your bundle identifier to a unique string to try again.
No profiles for 'com.blahblahlbah.blahblahblah were found: Xcode couldn't find any iOS App Development provisioning profiles matching 'com.blahblahlbah.blahblahblah'.
I don't see any way to select a different team. Do I need to enroll in the developer program? I'm using Macincloud to try to build the app from Ionic, so I don't have an iOS device to set up two-factor authentication with, but I can get one if that is required to get this to work. Are there some build settings that I have to set up?
I eventually got the last developer to revoke their certificate. Turns out there was some issue with my account not being able to register for the developer program. After dealing with their support for a while I just made a new account. Then I was finally able to create a new certificate and select it in XCode. After that, it built just fine.

Signing iOS App: App ID Cannot be Registered to Your Development Team

I need to replace a deployed iOS native app with a new Ionic3 / Cordova hybrid app. The new hybrid app builds successfully (on macOS Sierra 10.12.6) but I can't sign the app (so that it can be uploaded to the app store).
As a first step, I'm focused on getting the new app on the app store (as alpha to test with TestFlight). I've removed all "development" certificates/profiles from developer.apple.com.
There's a lot of information/questions/answers on the web about signing apps. I've spent a couple of days on this issue and cannot get it to work no matter what I read or what I try.
The current iOS app code (deployed)
In Info.plist, $(PRODUCT_BUNDLE_IDENTIFIER)
In /bbh.xcodeproj/project.pbxproj, PRODUCT_BUNDLE_IDENTIFIER = "NSP.BBH-Mobile";
Re-create development provision
Open Keychain. Delete all developer/iPhone certificates. Delete all keys.
On developer.apple.com, delete development certificate and development provisioning profiles.
Confirm my iPhone device is registered with the correct UDID.
In Keychain, generate a certificate signing request file.
In developer.apple.com, create a development certificate, upload the certificate signing request generated in the previous step, download the certificate .cer file.
Double click on the .cer file. Keychain opens. Choose to add to "log in".
In Keychain > certificates, choose export, specify the strong password. Certificates.p12 file will be generated.
In developer.apple.com, create a development provisioning profile. Choose "iOS App Development". Choose an App ID ... but which one?
App IDs in developer.apple.com
BBH Mobile = com.bbh.*
BBH Mobile = NSP.BBH-Mobile
Xcode iOS Wildcard App ID = *
Notice on-screen reads:
"If you plan to use services such as Game Center, In-App Purchase, and Push Notifications, or want a Bundle ID unique to a single app, use an explicit App ID.
If you want to create one provisioning profile for multiple apps or don't need a specific Bundle ID, select a wildcard App ID. Wildcard App IDs use an asterisk (*) as the last digit in the Bundle ID field.
Please note that iOS App IDs and Mac App IDs cannot be used interchangeably."
We need push notifications so choose an explicit App ID = AYW4J8P7X3.NSP.BBH-Mobile
app id = team id (generated by apple) + bundle id (supplied by the user)
It makes sense to choose this App ID which includes the bundle id of the iOS currently deployed.
https://www.screencast.com/t/C0QdPdxwh09t
Choose a development certificate (just created), choose all devices.
Download the development profile and double click to install (in Xcode).
Double-clicking doesn't seem to do anything? How do I know it's installed in Xcode correctly?
Do I need the .mobileprovision file on my iPhone? The mac server is in the cloud so I don't have my iPhone connected via USB to the mac.
Open Xcode. Confirm my apple account added in Xcode > Preferences > Accounts. In the project, targets, signing, click "Automatically manage to sign".
Choose my personal team. The following errors are displayed:
Error 1: The app ID "NSP.BBH-Mobile" cannot be registered to your development team. Change your bundle identifier to a unique string to try again.
Why does it prompt to change bundle id? Isn't it standard to have one app id and to generate both a debug/development and release?
Error 2: No profiles for 'NSP.BBH-Mobile' were found Xcode couldn't find any iOS App Development provisioning profiles matching 'NSP.BBH-Mobile'.
But we just created a new development provision and selected App ID = NSP.BBH-Mobile. Why doesn't Xcode recognize this?
you may try unselect Automatically manage signing and import provisioning profile manually.
These are the steps I took to finally resolve this issue. It may not be optimal but it at least worked.
1. In Xcode, turn off automatically manage signing.
2. For signing (debug), select my development provision profile.
3. For signing (release), create a production provision profile, then select the new production profile.
Notes/Observations:
Even though I only wanted to create a signed debug for testing it seems I still had to provide valid signed release provision too.
Even after deleting all keys/certificates etc. and starting from scratch it seems Xcode has created a certificate too. Annoying - it's difficult to tell who created what now.
There was no need to change the bundle ID from the original iOS native app being replaced.
Creating a new production provision did not affect the existing production provision (which I could not use because I don't have the key).

iPhone code signing key doesn't match provisioning profile "xxxxxxx"

For about 17 weeks I've been building an iOS app using Xamarin Studio. I've added an iPhone to the developer profile and edited the provisioning profile to include this new iPhone, to test and debugg my app (I was running it on my MacBook (but with OSX Mavericks 10.9), and all worked well.
Last week, my supervisor asked me to upload the app to another iPhone, to show a demo of the app to our customers. I added the device in the developer portal, and linked it to the already existing Provisioning Profile. When trying to run the app, I got the error: "No iPhone code signing key matches specified provisioning profile".
A coworker and I have tried to resolve this issue by importing Certificates and Keys from another MacBook, on which the app still ran, onto this MacBook. After that didn't work out, we tried deleting the Certificates and Private Keys in the Keychain on this MacBook and re-importing them from the other MacBook.
We tried to create a new Provisioning Profile and re-link both iPhones, but the error still occurred.
Now, the app won't even sign on the first iPhone I linked to the first Provisioning Profile in the developer portal, nor will it sign using the emulators in Xamarin Studio
What I wanted to ask was what makes this problem occur, and how to fix it. Do we need to create a new certificate and provisioning profile altogether, or is there something we can do to fix this problem without having to create new certificates and provisioning profiles?
I've contacted Apple Support, they redirect me to Xamarin. Xamarin redirects me to Apple Support... I just can't get help from the officials, so I'll try the community.
Any help would be much appreciated.
1.Go to Xcode, create a new project. Select your company name(do not select user), then type in anything you want as your bundle identifier.
2.Go back to Xamarin studio and change the bundle identifier to match the one you just created in Xcode.
3.Update the provisioning profile in options to include the bundle identifier you created in Xcode. Build, then Debug the solution and it should work.
For me the issue was the team identifier contained the only provisions, and the only selection in Xamarin studio were users. I just created a new project in Xcode that pointed to the team provision, then used that new bundle identifier (that was uploaded to the Apple dev site) in Xamarin studio.
I know it's tedious, but I would start over re-creating certificates and profiles.
You could follow this lovely step-by-step guide: Publishing to the App Store
you have assigned wrong developer and with your provisioning profile.
select it right on going into build setting>> code signing and select provisioning profile you create with developer account.

Resources