XCode: iOS Enterprise in house app signing errors - ios

I'm using XCode 5, iOS 7.0.6, iPhone 5S
My company is trying to deploy a test inhouse app with the enterprise program (not the actual app, we just want to try figuring out the deployment). I have been invited as a member to the enterprise program, and I requested a development certificate through XCode.
In the Build Settings, I have:
Code Signing Identity -> iPhone Developer: ...
Provisioning Profile -> iOS Team Provisioning Profile: * (Wildcard)
It builds and archives fine, but when I tried installing the app, I received an error "The executable was signed with invalid entitlements." After googling, I followed the suggestions to toggle a setting in the Capabilities tab. I clean, build, archive again, and this time, I'm getting the error "A valid provisioning profile for this executable was not found." Am I setting the code signing/provisioning profile incorrectly? Those are the only ones I have access to.
I am unclear of Developer Certificate vs Distribution Certificate; do I need a Distribution Certificate to install the app on devices?
Note: I'm trying to install the app through Apple Configurator, since that's how we want to deploy the app to employee devices.

You need a Distribution Certificate if you want to install it Ad hoc.

Related

In house type profile needs "iOS Development" certificate

I have an Enterprise type apple account, I want to deploy to my testers without using device UDIDs. Then testers can manually trust my organization for testing. My Xcode version is 11.7.
The error is:
Not sure why In house type also needs development type profile?
My steps are:
Create enterprise distribution certificates link
This step I generated iPhone Distribution: xxx Limited in keychain.
Create an app identifier.
Generate the profile for archiving.
Download the profile and double click to install it.
In Xcode, "Signing & Capabilities", used the profile just installed, then comes to error:
Not sure what I have missed, please help! thanks!
Check if the Code Signing Identity under Build Settings/Signing is iOS Distribution for the Release build configuration:
I had a similar problem caused by iOS Developer had being set for both Debug and Release build configurations.

None of the valid provisioning profiles include the devices - Distribution

I read online we need a separate distribution provisioning profile if we want to distribute an app to the app store. I know there are answers already on StackOverflow for this error but I think mine pertains to my Distribution provisioning profile.
So right now I have two provision profiles, one for developer, and another for distribution. The app will build and run successfully on the same device when Code Signing Identity under "Build Settings" is set to iOS Developer. But when I switch Code Signing Identity to iOS Distribution and run on the same device, I get the error "None of the valid provisioning profiles include the devices". When I try the option to let Xcode "fix the issue", it says that
"Xcode failed to resolve the issue. Check your code signing settings; ensure you have a matching signing certificate and provisioning profile installed; and try again."
The provisioning profile for distribution is active on the Apple Developer site. When I try to reset in Preferences I still get the error
You can not run on a device with the Distribution profile. That's just for doing a build/archive and then submitting that to the store. If you want to run the production build on your device, submit to iTunes Connect and use TestFlight to install that build on your device.

Initializing my new AD-HOC profile for testing Push Notifications on Production

I want to test Push Notifications in iOS production version before I publish it. I understand I cant sign it with distribution profile ,only AD-HOC profiles.
So I created an AD-HOC profile, selected the right bundle, selected my device that I work with and created a new profile. I downloaded it and after that I select it in:
Provisioning Profile -> Release - AD-HOC-NEW
Provisioning Profile -> Debug (Any SDK, Any iOS SDK) are with Automatic.
It compiles and installed on my device through Xcode but notification don't come.
When I try to change Debug settings also to my new profile I'm getting an error :
"No provisioning profiles with a valid signing identify(i.e certificate and private key pair) were found.
No codesigning identities (i.e certificate and private key pairs) that much the provision profile specified in your build settings ("AD-HOC-New") were found. Xcode can resolve this issue by downloading a new provisioning profile from the member center."
I press "Fix Issue" but It dont fix it...
What could be the problem?
I think you should install your binary not straight xCode but as a real over-the-air/ ad hoc deployement.
The consequence is that your application will request at launch not a token from the sandbox environment but from the production one, and this will match your certificate (which is a production one too).
You do a real ad-hoc deployement both by installing your .ipa through iTunes, or by using a solution such as Testfligt.

iOS Enterprise program: not able to install IPA file created using in-house provisioning profile on one of our device

We are using iOS enterprise account for distributing our iOS app. We are using the in-house distribution scheme of enterprise program.
As far as my knowledge, we don't need to install the in-house provisioning profile in the targeted device. Also, I believe that we don't need to add the device UDID in iOS portal since it's an enterprise account. Please correct my last two statements if my knowledge is wrong.
I am creating the IPA file using the in-house provisioning profile only. But while installing the same on one of our devices (iPhone 5s), I am getting below error.
"**A valid provisioning profile for this executable was not found.**"
I tried to install the same IPA file on another device (iPhone 4s). I have not installed the distribution provisioning profile in that device also. And it's working fine there. So only I concluded that We don't need to install any provisioning profile on the device in case of iOS enterprise program.
Below is my provisioning profile from enterprise account which I am using.
I am not sure why this is happening. Please help me and let me know if I am missing something.
You have to use a provisioning profile that is set for distribution. This profile needs to be using a certificate that is installed on the Mac you want to create the archive from. The profile gets installed along with the application.
You do not have to have the device added to the portal (only development devices need to be added).
One note - the profile will expire yearly. You will have to publish at least one update every year to include an updated and renewed provisioning profile.
Here's some screenshots:
Keychain Access:
Build Settings (Xcode):
Archive:

Push notifications don't work if app is installed via iTunes but they do if installed by XCode

I have an app that uses push notifications and I am trying to distribute it to testers for testing.
If I create an ad-hoc distribution which gets installed via iTunes then everything works except for the push notifications, which never arrive.
But if the app is installed using XCode then the push notifications do arrive.
When I build for installation using XCode I set the code signing identity within XCode to my development profile. When I build for ad-hoc distribution I set the code signing identity within XCode to be the ad-hoc distribution profile when building the archive, then sign the archive for distribution again with the ad-hoc profile (I found this was the only combination that would allow installation via iTunes without an error message).
All the devices have been added to the ad-hoc distribution profile and to the apple push profile (and also to the team provisioning profile), the profiles have been renewed and refreshed within XCode.
Even with my own iPhone I can get push notifications to work if I install with XCode but not with iTunes.
Am I signing the ad-hoc distribution with the incorrect profiles, if so what is the correct combination of profiles?
Is there another reason why the push notifications don't work for the ad-hoc distribution but do when the app is installed via XCode?
These are the profiles used:
1) Apple push profile which has an App id of abcdef.com.company.mno
2) Project Development profile which has an App id of abcdef.com.company.mno
3) iOS Team provisioning profile which has an app id of abcdef.*
4) AdHoc Distribution profile which has an app id of abcdef.com.company.mno
5) My developer profile which has an app id of abcdef.com.company.mno
** since first posting this I tried creating a new iOS Team provisioning profile using the abcdef.com.company.mno app id but it made no difference **
The abcdef.com.company.mno App Id is showing Push Notifications for Development as being enabled (which is correct, we are not yet using Production pushes). Also its Development Push SSL Certificate is showing as enabled.
The code signing identities are: first pic what I use for installing/running using XCode, 2nd picture when building an archive for ad hoc distribution.
The description for the iPhone Distribution profile in XCode says: "Ad Hoc distribution profile (for bundle identifiers com.company.mno)".
This morning I had a similar issue trying to compile an In House app (I think it's the same issue). I had the iPhone plugged to the computer and I saw in console one warning like: entitlement 'aps-environment' has value not permitted by a provisioning profile
I tried this solution, but I had no success:
'aps-environment' has value not permitted by a provisioning profile
So, my app was working correctly in release mode running from Xcode, but when I tried to export with Ad Hoc certificate my iPhone shown that message on console.
Finally I went to profiles in iPhone and deleted all. I went to profiles in Organizer and deleted all too. I edited the provisioning profile via Provisioning portal and downloaded them again.
I changed code signing to Don't code sign. Changed again to In House provisioning profile, exported to a file and everything worked fine!
You're probably signing the adhoc version with a wildcard app id provisioning profile. Make sure the Code Signing Identity in the build settings is explicitly using your explicit-app-id provisioning profile.

Resources