Re-sign .ipa with less or more devices - ios

I am having problems with resigning my Ad-hoc app to contain more/less devices.
By following the steps outlined here https://coderwall.com/p/cea3fw/resign-ipa-with-new-distribution-certificate I manage to resign my ipa using codesign, however it does not seem to have any effect, because even when I remove my device from the provisioning profile, the ipa can still be installed on this device using XCode devices.
Any clues where I may have gone wrong?

The device has stored a copy of an old provisioning profile, and that profile permits the app to be installed on the device.
Mostly we can consider a code signing certificate and a provisioning profile as one thing. But they actually perform two separate functions.
A code signing certificate and its private key is used for signing an app.
A provisioning profile contains lists of devices, code signing certificates, entitlements, and a bundle ID. It is a ticket from Apple which gives permission to install apps not from the App Store.
When a device attempts to install an app, it searches for a stored provisioning profile that may be used to install the app. This may be the provisioning profile included with the app, or a previously installed profile.
To remove provisioning profiles from a device:
Open Xcode and select the menu Windows -> Devices...
Ctrl-click on the device and select “Show provisioning profiles...” from the drop down menu.
Select unwanted profiles and press the “-”-button.

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.

Manually create provisioning profile in Xcode

I have a simple goal I would like to achieve, manually create a provisioning profile in Xcode.
So, I was trying to use the Pythonista Template in Xcode, and I wanted to flash it to one of my devices so that I could test it on a real device and not just the iOS simulator.
So I enter in what I want the app ID to be, and it says, No profiles for 'com.cartercoding.getnpostserver' were found. So I need to manually create a provisioning profile for it, which I have looked up, but the answers I have found are not relevant.
I am using Xcode 11, stable release.
I don't really know what a provisioning profile does...
A provisioning profile grants permission for one or more iOS devices to run an app signed with a specific certificate. Normally, an iOS device will only run apps that are signed by Apple; a provisioning profile tells the device that it may also run apps signed with a key corresponding to the certificate specified in the profile.
I am trying to put an app that I downloaded from the internet on my phone, so I can't do it the usual way.
The whole iOS code signing infrastructure is designed to prevent you from doing that. Short of jailbreaking your device (which is a whole other conversation) you can't just install an app that you've downloaded onto your phone.
I have a simple goal I would like to achieve, manually create a provisioning profile in Xcode.
You can't create a provisioning profile "manually," if by that you mean to construct one on your own; you have to get one from Apple (whether that's automatically through Xcode or via the developer portal).
For users who need to manually create a provisioning profile (in some companies every app has to have its own provisioning profile)
Sign in to your Apple Developer account and navigate to Certificates, IDs & Profiles > Identifiers > Provisioning Profiles.
https://developer.apple.com/account/ios/profile/production
Add a new provisioning profile.
Activate App Store.
Click Continue.
From the dropdown menu, select the app ID you just created.
Click Continue.
Select the certificate you just created.
Click Continue.
Fill in a name of your choice. The name is not visible to end users.
Click Generate.
Download the provisioning profile.
Click Done.
The provisioning profiles overview with your new provisioning profile is displayed.
If you need a Provisioning Profile of Type Ad Hoc
Is everything the same except point 3
These instructions were copied from this page
https://support.staffbase.com/hc/en-us/articles/115003598691-Creating-the-iOS-Provisioning-Profiles

Xcode Signing Failed to create provisioning profile

I subscribed to the App Developer program. I paid the fee. I've done Certificates, Identifiers & Profiles. I added the app to App Store Connect.
xcode signing
I am getting the errors above. I don't have an iPhone phone. I'm developing on my macbook computer.
xcode device
How can I resolve this error?
As I can see in image that "Automatically Manage Signing" is enabled for this Xcode project. So Xcode is trying to create the provisioning profile for you but not able to create it.
B'coz you need to add account in Xcode from Xcode -> Preferences -> Account -> Click on + icon at bottom to add a new developer account.
You need to create provisioning profiles.
Once you have created provisioning profile, download it and install on your machine.
Please make sure the certificate used in cretation of the provisioning profile must be in your machine's keychain.
If those certificates not installed in your keychiain then you will see certificate issue in Xcode.
But I would recommend to create provisioning profile manually from apple developer portal as you can see and mainly you can know that which certificate and devices are used in the profile.
You can create following provisioning profiles for your app.
Development Profile
You will be able to run/debug app on real device.
The device must be added into the profile.
This can be used for only development purpose.
Adhoc Profile
You will be able to install app on real device but not able to debug it.
The device must be added in profile to install app on it.
It acts as a release build but not a actually release build.
Generally develop send the adhoc build to client for testing of app.
App Store Profile
You will not able to run app on device using this profile.
It will be used to upload app on App Store or create the release build for distribution on App Store.

Development provisioning profile devices

After lots of research, I understand that an app signed with an iOS development provisioning profile can only be installed on devices which have their UDIDs listed within the provisioning profile (which is done on the dev portal). To further my understanding of how this all works, I've created a new development provisioning profile which has only 1 device listed, and that device isn't the one I'm using. For some reason, when I sign an app using this provisioning profile through both xcode and cordova, the app will be installed and deploy as if that device's UDID were listed within the provisioning profile (which it isn't).
I've been using the following to inspect the embedded.mobileprovision profile within the .ipa
security cms -D -i <provprofile>
And there's only 1 device listed, and the UDID of that device doesn't match the UDID of the device which I've managed to install the app on.
Am I missing something here? This issue linked below seems to indicate that this shouldn't work.
Development Provisioning Profile
The embedded provisioning profile with the app isn't the only profile at play here. The device will allow the app to run as long as there is a valid provisioning profile that includes the device and includes the app ID the app is using.
I suspect you had previously installed the app (or another app) that had a valid provisioning profile for that device. The profile either had the same app ID, or was using a wildcard app ID, and is likely still on the device. Because iOS can find a valid profile, it lets the app run.
To verify if this is the case, Plug the device into a Mac, open Xcode, and go to the Devices window. Select the device in question, right-click on it, and select the "Show provisioning profiles..." menu item. You may see other provisioning profiles that are still on the device from previous installs.

Cannot add distribution provisioning profile to Xcode 5

I'm trying to distribute my Phonegap app on the iTunes. I have done this before successfully before but I have since changed to a new Mac. I'm using Xcode 5.0.2.
I have created development and distribution certificates. I then created an App ID, entering the Bundle ID under "Explicit App ID".
I then created a development provisioning profile for the app, choosing the correct App I.D., the iOS Development certificate, my device, giving the profile a name and clicking "generate". I download it and double click to add to xcode. The xcode organiser opens and I see it added under my device provisioning profiles. I can then successfully run the app on my physical device.
Now I want to distribute it. I created a new provisioning profle, selecting "App Store" under Distribution, selecting the correct App I.D., the iOS Distribution certificate, and clicking "generate". When I double click the downloaded file, the organiser in xcode opens, but the distribution provisioning profile doesn't under the device provisioning profiles. When I click the + button to add the profile, I cannot select the Distribution provisioning profile, but I can select the Development provisioning profile:
I have no idea why this is. I tried closing down and opening xcode, to no avail. I tried waiting a few hours. Again, it didnt work.
I then try to distribute my app by creating an archive. First I go to build settings > code signing and choose iPhone Distribution:
I then select my physical device and choose Product > Archive. I get the error:
No matching provisioning profiles found
None of the valid provisioning profiles include the device Belgian Iphone (identifier: xxxxxxxxxxxxxxxxxxxxxxx).
Xcode can resolve this issue by downloading a new provisioning profile from the Member Center.
I click "Fix Issue" and end up with the error:
There was an error generating the team provisioning profile for AppID 'FT49U8Q9JE'.
The AppID given here is different to the prefix in App ID's in the developer portal. I don't know if it should be the same. Any suggestion? I have spent 3 days on this problem and as stated above, I had no issues on my previous mac (which I no longer have)!
Something that got me recently was having to actually set the provisioning profile in the build settings

Resources