Problems creating an ipa file - ios

I want to create an ipa file but I get the following error message. Maybee someone knows what's going on here? Or just a hint where the error might be.

Sometimes it may happen that Xcode Archiver fails to generate ipa file. Then here is the another option.
Build the application.
After successful build go to "Products" folder in your project navigator.
Right click on it and go to "Show in Finder".
Copy the .app file.
Create a new folder at some other location lets say on Desktop with name "Payload".
Paste that .app file in Payload folder.
Zip the Payload folder.
Rename that zipped folder with .ipa
Thats it.
Reverse procedure is used to retrieve the app file from an ipa file.
Hope this answer helps.

Check to make sure you have changed your Code Signing Identity to a Distribution profile, rather than your Developer profile cert. You need to explicitly create a Distribution cert in the provisioning areas of the Apple Developer website.
Here are two links that are pretty helpful, first and second.

Related

Is that safe to share .xcarchive?

I`m somehow amateur in Xcode and this matter is so important for me.
My Friend use his developer id to publish my app and he ask me to give him .xcarchive instead *.ipa file
As I read in stackoverflow topics .xcarchive have the same content of ipa and there is no concern about lose and steal source code.
But when I check my xcarchive and use show content option I see most of project files like images and sources in application folder , also some of my code are in *.nib files
Is that normal ? and if I extract ipa if I get the same result ?
Is there any security or tips in Xcode that better to active before archive project ?
It is normal. In order to publish your app, your friend really needs the xcarchive, because they need to export an IPA file with the appropriate provisioning profile and signed with their code signing identity. Although it's possible to replace the provisioning profile in an IPA file and re-sign it again, it's a daunting task you don't want any of your friends to do. If you trust your friend with publishing your app, you should trust them and share the xcarchive.
When you compare the contents of xcarchive and IPA files, you can see xcarchive contains a dSYMs folder with dSYM files used to desymbolicate your crash logs -- the developer needs that to know in what file and at what line number the application crashed.

Add file to already packaged .ipa

As the title says I'm looking for ways to add an additional file to an already packaged .ipa.
We need this for an in-house app to add a saml certificate to the ipa so that the user doesn't need username/password any more to log in.
Adding the file on the server when the download request comes from the user isn't the issue, the problem is, that the ipa won't install on the device any more.
I've read in the Apple documentation that you can omit certain files from being signed, so I extracted the ipa using "The Unarchiver" on a Mac, and added the following to the ResourceRules.plist;
saml.txt
omit
weight
200
I also tried omitting all txt files, as described here: http://lists.apple.com/archives/xcode-users/2011/Apr/msg00277.html
(^Resources/.*.txt
omit YES
weight 200")
First off, I don't really know what rule the weight property plays. I wasn't able to find any documentation about this.
Anyways, I saved the file, compressed the Payload again using the tools OS X provides and renamed it to the required ipa filename.
Unfortunately, the ipa won't install on a device. It downloads fine, but installation fails.
What am I doing wrong here and how to I overcome this issue?
Since it probably matters, the ipa is generated with Flash Builder, so I don't have all the build settings available that XCode has.
If someone's got a hint, please let me know!
Cheers!
Finally found a proper solution.
This is a step by step guide to add or alter files to the already packaged ipa;
Rename the .ipa package to .zip
Extract the .zip package
Go into the Payload's app content's directory and change the ResourceRules.plist file to your needs. In our case, we needed to add another file to the list of excluded files.
File.txt
omit
weight
10000
Using Apple's codesign, re-sign the package with the new ResourceRules:
codesign -f -s "iPhone Distribution: cert name" --resource-rules "Payload/AppName.app/ResourceRules.plist" "Payload/AppName.app"
Zip the Payload again.
That's basically it. Now you can alter "File.txt" as long as you want without invalidating the ipa package.
.ipa file is a packaged "zip" files in other words. Which contains all of your application codes and all the .h & .m files. So it is basically a zip file of your complete xcode project.
Now once the file is zipped (.ipa) file its not possible to add any thing till the time the file has been extracted.
And no one in the world except Apple can do add files to a .ipa file.
Hope this will help you.

iOS App distribution - Archiving an .ipa file

I have an .ipa file which is signed with an Enterprise Certificate and using an inHouse distribution profile. I do not have the original source code with me. When I went through the distribution article in Dev center, I understood that it has to be archived for distribution purpose. I do not know how to archive an .ipa file. Could you please assist me in this? I'm new to this iOS development world.
I am going to assume everything was built and signed properly, with the proper provisioning profiles and distribution certificates.
You need the myApp.ipa and the myApp.plist generated by XCode, there may be others ways, but generating these via Xcode is the easiest. Once you have both of these files, upload them to your server (e.g. public_html/app/myApp.ipa and public_html/app/myApp.plist).
Your users navigate to your download page via Safari. On this page you include a link like the following:
Install the app
It is pointing to the myApp.plist. This must have (among other things) an item like the following (not sure about the exact format at the moment, but it is easy to spot if you open the .plist file in text editor):
<key>url</key>
<string>http://mydomain.com/app/myApp.ipa</string>
This URL is also usually added during the archive in XCode, but it can be easliy edited. It points to the .ipa (which really a zip file containg the executable and other resources like images).
When users tap "Install the app" in Safari, it will read the plist file, and if everything was successful up to this point, will prompt the user to install the application.

iOS App loader - what file type should be uploaded

I have always been uploading iOS apps to appstore from XCode Organizer. That is pretty simple process. And we do not see any IPA or APP file is created. Now my client is trying himself to upload the app using app loader and is continuously asking for an IPA file. Now I have some specific questions -
Does app loader exist now-a-days ? Is it a different program out of XCode?
If it does, what file it takes from me to upload to appstore? An IPA?
How do I create the file for appstore? Note that I have the distribution certificate and appstore provisioning files installed and set in my release configuration. And I am sure if I have tried with XCode it would upload already. But, client not allowing me to do that. He will do it using app loader.
Special Notes -
1. Please do not give me links to an apple documentation, they do not talk about file type and how to create that. They always say "binary". Their doc titles does not reflect the content.
2. Please do not show me the Ad Hoc build process, that is not what I am asking.
3. Please only reply if you have used app loader before.
Application Loader is present in the Utilties folder.
For XCode 4.5 go to
XCode -> Right Click and select Show Package Contents
then go to Contents -> Applications -> Application Loader.
When you just do a build from Xcode, you get .app file.
To create .ipa from it follow below process:
On "/" create a folder named Payload
Copy your .app and .mobileprovision files in this folder.
Open terminal, go to / and run following command
zip -9 -y -r appName.ipa Payload/
This will create file "appName.ipa" on /
Yes and Yes.
As far as I know, it takes a compressed .app file.
In Xcode go to Products and select "show in finder". Then compress the file with a right click. The result should be uploaded with application loader. The result is located in the Library directory. Depending on your settings this can be hidden from application loader. Therefore you should copy the compressed file to a directory which is accessible from any program (like the desktop).

Ipa creation using any script(ipa creation from other ipa )

basically my project based on books(combination of pdf's and xml's). Due to some reasons we are maintaining more than ten provisioning profiles.when ever new device udid comes up we need to create another provisioning profile(as per the requirement). For each time building i need to put some provisioning and replacing books in my xcode, this is causing more time consuming. I seen many scripts but all those not full filling the scenario.
Questions:
1.Is it possible to develop another application (mac osx) to make ipa which is taking an input of provisioning file, my code(ios) and books then compile finally giving output as .ipa file for giving code?
2.is any other way to reduce time consuming for the ipa creation?
If any possible please give me some idea to make it true , your suggestions is also more important on this.Thanks in advance to every one.
new question for generating Ipa from other ipa file
I followed your approach,But can any one please let me know ,i created a ipa file and now i want to modify the content of ipa and also provisioning profile will it possible?
If you have an ipa created using older provisioning profile and the code hasn't changed between getting next provisioning profile then there is a way to do it.
You can write a script from following steps:
1) Change the .ipa that you already have to .zip and extract zip contents. This would reveal Payload folder that has YourApp.app folder
2) Right click on YourApp.app folder and show package contents
3) find embedded.mobileprovision and delete it. Drag your new .mobileprovision file into this location and rename it to say embedded.mobileprovision.
4) Find and delete any _CodeSignature or CodeResources files/folders
5) From terminal delete .DS_Store files in Payload and YourApp.app folder
6) Use Codesign utility in /usr/bin/codesign to codesign your .app. Here is command for it:
codesign -f -s "iPhone Distribution: Your company Name" PathToYourApp
In your keychain utility find the certificate name that is used to create the distribution profile and match it to first argument in codesign -f -s
7) finally zip the payload to form an ipa
zip -r YourApp.ipa Payload

Resources