Xcode 4 Ad-Hoc Distribution - Unable to Download - xcode4

I had recently upgrade our development machine to Xcode4 and after the initial interface change has gone quite smoothly.
I'm now in the process of using Ad-Hoc distribution on it for the first time so I followed this guide to set up profiles/schemes etc. http://diaryofacodemonkey.ruprect.com/2011/03/18/ad-hoc-app-distribution-with-xcode-4/
This is the process I took:
1/ Setup a new provisioning profile under distribution. I selected Ad-Hoc, the correct App and my UUIDs.
2/ Installed the profile within Xcode 4.
3/ In xcode duplicated the Release Configuration and named it Ad-Hoc.
4/ Under Code-Signing made sure Ad-Hoc had the new profile selected.
5/ Edit Archive scheme and selected 'Ad-Hoc' Build Configuration.
6/ Select Product > Archive and made sure the profile listed was correct.
7/ On save screen selected 'enterprise distribution' and entered the App URL and Title.
8/ Copied the resulting ipa archive, plist and mobileprovision (downloaded in point 1) to our http server.
9/ Added the required html to and pointed mobile Safari to it.
10/ Selected the mobileprovision which installed without a problem.
11/ Selected the App which begins to install resulting in "Unable to Download" at about 90%.
I've tried several potential solutions from other posts but they all result in the same thing. This is used to work fine in Xcode 3 (using normal developer account, NOT enterprise) and as far I can tell I'm not really doing anything different so what am I doing wrong?
Thanks.

Try this: Open the Scheme you are using to edit it. Then check if in ALL the build phases (Build, Run, Test, Profile, ...) the Build Configuration is set correctly. If not set it to the correct configuration and build it again.
If this does not work ad a new Entitlements.plist to your project and add a new value with the key get-task-allow to NO.
Edit: Have you tried to make Product > Build For > Build For Archiving and then Product > Archive.
This worked for me.

we just had the same problem (and we still have it for one device only working on iOS5 Beta, not sure if it is related. All other devices work.), some tips that could help :
Apple dev site:
your provisioning profile could need to be renewed on the apple web site.
on the apple web site check that the device is linked to the provisional profile in the "Device" section. In the "provisional profile" section, the "Edit" feature could lie to you. To add a missing device to a provisional profile, go the "provisional profile" section then uncheck and check back the missing device (the lying part from apple web site ;))
in xcode:
I switched deployment target OS from 4.0 to 4.2
I plugged my iPhone and selected it as target before to create the archive.
this issue doesn't depend on the "team provisioning file", we could build a working archive with another provisioning file too.
If it can help too, I created a doc for distributing the Moodle app but it's generic to any app I guess: http://docs.moodle.org/dev/how_to_distribute_iPhone_test_app

Related

Install claimed to have succeeded, but application could not be found on device Xcode 11

Just after switching from Xcode 10 to 11, I am unable to install my app on any device
The error at launch time after installation succeeded says :
Install claimed to have succeeded, but application could not be found on device.
Details says :
Could not locate installed application
Domain: com.apple.platform.iphoneos
Code: -1
Recovery Suggestion: Install claimed to have succeeded, but application could not be found on device. bundleId = myBundleId
--
Installed application was not present in database of installed apps after multiple lookup attempts.
Domain: com.apple.platform.iphoneos
Code: -1
However everything works fine on a simulator.
I tried to delete derived data, clean project, delete the app ..
Very strange : After submitting the app to testlfight I can download it and it works.
But when I build a new app to Xcode it launch the app just downloaded from tesflight and not the version pushed via Xcode ..
For me, it's a problem with ipatool.
Here's a way to find out details why it failed to create a proper iPhone App (.ipa) file from the build output/Xcode archive:
Go to Product > Archive, then open Window > Organizer > Distribute App.
It should show you "IPA processing failed" with a big red error symbol.
Now, open the logs and search along these lines:
timestamp Assertion failed: Expected n archs in otool output:
and
timestamp /Path/to/ Xcode-beta.app/Contents/Developer/usr/bin/ipatool exited with 1
While this can't be the final solution, try removing all problematic libraries mentioned in the logs between the two lines until ipatool exists successfully.
I also had this issue/error message. I realized that I had automatic signing deactivated and I had selected a provisioning profil with a distribution certificate.
Solution:
So if you want to run the app on your iphone directly from Xcode (not through testflight) you have to make sure you use a provisioning profil with a developer certificate.
This is probably not the case for most people facing this issue, but I faced it once several days ago and easily dealt with it by cleaning the build folder and switching to a legacy build. The second time I faced it, none of the suggested solutions seemed to be working.
I then noticed that because I'd almost run out of storage on my device, iOS had "offloaded" almost all of my apps. If there is a small cloud under your apps and the app needs to "install" again before launching, then this is the case with your phone too. Trying to launch all of the apps that I don't use regularly (so I never noticed the little clouds) "reinstalled" all of them and solved the issue entirely. Maybe this helps someone facing this for similar reasons.
I have the same problem,I modify the project setting
File --> Workspace Setting --> Build System --> Legacy Build System
it's OK for me
I also got this alert. That's because i run the app in release Build Configuration, but with a appstore Provisioning Profile . It's not allowed. So i change the appstore Provisioning Profile to a dev Profile. Then everything is ok.
Hope this can help you.
I found a way to solve this problem. After I upgraded iOS 13.1, the real machine also ran. Later, I found out that because I had archive operation the day before, the real machine running certificate changed from distribution mode to development mode and everything worked normally.
For my case (xcode 11, ios 12.4), change the Bundle identifier can solve this issue...
Before changing Bundle id, I've tried
using beta xcode
deleting app on iphone
deleting derived data
cleaning project
reopen xcode
Here's another solution. I had previously installed three other apps using XCode and got this error message when I tried to install a fourth.
I simply deleted one of my three existing apps (after hours of hair pulling and SO searching) and tried again. It worked.
Platform: iPad 2018 on v13.1 with XCode v11.1,
I was using different signing team/certificate for ...Tests target.
Setting the same for main target helped.
Update pods if you have.
pod update
just it.

Do I need two Provisioning Profiles?

I've got a Provisioning Profile for distribution com.mycomapnyname.myappname
Now I want to test my app in my iPad and I did all steps- Get certificate - Add my device - create an AppId - and finally create a Development Profile called My Applications (to sets all apps), so I've got a Distribution Profile and a development Profile.
The bundle identifier for distribution is com.mycomapnyname.myappname
The bundle identifier for developer is com.mycomapnyname.*
In Library Provisioning Profiles I've got both.
In Ipad Provisioning profile I've got just My Applications Profile
When I try to run it on my iPad I set in Targets - Build Settings:
Code Signing / Debug / Any iOS SDK = iPhone developer matching with My Applications
Code Signing / Distribution / Any iOS SDK = iPhone distribution identity
in Targets / Info:
Bundle identifier: com.mycomapnyname.myappname
Finally when I want to run my project (setting to run it on my iPad) I've got the error:
"A valid provisioning profile for this executable was not found."
It's a king of mess for me, can anyone help me to be able to run in on my device?
I run other app on my device, but following a tutorial and creating a new app, but I can't run my own app in my device for testing.
Thanks in advance ;-)
No you don't unless you like to setup wild cards for each app which is confusing.
Try this it may help. In xcode go to organizer and then select provisioning profile section. Try to refresh that. It will connect to Dev portal and download your current profiles. Then with your device connected try clicking on the name of the device and make sure your device gets detected by xcode. If it says use for developing click on that and it will also refresh the provisioning profile on your device. That should re sync everything. If this dies not work let me know and I'll get on my Mac and see how I can help you more.
Adrian

Packaging Operation Failed in Xcode 4

When I use Xcode 4 to create an app IPA fie, I go to Product --> Archive to get an Xcode Archive. I recently read the SO post here detailing on how to distribute an app in the AppStore. I followed the instructions in this post and my errors still persist.
First, I begin with validation. When I click Validate I login, elect the correct code signing ID and then get the following error:
I get the same error message when I attempt to distribute to the AppStore.
Any ideas as to why I cannot share and/or distribute my app?
EDIT
Previously, I was having trouble validating and distributing and as a result I would receive this error:
I fixed this problem by finishing my CCATs / Encryption Registration in iTunes Connect.
I got the same error and found this solution (Xcode 4.4).
In Build Settings/Code Signing I had "Don't Code Sign" in my first Archive attempt.
I then put a valid Distribution Certificate (in the Release identity) and, after Archiving, validation of package went flawless.
Thanks to Apple that at every release does something (undocumented) different from the previous version.
Cheers.
Couple months late, but in case someone else encounters this problem and finds this question (as I did) and none of the other suggestions work for you. After reading the other answers, there seem to be multiple causes for this error.
In my case, it was because my project's scheme had its Archive build configuration set to Release, instead of Distribution. After changing this to Distribution, I was able to submit the app without issues.
Hope this helps someone else.
I had similar situation and standard solutions like removing files with prefix _. and certificate experimenting did not lead into success.
Build distribution of English version worked, but localised to Croatian did not. So I used heavy weapon. I installed Croatian keyboard layout. And guess what? Since that moment all worked out!
So maybe there was something else in the place, but I would suggest you at least to check if this matches your situation.
Possible error with your certificate/provisioning profiles. Here is a short summary of my certificate quest with Xcode 4.3:
Make certain (in developer.apple.com) that you have created a distribution certificate
Make certain your application id in Xcode matches perfectly the one in developer.apple.com
Create your app in itunesconnect.apple.com
Load the distribution certificate in your keyChain create a distribution provisioning profile for your app (make certain you add all devices when creating the provisioning profile)
Drag the provisioning profile in Xcode organizer, LIBRARY section, Provisioning Profiles.
Make your archive.
In Xcode organizer, validate your app, then distribute it for ad-hoc.
Eventually (if you are patient) Xcode will offer to save the IPA somewhere. Save it, place the IPA in a place where your testers can download it.
After download, the tester can drag the IPA in iTunes (LIBRARY), and eventually sync up the device (if and only if their device UDID was checked when you created/modified the provisioning profile).
more or less. Best of luck.
ps. there is a free app in AppStore , Get UDID. Ask your testers to use that and email you the devices specifics, will save you tons of frustrations with the 40'ish characters long device ID.
It happnes to me when I've try distribute app from Xcode DEVELOPER PREVIEW.
From actual version of XCode - everything works fine.
I was also seeing this inexplicable error, and tried all of the suggestions here with no success. I finally went and deleted my local certificates and provisioning profiles and downloaded them again from Apple's provisioning website. After making sure the code signing options were set correctly in my build settings, I cleaned the project and archived again and this time the error disappeared when I ran the validation step.
Check if the code signing entries are correct (containing the distribution profile) for both the project and the target. It is possible to archive the project even if only the project settings are correct.
To me the answer came after trying to validate my app after unsuccessfully submitting it to the MacAppStore. I thought that by validating it, I should get a more detailed error message, instead ot this "Packaging operation error". And here it comes:
And that was because I had to revoke my certificates (as for why I had to revoke them, don't ask, I don't know, it happens in one every 2 submissions...). And I had recreated only the Mac Submission certificate. Actually, you also need the Installer one. It waqs late, I thought do I really need this?... Hence I finally made twice the little dance in Keychain.app -> Request Certificate from a Certificate Authority... etc, uploading to itunesconnect, and downloading them back. After that, it worked.

Distribution Provisioning Profile not showing up in code signing identity selection in Xcode 4

I have followed all steps carefully mentioned in the iOS provisioning portal. The biggest problem is that those steps are not updated to the latest version of XCode.
In Xcode's organizer, the distribution profile is showing up in Library>Provisioning profiles. But when I go to iPod Touch > Provisioning profiles, it's not there. (I don't know if this information is relevant, just mentioned to make sure I don't miss anything).
To distribute the app with this new provisioning profile, I have to change the Code Sign Identity in the app configuration to this distribution provisioning profile but I can't see it anywhere in the menu. It's just not there, where is it? How can I can build my app with this distribution provisioning profile?
I did everything from beginning for at least 2 times. Still no success.
Is there any step by step tutorial to do this in XCode 4? Please help! I am going insane.
In the Navigator view, select your project name, then go to Build Settings for your target. In the drop-down under Code Signing Identity, select the developer identity you want to build with...if you have multiple provisioning profiles, select the developer identity under the appropriate provision you want to use. You can see all your provisioning profiles in this drop-down.
If you cannot select a developer identity under the provision you want to use, you might check your Bundle identifier in your Info.plist.
Make sure your iPod Touch's UDID is added to your provisioning profile as well.
I solved this problem by switching targets. After clicking on the blue project icon in the project navigator, there are 2 rows with thin icons in the main viewing area. Make sure your whole project (the BLUE icon) is selected in the second row, not just the main target (the drafting tools icon).
So this:
Not this:

XCode4 does not produces archives. At all

I am attempting to create my first ever app to be tested/deployed via:
XCode 4.0.1
TestFlight
I cannot get archive to actually produce an archive in XCode.
It always says it has succeeded in building the archive (see image), but I cannot find it in the Organiser and it doesn't appear in Finder either.
I am doing it for Ad Hoc distribution as per TestFlight instructions for Xcode4
I have done the following.
Created development certificate for the app
Created app ID for the app
Assigned a device The green lights appear for Enabled for
development and Enabled for Production, and Game Center / In App
Purchase are active/green.
Created a development provisioning profile
Downloaded all provisioning profiles.
I can launch the app successfully in my device.
Now we get onto distribution.
In certificates, created a 'Current Distribution Certificate' for
the app
In provision, created a 'Distribution profile' where 'Ad hoc' is
selected, the app id is selected and the device is selected
Now we get onto following the TestFlight instructions for XCode4
I can do everything except the last part,
Archiving and Packaging
1. Select the iOS Device option in the Schemes drop-down
Under the Product menu, select Archive
In the Organizer window that appears (go to Window -> Organizer if
it does not), select Archives at the top, your application on the
left, and the most recent archive at the bottom, and click Share
It simply does not list/show or apparently create the archive.
I ensured that the archive and all adhoc setup is as the instructions say.
I clean the product, save it as a workspace (this is not in the TestFlight docs, but in Apple's docs), and verify again that it will deploy in the device.
But when I try to archive it, no archive ever appears.
I have no idea how to solve this, its really annoying.
One video I've seen shows a guy click "Enable entitlements", but I cannot find this option -- is this only in the latest Xcode?
There must be an easier way to do all this!
Any help on this would be very useful.
Edits:
I have a video of the process I have taken, if people are interested.
I have no idea what I am doing wrong.
I can find no video that documents this specific process.
A full breakdown of the exact steps I do and use;
Steps #date: 05-10-2011
Sidebar: Certificates > [Distribution tab]
Clicked Request certificate button
Generate CSR with keychain Online certificate status protocol =
off Certificate revocation list = off
a. Request CSR from Certifcate Authority b. Enter credentials
EXACTLY as they are when I signed up to Apple c. Keysize = 2048,
Algorithm = RSA
Upload this CSR via "Choose file" button & submit
Download 'distribution_identity.cer'
Double click, it say "Do you want to add the certificate from the
file 'distribution_identify.cer' to a keychain?" with "login"
selected. I press OK.
Sidebar: Provisioning > [Distribution provisioning tab]
Click new profile
Select 'Ad hoc'
Enter profile name of "{name of app profile}"
Select App ID of "helloWorld_3oct"
Select iPod to distribute to. Note: it says "the final application
will run only on these selected devices." Note: Not sure if I'm meant
to say "Yes" but I do anyway.
Distribution provisioning profile is now created.
Download the "{nameofapp}.mobileprovision"
Double click on it.
It now appears in the organizer
Close organizer.
Open project.
Add icon and icon#2x.png to project. They appear in .plist file
for the project They also appear under Targets > Summary
Under project > info
a. Create duplicate release configuration b. Name it "Ad Hoc"
Under project > build settings
a. Make sure everything is set under "iPhone distribution (Amarjit
Deo)" no codes appear in this title. ie: In the development one there
is a code in brackets next to the name.
Under targets > build settings
a. Change code signing identity to "iPhone distribution (Amarjit Deo)"
no codes appear in this title.
Go to Edit Schemes.
In Archive select Build configuration to be "Ad Hoc"
Press "OK"
Make sure "iOS device" is selected (it is not plugged in)
Run Product > Clean
Run Product > Archive.
No errors. Success is reported.
Go to organizer.
No product archives exist at all in the organizer.
Try doing skip install trick Tried Yes/No/Yes combination for
both product & target, then Product > Archive = No archive Tried all
permutations, still no joy.
I've resolved the issue now!
Okay, it turns out either XCode was corrupted in download or was conflicting with earlier builds (Even if you uninstall it for some odd reason).
Here's what I did.
1) Re-downloaded XCode (via a better/faster connected line, ie: University)
2) Used
sudo /Developer/Library/uninstall-devtools --mode=all
To uninstall Xcode.
3) Removed all references to XCode that I could find.
For some reason Xcode installed in Developer and Developer (null) so both these folders I deleted.
4) Checked existence of ~/Library/Developer/Xcode/Archives and deleted this folder
5) Cleared out all keychain certificates and re-downloaded all required certificates, including the ones at this address
http://www.apple.com/certificateauthority/
6) Went through the entire process with a fine tooth comb, ensured and double checked everything.
7) Got an archive for a simple app!
Picture included.
Thank goodness for that. I'm backing up my computer and all these files and I'm going onto the next stage, TestFlight!

Resources