How do I build an xcode project for the itunes store? - iphone

I've got my apps running on my iphone, great, however to list on the itunes store I need the "universal binary" thing.
I've tried finding answers, but I can't seem to find a concise useable explanation to doing this in xcode. I always get errors when I try to build a binary. Can anyone point me towards a basic step-by-step procedure I can follow to creating a universal executable binary which can be uploaded on the itunes store?
One more thing, is there some type of app, like the rename project app, or applescript thing, that can do this for me with a few clicks?

Try this:
Prepare a new provisioning profile for App Store
Make sure you have Ad Hoc distribution working OK.
Go onto the Program Portal > Provisioning > Distribution
New Profile button
Distribution Method: App Store
Profile Name: MyApp App Store (or whatever)
App ID: MyApp (you have already created one right?)
Submit button
Set up the new profile/configuration in XCode
Download the certificate (you can click on the Distribution tab to reload that tab while it's being generated) and load it into XCode
In XCode, open your project and go to Project > Edit Project Settings (or double-click on the first item under Groups & Files panel)
Configurations tab, click on your existing Ad Hoc distribution configuration, that already works, and click Duplicate button. Call the new one "App Store"
Click on Build tab, then under Code Signing > Code Signing Entity in the popup choose "iPhone Distribution - MyCompanyName" under "MyApp App Store"
Build & Upload to iTunes Connect
Clean all for good luck, then set Active Configuration to "App Store", build & go. Test it on your iPhone.
Find your built app in the Finder, in your project directory > build > App Store-iphoneos > MyApp.app ... right click and "Compress MyApp.app"
Upload resulting MyApp.zip to iTunes Connect.

A Universal Binary has nothing to do with it. To distribute through the App Store, you need to create a Distribution provisioning profile. The iPhone developer portal has step-by-step directions for this. look under the "Distribution" tab.

I followed the instructions listed by sbwoodside but had problems with the last part (Build & Upload to iTunes Connect). I realized that the built version didn't run on the device. This is what worked for me:
Build & Upload to iTunes Connect
Clean all for good luck.
Go to "Edit Scheme" and in the Archive menu, select the App Store
build configuration.
Select iOS Device or a specific device in the drop down menu and go
to Product->Archive.
Once Xcode is done archiving, it will open the organizer window and
show the archives section. Select the last archive and click
"Submit".
You will be asked to enter your distribution certificate. Select
the one created for the App Store.
XCode will upload the app to iTunes Connect without the need of
using Application Loader. For this to work, the app has to be in
"Ready to Upload" status in iTunes Connect.
You won't get to test the last version with the device. Therefore it's best to make an ad hoc version before to be able to test all features and once everything is working, duplicate the ad hoc configuration for the app store.

Once you have your provisioning profiles downloaded and installed you need to make some changes within XCode to get the app to work on your iPhone and eventually to submit to the iTunes store. You'll also need to add an Entitlemests.plist object to your project. You also need to tweak your build profile and your info.plist to point to your application name.
But as Mark B already said, just got through the developer portal and follow those instructions. Just make sure your define the right provisioning profile for the purpose.

Related

Preparing Ad Hoc Distribution for my app

I have been reading several tutorials and watching some iTube videos to see how I best prepare my app for Ad Hoc distribution. However the information I got is not really consistent, it goes from the 5 step explanation from the Developer Center of Apple to a almost 3 minutes video, where I would have to set some Code Signing options in XCode, create and zip the Archive etc.
My questions:
1.
Is there a tutorial available, which explains everything required, but not too much? I somehow feel, for instance, that code signing is not really required.
2.
After I tried to install the app using iTunes, the synch claimed that it was not able to install it. Is there some log available in iTunes, so I can check for further error details?
3.
How about switching from Ad Hoc distribution mode to normal developer mode? After I followed the steps from the video and prepared my app for Ad Hoc distribution, I was not able to install it on my device anymore, I got the error
Build target Abiliator
Check dependencies
[BEROR]CodeSign error: code signing is required for product type 'Application' in SDK 'iOS 5.0'
This is the video tutorial on iTube I followed: Demo of iPhone app Ad Hoc distribution
Thanks for your feedback and have a great weekend.
OK, looked up the Error
" the following job tried to hijack the service..." and saw that a reboot of the iPhone may solve the issue... and guess what, I was chasing a phantom all day long.....
It works perfectly.
So last hint for anyone, having a similar issue, after installing an app via Ad Hoc the first time: Reboot iPhone, otherwise the app may crash.
Cheers and now good nite :-)
PS: Just to round this thread up here the steps I did at the end (as mentioned, I am using XCode 4.2.1) :
Added my device on the Provisioning Portal (this had been done long time ago, however it is an important step, as the beta testers device IDs also need to be registered here before you re-create and download the distribution profile)
Created and downloaded an iOS Distribution Certificate in the Provisioning Portal
Imported the certificate in my Keychain
Created a Ad Hoc Provisioning File in the Provisioning Portal
Downloaded that profile
Double clicked the profile, which added it to the XCode Organizer Provisioning Profile Section)
Added the options Any SDK and Any iOS SDK in for Ad Hoc Distribution Code Signing Identity in the Code Signing section of my project AND my target and set the values with my Ad Hoc Provisioning File I just created and imported
Made sure the option in my app .plist file "Application requires iPhone environment" was set to true
Ran a clean (Product / Clean) and then a build only (Product Build)
Made sure the app was not installed on my iPhone (as I was testing before via XCode)
Copied the target (group Products via Show in Finder) to iTunes via Drag and Drop (I dropped it into the Media section)
Copied the Ad Hoc Provisioning File into iTunes via Drag and Drop (also to the Media section)
Made sure the app was checked for the synch, synched iTunes with the iPhone
Lastly rebooted my iPhone! However, I am pretty sure, that this might occur on the Developers device only. I assume that the reason for that was a process, still remaining on the iPhone, from my last test via XCode.
I did not use an entitlements file. I have actually to find out, what that file is really for, I have read that it might be required only, if using iCloud. And XCode 4.2 developers, there is nothing like File / New / Entitlement Template anymore in XCode. The file is created as soon as you check the option Entitlements and give the file your desired name in the Summary tab of your target.
You may also want to download the iPhone Configuration Utility from apple
I will also recommend this to my beta testers, as it allows you to see the console log of the iPhone, which of course might be very helpful in case of errors.
Hope this summary helps others, setting up their app for the first Ad Hoc distribution.
Cheers, René
code signing is simple.
first you create a mobileprovisioning profile for your apps bundle identifier also add the devices you want to built the app for. for adhoc build do it in distibution tab. download it, double click add it to keychain.
now you tak your app in xcode.select coreect profile(code signing). set command line build to distribution, oh i forgot create a new file(entitlements.plist) set debug inside it to false, add its relative path in the target, just above codesigning specified. now select the iosdevice on top left(where you select the simulator) press command+b to build the app. the app would be in the products folder(at the bottom) locate it in finder drag it to itunes, may be provisioning profile too, and sync it. done.
Go to https://developer.apple.com/devcenter/ios/index.action and login. You can find 'iOS provisioning portal'. And after going there, choose 'Distribution' section. Select "HOW TO", you can find necessary steps there.

Submitting app to Apple App Store (iPhone)

I wrote my app and it compiles. I have successfully tested it on my iPhone and in the simulator. So now I want to submit it to App World. I downloaded the Distribution Certificate, and (when Xcode 4.2.1 was minimized) dragged the certificate onto the Xcode dock icon.
When I go to Product -> Archive, it says "Build Succeeded" and gives me the Organizer window. I click "Submit" and sign into iTunes Connect, select my application, but when I go to select the Identity it says "iPhone Distribution (does not match any valid identity/profile pairs)". I configured my app on iTunes Connect (it says "Waiting For Upload").
What am I doing wrong?
You should create a distribution provisioning profile using the Provisioning Profile management site, which you can find at the Apple Development Program portal. After having created this profile, you should open it up with XCode, then open your project and open it's properties (where you set the Icon and stuff) and select the tab "Build Settings". Click "all" and "combined" and then search for Code Signing. Expand it and set your Code Signing Identity (and of course Release and Release => Any iOS SDK) to iPhone Distribution. If all goes good, you should compile the project without any warnings or errors.
Now try uploading your app again, as you have imported your Distribution profile, you should now successfully be able to upload it.

Give iPhone archive to distributor

I've developed an application for an extern distributor. Now, they want to publish the application.
I decided to create an xcarchive of the complete app with Xcode. But I have problems with the bundle identifier. Have I to choose an identifier and the distributor creates the provisiong profile and the certificate?
Would be great if you can tell me what I have to look for!
Your Distributor needs to have a "Company" Apple Developer Account.
They invite you to their organization as a "Member"
You accept their invitation.
the next time you login to developer.apple.come you will be presented with a Team droplist (your team and their team)
Select Their team.
Now, go to the iOS provisioning Portal->Certificates. Generate a Developer Certificate. they will have to approve this, so let them know the request is coming.
Once you have a Developer Certificate they will need to make\modify a Developer Provisioning Profile, with your certificate enabled in the Profile, for the AppID in question.
Once this Profile is created you download it.
Now you have their Full Bundle ID (the GUID and the "com.customer.app")
Now you change Code Sign Identity for Release to "iPhone Developer".
You Build and Archive the app using the Developer Provisioning Profile.
In the Organizer you will see the app you just built, right-click on the app and do a "show in finder".
Zip up the .XCARCHIVE file and send it to your Distributor.
They will unzip and double-click on the .XCARCHIVE file, this will import it into their XCode's Organizer.
From Organizer they can ReSign the app for "iPhone Distribution" using the same Bundle ID that was used to compile the app.
They can distribute it as they see fit.
I'll assume that you're using xCode 4 (or above ) for this.
You're going to want to open your scheme editor (The drop down menu next to the 'Run' and 'Stop' button contains this). Select the 'Archive' scheme and make sure that it's building a release (or distribution ) copy of your app and not a debug version.
The speculative part of the question, it's probably different for each distributor, I'm assuming your distributor is already set up as an iOS Developer (ie they can distribute on the app store already) I just set the bundle identifier to something appropriate com.nameOfDistributor.nameOfApp.
In xCode 4 you don't need to worry about any provisioning profiles etc, or certificates, just archive that up and send it to the distributor. Just send them a note of what the bundle ID was, and they should be able to do all the code signing in xCode themselves if they're using xCode 4 that is.
If the distributor is unhappy with that they usually just email us back and we sort it out. But just archive the release build of the app and send it to them letting them know what you used as a bundle id (also let them know the version number if you've been incrementing that as development has progressed).

Test App on Real iPhone [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Deploy an iphone app from xcode to iphone
Hi I have tested my app using the iOS simulator. How can I test it on my own iphone? I am an Apple developer member.
The first thing you need is a development certificate. Visit the iOS provisioning portal and follow the steps here: http://developer.apple.com/ios/manage/certificates/team/howto.action:
Once that is done, you can do everything else from Xcode. Using Xcode 4:
Connect your device via USB.
Open the Xcode organizer (Window->Organizer)
Select "Provisioning Profiles"
Check the "Automatic Device Provisioning" checkbox and click "Refresh"
You will be prompted to enter your developer account username and password. Do this.
This step will automatically create and download a wildcard (*) provisioning profile that you can use for testing any application on your device.
After a few seconds you should see this new profile appear in the list with the name "Team Provisioning Profile: *"
Restart Xcode just to be safe. Sometimes it can get confused.
Open a project and select your device from the main schemes dropdown box:
Build and run.
If that doesn't work straight away, make sure your target has the correct code signing options. Find your target's build settings and for the Debug configuration choose "iPhone Developer" under the "Automatic Profile Selector" group in the dropdown:
This should be selected by default.
Good luck!
You need to learn about creating Adhoc Distributions for iOS devices for detailed reference. I am however putting all of it here in the answer:
Creating iPhone Ad Hoc Distribution Builds
1. Adding Beta Tester Devices
Apple allows an Ad Hoc build to be distributed to up to 100 devices which they enforce by making you add the devices to the distribution provisioning certificate. This means that you need to retrieve the UDID for all of the test devices, add them to the provisioning profile using the iOS Provisioning Portal and then download and install the profile.
2. Finding the UDID
To get started you need to ask your beta testers to supply the Unique Device ID (UDID) for their devices. To find UDIDs they can follow the steps on:
whatsmyudid.com
3. Registering the Device
Once you have the UDID you need to add it to your account in the iOS Provisioning Portal in the same way you would for a development device. You do this in the Devices section of the portal and can either use the ‘Add Device’ button to manually add a single device or use the Upload Devices button to bulk upload multiple UDIDs from a text file.
Note: If you want to bulk upload multiple devices the format of the text file needs to be as follows with the two columns separated with tabs:
Device ID Device Name
1234567890123456789012345678901234567890 Test_iPad
The contents of the first line are not important but you need to put something as the first line is ignored when you upload.
Also be aware that you can only register up to 100 devices each year. You can delete devices any time you want but once added they still count towards your annual allocation. (So if you add 100 devices and then delete 50 of them you still have to wait until the next year before you can add any more).
4. Creating the Distribution Provisioning Profile
Assuming you already have a distribution certificate the process to create an Ad Hoc provisioning profile is quick and easy. In the Distribution tab of the Provisioning section use the New Profile button.
The only difference between an Ad Hoc profile and a normal App Store profile is the Distribution Method.
Ensure you select the Ad Hoc method and then enter a profile name, the App ID and finally ensure you select all of the devices you want the Ad Hoc build to run on. Once you have finished submitting the profile you should download it and save it somewhere safe as you will need to send it to each of the beta testers. The file should have an extension of .mobileprovision. You should also drag the file onto your Xcode icon to install it, you can use the Xcode organiser to verify that it installed ok. You should see the profile in the Provisioning Profiles section.
5. Building for Ad Hoc Distribution
With the provisioning profiles configured correctly the next step is to prepare the project in Xcode for an Ad Hoc build. It might be useful to create a configuration just for Ad Hoc builds so that you do not have to worry about the details each time. The easiest way to do that is to copy an existing configuration, if you already have a Distribution configuration that is probably a good starting point otherwise you can start from the default “Release” configuration.
With the project open in Xcode, right-click on the target and select “Get Info” to bring up the Info dialog window and select the Build tab and then in the Configuration drop down menu select “Edit Configurations…”
Select an existing configuration (e.g. Release or Distribution) and then at the bottom of the window use the Duplicate button to create a copy of the configuration and name it “AdHoc”.
In the Target Info window ensure this new AdHoc configuration is selected and then adjust the following settings in the Build tab. In the Code Signing section, look for the “Any iOS” setting under Code Signing Identity and make sure it is set to iPhone Distribution and matches the Ad Hoc provisioning profile we installed previously.
6. Entitlements
There is one additional step if your project includes an Entitlements.plist file (perhaps because you needed to enable keychain data sharing). For an Ad Hoc distribution you need to ensure that the get-task-allow flag is not set in the plist file. One way to handle this is to add a second file (Entitlements-adhoc.plist) just for the Ad Hoc build which is identical apart from the get-task-allow flag:
To ensure this new Entitlements file is used you need to modify the Code Signing Entitlements setting in the AdHoc configuration to reference the new file.
7. Build and Archive
With the AdHoc build settings active use the Build and Archive command to create the distribution build. Assuming the build was successful you should find it in the Xcode Organizer in the Archived Applications section. You can add a name and comment to the organizer for future reference at this point.
8. Sharing the Application
The easiest way to send the application files to a beta tester is to use the Xcode organizer to create an ipa file. To do that select the AdHoc build in the Archived Applications section and use the Share button and then select Save to Disk. Xcode will create a signed application file and save it to disk with a name of your choosing. Name the file something useful like appName-x.y.z.ipa where x.y.z is the version number.
You can then send this .ipa file together with the .mobileprovision file to your beta tester with instructions to drag onto their iTunes library to install it on the test device.
For sharing and application versioned release management you can also use testflightapp
You should add your device UUID to your iOS provisioning portal. Create an App id. Create a mobile provisioning profile by selecting your device and App Id. Download and install that profile to your device. The build and run your app on the device. Please let me know if you need further clarification.

Code Sign Error When Building iPhone Application

I am new to iPhone development. I just registered with Apple for the iPhone Developer Program. When I try to build, I am receiving an error:
Code Sign error: a valid provisioning profile matching the application’s identifier could not be found
I'm not sure what is wrong. I tried browsing the Internet but I get confused. Can anyone help me with what I should do?
At first it seems a complex process, but it's pretty straightforward when you've been through it a few times.
In a nutshell the process is this:
(I'm assuming you've set up your iPhone/iPod touch as a test device)
Via the iPhone Developer Portal
Create an App ID
(give your application a name, this is just for reference on the website and nothing to do with your own build of your application)
enter a string to identify it, like com.yourcompany.appname
(this is important and should be the same as in your .plist file inside Xcode)
Click and Save this
Go to Provisioning
There are 2 provisioning profiles you'll need
a) development - so you can install your application on a test device (i.e. your iPhone / iPod touch)
b) distribution - if you want to sell the application via the App Store
You can create the profiles by selecting your App ID, created in the previous step, from the drop down list and clicking Save
In a few moments (usually, though it can be longer) the certificate is available for download. Download this to your Mac and drop it onto the Xcode icon. Sometimes the development profile doesn't work for me like this and I drop it directly into the Organiser window in Xcode that shows my connected device.
Besides, if you are in a team account, team admin need to edit Development Provisioning Profiles, and add modify your certificates privilege.
In Xcode inside 'Edit Project Settings' you can select the certificate you wish to code sign with. Usually for debug I sign with the development certificate. Follow the instructions on the apple site and clone the release profile and call it something like release and sign this with your distribution profile. (You won't be able to load the app onto your phone with the distribution profile selected)
Make sure you select the target device as Device and not Simulator when building for the App Store!
Hope that helps, it's from memory so apologies if I've skipped some small steps.
xcode top left corner make sure you're running as "similator" "iphone"
Did you set up an iPhone provisioning profile for either development, ad hoc distribution, or app store distribution?
If not go to the iPhone developer program portal, which is linked from the developer.apple.com/iphone. Apple has provided a great series of video tutorials.
Just make sure you install the certificates or the profile won't be selectable in the project configuration. When you download the certificates double-click on them to install.
Possibly more use for others seeing this issue on a previously configured dev environment.
This error is also shown if your provisioning profile has expired, in this case you can go through the steps in Neosionnach's answer or you can go to Organizer, click on the profile and click Refresh.
This was the winner for me when I had this issue.
As of July 2012, you can go here:
https://developer.apple.com/ios/manage/overview/index.action
Then launch the "Development Provisioning Assistant." It walks through all the steps outlined by FiddleMeRagged.
You can use this process to create a Wildcard ID, if you're just looking to test your app on your iOS device and don't need to deploy to the App Store right away.