iOS: Is a Distribution build supposed to work on my Developer device? - ios

I am confused with profiles and certificates for the build I am trying to put on the Appstore.
In developer.apple.com/ I have properly created both a developer and distribution certificate. they are both linked to the single app I have created.
I have registered my device (iphone)
I also have properly created 1 development provisioning profile and 1 distribution provisioning profile.
When I build with dev certificate + dev provisioning profile: app works fine on my device
But I know the build needs a distribution certif and provisioning profile in order to get approved on the appstore.
However when I build with distribution certificate + distribution provisioning profile, the build is succesful, but I can't launch the app on my iphone, other iphone (with http://www.diawi.com/ or iTunes). It immediately crashes with the infamous error popup: "unable to download. "XXX" could not be installed at this time".
When I look at the device's log from Xcode, it clearly states the crash comes from a profile issue.
Is the distribution build supposed to work on my iPhone?

You can check you Beta release build to your developer device using 'Apple Ad Hoc Distribution profile/certificat'. Here are Apple Dev link Beta Testing Your iOS App

No. A distribution build will not just be installable on your device. You are meant to submit it to iTunes Connect from Xcode, where you build it from an archive, or from Application Launcher where you would submit it as an IPA.

you should have created adhoc distributed provisioning profile and add your device to that profile.
But you need iTunes Connect to submit the app to App Store. This time you can create provisioning profile for app store.
Advantages of iTunesConnect.
1. You need not to add new device to the provisioning profile every
time you want to test the app in new device.
2. You can add as many as new test users to the app and can mark them as internal and external users.
3. You can upload as many builds as you want and test those builds.

Related

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.

ios ad-hoc profile ignored when archiving

I have created an ad-hoc distribution profile. I am trying to load the app to the app store for beta testing only. However, when I run the xcode (using xcode 7) archive it ignores the build settings and switches to the non-ad-hoc distribution profile.
I have read many threads and I am still not clear if
I should care that it is doing that
If I should care then why is it happening? The ad-hoc profile is active.
Since you're uploading to the AppStore, you need to use AppStore distribution provisioning profile. You can still use your ad-hoc profile when exporting for ad-hoc deployment. (TestFlight is an integral part of the AppStore now, and is not considered ad-hoc distribution platform anymore...)
From Test Flight Beta Testing:
You should take the following steps to set up prerelease versions of
your app for testing in iTunes Connect:
...
Generate a new
App Store Distribution profile containing the beta entitlement to
distribute builds via TestFlight.
...

Install iPhone application in my device

I was recently developing an iPhone application using Xcode. Now I want to install this app on my iPhone in order to test it.How can I do this? could you tell me please a step by step answer because I am new to this.
I have already created an account on the
iPhone Dev Center
now what is the next step?
As per Apple guidelines:
To test your app on a variety of devices and iOS versions, create a special distribution provisioning profile, called an ad hoc provisioning profile, and send it, along with the app, to testers. An ad hoc provisioning profile doesn’t require that testers be enrolled in an Apple Developer Program, be added to your team, create signing certificates, or use Xcode to run your app. Instead, app testers simply install the app and the ad hoc provisioning profile on their device to launch the app. You can then collect and analyse crash reports or logs from these testers to resolve problems before you ship your app.
Can I do what is mentioned here? and if yes how ?
go to memeber login area and login with your credential..
go to certificate , Identifiers & Profile tab
go to keychain access and create a .csr file and save it, it'll
required for creating certificates
create a certificate from certificate tab
create App Ids from identifier tab
Register your device UDID from Devices tab
Create distribution profile from Provisioning Profile tab and download & save it.
Install the Provisioning profile to your device and build your project using that profile.
Archive your project and create .ipa file
Final step: Install that .ipa file to your device.
Hope it'll help you. Happy Coding.....
With the free account you can not test/run apps on a device.

Add additional beta testers to IOS app

I have an IOS app currently being beta tested by a few people. I have a few more testers that I would like to add and distribute my beta app to. Can I simply add the devices and activate them in my distribution provisioning profile? Or do I need to download the updated profile and create a new archive with the updated device list?
If I do need to create a new archive, will the archives I sent the original testers still be valid or do they need the newly created one also? No code changes have been made.
You have to download the updated provisioning profile and rebuild the app using that profile.
An "Ad-hoc distribution profile" contains the list of allowed devices, and the app will
not install on other devices.
The previous version of the app continues to work on the devices that it was built for.
You need to add the new devices in the Provisioning Portal. Then add those devices to your Ad Hoc Distribution Provisioning Profile. You then have to download the provisioning profile and build an new archive with that profile. The previous archive is still valid and there is no impact to the previous testers.
The provisioning profile and application is installed on the users device user A and user B just have slightly differed versions. This is why I have automated setting CFBundleShortVersionString and CFBundleVersion as a build script. I display the version and build number in my about page. Also Crashlytics and TestFlight key off them.
What will kill all Ad Hoc builds you have in the field is deleting your certificate in the provisioning profile. But loosing your private key to the certificate would be a pain but not terminal. You would have to make a new one and recreate all you provisioning profiles and give new builds to all your testers. It will not effect your apps in the app store. Your distribution certificate is used by you to sign and certify your build. Apple then can know it really came from you they then remove your signing and resign it for the App Store.
My Check List
Add device in portal Edit TestFlight Distribution Profile
Add new devices
Delete old TestFlight Distribution Profile in the Xcode Organizer
Click refresh in the Xcode Organizer
Select TestFlight Distribution Profile in build setting
Commit project settings change from above step (committing increments my CFBundleVersion)
Build new archive
Up load to TestFlight
Notify / Authorize only the new devices / users

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