Manually create provisioning profile in Xcode - ios

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

Related

how and what is XCODE's Bundle ID, signing?

sorry new to IOS programming. must i enroll to apple developer program to obtain a bundle id ?
apparently i am trying to start my first project, but it seems like i need to choose a bundle idnentifier so that the signing tab would have no errors.
is the signing tab required for me to make a development environment on my device ?
Bundle identifier is on which uniquely identifies your app on app store, it is unique & hence 2 apps can't have the same bundle identifier's.
Example of a bundle id
com.azhar.calulator seems like this.
Signing of a code is required for running, testing & debugging of the app.It requires provisioning profiles and its certificates.
Procedure for getting them:
1.Run Google Chrome, Mozilla Firefox, or Safari.
2.In the iOS Dev Center, click Certificates, Identifiers & Profiles.
3.In the drop-down menu in the top left corner, verify that iOS, tvOS, watchOS is selected.
4.In the left-hand sidebar, select Provisioning Profiles → Development.
Click +.
5.Select iOS App Development and click Continue.
6.Select an App ID to associate with the provisioning profile and click Continue.
7.To be able to use one development provisioning profile across multiple apps, select a wildcard App ID, if available.
8.Select one or more certificates for development to include in the provisioning profile and click Continue.
9.Only certificates for development are listed.
10.Select one or more devices to include in the provisioning profile and click Continue.
11.Provide a name for the profile and click Continue.
12.(Optional) Click Download to download the provisioning profile.
13.Click Done.
The bundle ID is your application ID. It is the one you set when creating the project, and should look something like: com.darkArtistry.appName
What you need from the Apple Developer Program is :
1 - A valid developer to certificate to sign your application
2 - A valid provisioning profile, that matches your appID.
Provisioning profiles allow wildcards in some cases like com.darkArtistry.* so they can match more than one bundle ID.
I would recommend you to first get your certificate from the developer program, and then xCode will help you creating a provisioning profile for you.
There are a lot of guides out there, let us know when you are exactly stuck.

Re-sign .ipa with less or more devices

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.

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.

Xcode 6 error when building app for release

I am having issues trying to achieve or even build a release build of an app I am working on. Whenever I try to build the app for release I get an error saying:
No provisioning profiles with a valid signing identity (i.e. certificate and private key pair) were found.
I have the cert for this profile on my computer but in the Developer Portal I only have a certificate for development. Is this causing this error to occur? Do I need to have a Distribution cert to be able to build for release? Any help would be appreciated.
Note: I am a developer(team member) for a company so I do not have direct access to the Apple Developer Portal.
I know provisioning profiles are a pain :) This is what I do to stay organize and develop/distribute my projects:
The developer portal (not xcode) contains the most accurate source of profiles. For example, imagine you created a merchant certificate, turned on apple pay, and then generated a provisioning profile. Then let's say you decide you no longer want to use apple pay - the act of turning it off actually invalidates the provisioning profile. You will see a yellow "invalid" warning in the developer portal, but the provisioning profile may still be available in xcode! Really annoying. So I would always make sure that your provisioning profile is valid in the developer profile before distributing an app.
In the developer portal, always make sure you have two distribution profiles -- one ad hoc to use with testflight, and one to distribute to the apple store. You should also have one developer profile to build and debug your code.
Once you have your profiles set up, go into xcode and refresh the provisioning profiles as described here: https://developer.apple.com/library/mac/documentation/IDEs/Conceptual/AppDistributionGuide/MaintainingProfiles/MaintainingProfiles.html#//apple_ref/doc/uid/TP40012582-CH30-SW26. I.e. go to preferences, accounts, view details..., and click the refresh button on the bottom left hand corner.
Now that xcode's provisioning profiles are updated, you need to now code sign with the right profiles. To do so, go into your project settings, and go into build settings for both the project and the target. Under debug, select your iOS development certificate. Under release, select your iOS distribution certificate. Under provisioning profile, you will want to select your development profile just to build on your device and debug, your ad hoc distribution profile if you want to archive the project and send it via testflight, or your apple store distribution profile if you want to archive the project and submit it to the apple store.
A few things to note, is that when you are creating the provisioning profiles, you need to specify the certificate you are dealing with. So if you are creating one of the two distribution profiles, you will need to select your iOS distribution certificate. And when you select ad hoc distribution, will need to select the devices that you want to be able to distribute too. Testflight will help you register the devices that you want to distribute to, and once registered, you will be able to select those devices to add them to the provisioning profile. If the certificate you select in xcode was not used to generate the provisioning profile you selected in xcode, then you will probably get the error you mentioned. Think of the provisioning profile as the link from you as a developer (i.e. your certificate) and/or your devices to your app id (i.e. your project).

How do you add a new device to an ad hoc distribution profile?

I've added some new devices to the development portal and want to be able to send them an ad-hoc distribution for installation via iTunes.
However I can't see anywhere on portal website where devices can be added to the ad-hoc profile.
I've tried refreshing the profiles via XCode, and that added the new devices to other profiles but it didn't add them to the ad-hoc profile.
There's an "Edit" button on the right side of your Ad-hoc profile listing, click that and use the checkboxes to select the devices you want on this profile.
Try this:
Log into the provisioning portal at http://developer.apple.com/ios/manage/provisioningprofiles/index.action
Go to distribution tab.
Find your ad-hoc provisioning profile
Hit edit.
Tick the new device in the list thats shown (or choose 'select all').
Profile will say pending.
wait a few seconds, reload.
Download and install new profile.

Resources