简体   繁体   中英

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

  1. Open Keychain. Delete all developer/iPhone certificates. Delete all keys.

  2. On developer.apple.com, delete development certificate and development provisioning profiles.

  3. Confirm my iPhone device is registered with the correct UDID.

  4. In Keychain, generate a certificate signing request file.

  5. In developer.apple.com, create a development certificate, upload the certificate signing request generated in the previous step, download the certificate .cer file.

  6. Double click on the .cer file. Keychain opens. Choose to add to "log in".

  7. In Keychain > certificates, choose export, specify the strong password. Certificates.p12 file will be generated.

  8. 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.

  9. 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.

  1. Open Xcode. Confirm my apple account added in Xcode > Preferences > Accounts. In the project, targets, signing, click "Automatically manage to sign".

  2. 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?

您可以尝试取消选择Automatically manage signing并手动导入provisioning profile

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).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM