Provisioning profiles and xcode builds - iphone

I'm planning to distribute an application ad hoc for beta testing. I have created a provisioning profile for the distribution but it doesn't contain all the devices.
My question is if I need to rebuild the application in XCode if add more devices to the provisioning profile?
Or could I build the app once with the original provisioning profile and when more devices turn up just update and download the new profile file to distribute with the app?

I've done this in the past, and no-one has complained of an adhoc app not working.
It seems that iTunes checks the provisioning profile's ID against the one signed into the app, and if they match, then it's a green light. It doesn't appear to check whether or not the provisioning profiles are actually identical.
So you should be able to build with the current provisioning profile, and then when new devices are added, send them the app bundled with the new provisioning profile.

Related

Failed to install iphone application for ad hoc

I followed the stepped to create a ad hoc carefully:
Added the testers team devices to the devices list in iOs Provisioning profile page
Created a new distribution profile for ad-hoc
In xcode I chose the project and clicked on product->archive.
I sent both the archive (ipa file) and mobile provision to the testers team.
The application failed to install.
I saw an answer of a developer to set in build settings the provisioning file to Code Signing Identities to the distribution profile here
In the list I can see only iOS Team Provisioning Profile that was created by xcode.
This is probably not the distribution profile.
What is missing? How can I set the build settings to the distribution ones?
In the IOS Provisioning Portal, in the Provisioning page, click the 'Download' button by your new distribution profile and it should get added to XCode.
To check you have it, go to XCode Organizer, Devices, then Library / Provisioning Profiles on the left.
You may also use https://testflightapp.com.
This is a free service and works very reliably - you can manage your testers and test ipa's easily.
First I also tried testing my app without such a service - but I ended up using this, since it's also very easy for the testers.
Create Distribution certificate and Provisioning profile.
You should have the Distribution certificate in key-chain.
Download Distribution Provisioning profile and double click on that profile.
Confirm you are having the profile in XCode -> Organizer.
In case the Add-Hoc deployment won't install on a testing device, and you have the device added to the profile, and the app signed correctly ...
Ok, what I did is to add an Entitlements.plist file and set the Can be debugged option to NO and set it on the target as the Code Signing Entitlements, but actually I don't know if this was the fix because I won't try again and again, now that it worked.
Then, actually I didn't archive the app and save the .ipa file from Organizer - Archives, but instead I've sent the .app file from the build/Release-iphoneos as it is, together with the profile downloaded from dev account. It will install in iTunes and it just worked, after couple of hours of frustration.

How do I test my app on iphone

I am university student, and i received from school an invitation to apple developer which i created an account and joined the group. I downloaded and installed the "WWDR intermediate certificate" and installed it, also noticed that they added my device in the provisioning profile.
From here I am lost, were I am not sure what is the next steps I should do
Login to the Member Center
Go to the provisioning portal
Create a developer certificate (different from a distribution cert, which you'll need for AppStore release)
Create an App ID (and add a device, if you're doing an ad hoc app)
Create, download, and install a provisioning profile
Plug your iPhone into your Mac
Build your Xcode project for the device (instead of for the simulator)
In the developer portal you should:
Enter your app and give it a name.
Add the app to a provisioning file.
Download the provisioning file
Drag that file into Xcode.
In the organizer-window in Xcode - add the provisioning file to your phone. This might not be necessary since Xcode can automatically download a team provisioning file.
That was from the top of my head. Try search for a guide or tutorial for it, there's plenty of them :)

Testing App Store "Distribution" version

Is there a way to test the App Store Distribution bundle that's to be submitted to iTunes Connect, on a device, e.g. iPod Touch?
Also, for the distribution bundle is it important to remove the file "Entitlemenets.plist"?
You can run a Distribution build on a device with your Ad Hoc provisioning profile.
(You can't launch it with the debugger though.)
Also, you can submit an Ad Hoc build to the App Store.
This is because both Ad Hoc and Distribution builds are signed with the same distribution certificate. (There is no separate "Ad Hoc certificate".)
Do not remove Entitlements.plist. It must be present.
Yes it is possible. All you have to do is first install your app with the Ad Hoc provisioning profile on your device. Then, when you have removed your app again, you can install it with a build signed with your App Store provisioning profile.
This works because when you install the Ad Hoc build, the Ad Hoc provisioning profile is installed on your phone, which adds your distribution certificate, which is the same used by the App Store provisioning profile. This is sufficient for your distribution build to run.
The provisioning profile is merely a set of rules explaining which devices are allowed to install your certificate. The Ad Hoc profile allows your registered devices to install your distribution certificate. The App Store profile allows App Store users to install it. Once the device has the certificate, they do not need to install it again and can use your app regardless of which profile is bundled in the app.
Step by step for Xcode to test your distribution bundle:
(Note: this does NOT require a jailbroken phone)
First time you want to test your app with a distribution build:
Create provisioning profiles for app store and ad hoc in provisioning portal and install them on your mac.
Archive your project
Press distribute and choose ad hoc / enterprise
Choose the ad hoc provisiong profile
Install the package on your iPhone (via iTunes or whatever way you prefer). Verify that the Ad Hoc profile is installed in your phone
settings
Remove app, but keep the installed profile on your phone
Now, every time you want to release your app and pre-test it with your
release build, you can do this:
Archive your project
Press distribute and choose ad hoc / enterprise
Choose the App Store provisioning profile
Install on your phone and test it (using iTunes, for example)
Upload the exported .ipa to App Store (via Application Loader)
You can test the equivalent of the App Store distribution bundle by creating a target identical to the App Store target except signed with an Ad Hoc provisioning profile.
check this out, you can actually test a distribution build :
http://nikhilkerala.blogspot.com/2010/12/how-to-test-app-store-distribution.html

Why not use development provisioning instead of ad hoc?

I was under the impression that when you use a development provisioning profile for a build of an app, only the specified developers can deploy that build to a phone.
But I just deployed a build that uses a development profile to a phone using Xcode Organizer, even though I'm not one of the valid developers for that profile. One of my colleagues, who doesn't even have Xcode installed, did the same with his phone using iTunes.
In that case, why not use a development provisioning profile for distributing your app to e.g. your QA team, instead of ad hoc distribution?
EDIT: Please read the part in bold carefully before answering. I'm not asking a basic "how does this work" question. I've made a lot of development, ad hoc, and app store builds, and now I find that I seem to have made some wrong assumptions.
There's one situation in which you need an Ad Hoc profile, and that's when you want to test Push Notifications.
If you test Push Notifications on a Development Provisioning Profile, your push notifications need to be sent using the Development Push Notification Certificate for your SSL connections to Apple's sandbox APNS server.
If you want to test Push Notifications using your Production Push Notification Certificate and the live APNS servers, you'll have to deploy your app to a device using a Distribution Certificate and Ad Hoc Provisioning Profile (which includes doing the Entitlement.plist steps, which you can ordinarily skip if you were only using Developer Provisioning Profiles).
Also note that when you deploy using an Ad Hoc profile, your device token will be different from the one you use when you're using the development profile. This the recommended way to test APN because there's no back end changes that need to be made between the Ad Hoc build and the final live deployment on the AppStore.
Ad-Hoc is not for developers, but for testers. Who do not have iPhone SDK / XCode, iTunes only.
(The answer is: you can install ad-hoc app without developer certificate, and can't do it with development app)
Method 1: Install from XCode
The Development Provisioning Profile requires you to run the app (initially) from within XCode.
This has the side-effect of marking the device as being used for development, but also requires you to connect the iPhone/iPod Touch to the machine running XCode. Once you run the app from XCode, the app is installed on the device and you no longer need to be connected to the machine to run it. (Until you want to update the app.)
Method 2: Install from iTunes
An Ad-Hoc provisioning profile allows you to give the app to anyone and let them install it themselves using iTunes. You send them:
the app, and
the Ad-Hoc Provisioning Profile
They select these two and drag them onto iTunes. Then sync.
Later, you can give them an updated version of the app only (without the Ad-Hoc Provisioning Profile, since they've already installed that on their device) and they can drag the new app onto the iTunes icon to install the new version.
One limitation to Ad-Hoc distribution, is that it requires you to enter each Device ID into the iPhone Development Portal. And there is a limit to 100 device IDs per year (you cannot erase any IDs, until your next year begins -- only add them). The 100-ID limit will not be a hindrance for most developers, just keep in mind that you need to get the device ID ahead of time, before you create the Ad-Hoc Provisioning Profile to send to the person you want to install your app.

Is the distribution provisioning profile associated with the iPhone device?

I installed the distribution (for Appstore) provisioning profile in Xcode, but it doesn't show up under Devices, only the Developer provisioning profile shows up. I cannot "Build and Go" with the distribution provisioning profile in Xcode either, however, "Build" does work.
Is this the correct behavior?
That's right. You can only use this profile to build App Store builds. For your testing you need a development profile. The distribution provisioning profile has nothing to do with the devices you registered on the iPhone development site.