How can I install a Mac provisioning profile in AzureDevops? - macos

We have previously been using the "Install Apple Provisioning Profile" task in our Azure Pipeline build to install a Mac provisioning profile *.provisionprofile. (https://learn.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/install-apple-provisioning-profile?view=azure-devops)
However, as of today the build is failing during the Pre-job step with the following error:
##[error]Error: Provisioning profile file should have the extension '.mobileprovision'
Having checked, I don't think that we've changed anything to affect this, so I was wondering if this is an outside change to the step, and if anyone knows of a work-around?
(For mobile development the provisioning profile file would be *.mobileprovision, but the Mac development ones aren't so I don't know if changing the file extension would work?)

I've posted the question here too on the Azure pipelines tasks github (related to the InstallAppleProvisioningProfileV1 task): https://github.com/microsoft/azure-pipelines-tasks/issues/13104
It looks like the issue has been fixed already in their repository, and we need to wait to get the next update.
I'll update the reply if the instructions change at all, but it looks like we may get the fix on the next release.

Related

Xcode 10 - "Unknown Name" for team

In my projects target settings, when I select the provisioning profile I use to archive my application, I get a Unknown Name in the team field.
This is a provisionning profile my client sent me by email, and I do not have access to it's Apple Developer Account.
Does anyone know how I can fix this?
Is there a way for my client to send me a "team provisioning profile" or so?
Note: This does not prevent me to build/archive my project through Xcode. However, when trying to use xcodebuild command for continuous integration purposes, I get an error ( and I'm pretty sure it's linked to this weird configuration )
UPDATE
I finally managed to make my xcodebuild command to work. It had nothing to do with this weird behavious in Xcode config. Also when unzipping my app archive, I can see that the embedded provisionning profile contains the good team name.
To sum up, this "error" doesn't prevent build to proceed. This is just Xcode being Xcode, I guess.

Xcode 6 continuous integration can't find provisioning profile

With Xcode 5 i was able to manually copy the profiles to where they needed to be. This is not the case with Xcode 6. I have added the server to the team and still cannot build. I can build fine from Xcode on the same machine. I get the following message:
Code Sign error: No matching provisioning profiles found: No provisioning profiles containing one of the following signing identities was found:
It should work since Xcode works but Apple keeps hiding these settings more and more and I'm left without a way to troubleshoot this.
It turns out I manually needed to copy the profiles to a new directory in /Library/Developer/XcodeServer/ProvisioningProfiles. Now I'm getting an error because "codesign" can't access the new special keychain apple is using for server, I can't access it either. Xcode 6.1 has a fix but I need server 4.0... It seems I can hack it but not sure if that's worth it or I should wait.

Xcode 6: No provisioning profiles found for AdHoc distribution build; after healthkit entitlements added

I updated to Xcode 6's final release last week, and all as gone well. I've been able to build my code, generate adhoc distribution builds (for legacy Testflight), etc.
Today I added some healthkit code, and had to enable HealthKit in the AppId to do the full build. After I did this, Xcode is refusing to Distribute the build I've just archived to create the final .ipa file. I get the error below no matter what now.
What I've done to try to fix this, as various tests:
regenerated my apps Distribution provisioning profile for adhoc release.
deleted all previous Xcode provisioning profiles, reinstalled and reimported all the provisioning profiles. The updated profile is present for sure.
changed the Team in the General settings, and changed it back to the correct one; allowed Xcode to try to "Fix" the issue.
Updated "build settings" to have the correct Distribution provisioning profile for Release, which Archives use. Confirmed code signing is correct for the Team
Tried "Automatic" for provisioning profile and code signing, as an alternate.
close and restart Xcode
None of this has helped generate the .ipa again, which worked before adding Healthkit support and invaliding all this.
How am I supposed to fix this to properly generate my ipa builds again?
EDIT
I was able to get an IPA built by installing an XC generated provisioning profile that appears to match my Distribution Adhoc profile entirely, except that it includes ALL the user devices I have in the portal, including ones that have long since been phased out (ex-employees). The only difference is the desired profile excludes about half the devices. I'd prefer not to have to do this.
I'm facing more or less similar problems since i started using XCode6. Before XC6, i could use my ad-hoc distribution provisioning profile that was linked to a limited number of devices to create an ad-hoc distribution.
Since XC6, I get the same error message as above, while at the same time Xcode generates its own XC Ad-hoc provisioning profile. From that moment on, when you try again,this XC generated profile is always used and you don't get the error anymore. But of course, at that moment it is using a profile that links to all my registered devices, which i do not want.
No matter what i have tried, eg removing all profiles, it keeps on generating and using that XC generated profile that links to all registered devices.
It gets worse: as a workaround, i tried to modify the XC generated profile and simply remove the devices i don't want. After refreshing in XCode and creating an adhoc distribution, I get the same error again stating that no profiles can be found. Again Xcode generates its own XC-adhoc profile, which of course already existed, and again all devices are linked back to that XC-adhoc profile...
FYI: i don't use anything like Healthkit or so, just default features.
Strictly speaking, it is not blocking from creating an adhoc distribution, but also in my case I have registered devices which belong to different customers, which means i prefer to limit the number of devices for a particular adhoc distribution.
Did you enable HealthKit in the apple developer portal in the app id and update your provision profile?
You need to activate that, and update your provision profile.

problems with continuous integration in xcode 5

I am just learning how to setup my continuous integration bots in xcode 5 and having a really bad time. First, I was having problems with code signing identities, but after reading this great blog post, that problem disappeared.
Post:
http://matt.vlasach.com/xcode-bots-hosted-git-repositories-and-automated-testflight-builds/#comment-21
Now, after fixing those errors, other errors appeared. Every time I integrate, I get a warning like this:
The file "Pods.xcconfig" couldn't be opened because there is no such file.
And I also get an error, saying a header for a pod is not found. I assume this error is a consequence of the previous warning.
Everything works perfect locally, running on devices, archiving, the problem only happens when i try to integrate with the bots.
Should I add something to the PodFile? or is it something on the osx server itself?
I really need help before I go crazy about this!!
Thank you.
Better solution is to add a new scheme, which is used only via server (duplicate your normal scheme). Then select option manage schemes, expand 'build' and add new Pre-action with following code:
cd ${SRCROOT}
echo "Installing Pods"
pod install
You can update and many other things over here. The only problem is that the build where it updates has old content, you have to once again tap integrate. Remember to keep this scheme shared.
--edit--
You ofc have to commit this and run bot on this scheme (you can change it in your server -> safari local xcode bot url -> settings -> scheme.
You are receiving this error because your mac server doesn't have the pods created in the directory that the Xcode bot is checking them out into. This is as expected because it would be odd to check-in the results of the pod install into your source control system. I wasn't able to find a way for the BOT to run the pod install/update commands so I came up with the following workaround:
Ensure your bot is configured to NOT clean before each integration
Run your bot then search through the resulting logs for the path that files are being checked out to.
Search for "IDEDerivedDataPathOverride" That path will end in /DerivedData, if you look in the parent folder of that you will see a "source" folder. This is where your bot will continue to checkout updates for your project
Note: The source directory is owned by your server user, you will need to access it as that user. Use the su command to do so
Install cocoapods on your mac server if you haven't already
On the mac server, in the source directory found above, navigate to where your Podfile is located
Run pod install and ensure all your specified pods are installed
Double check the file permissions of the newly created pod directories and ensure they are owned by the same user as the other files. Use chown to fix if necessary
Fire off the Bot and watch it complete successfully!
The only issue with this solution is that if a clean is ever performed you will need to run pod install again. This was good enough for tonight, I'll have to look for a way to script the pod install later utilizing the Pre-actions in the Build section of the Scheme used in the bot definition.

Sharing an archived iOS build won't succeed on the clients side - no such file or directory

For one of my clients, I've developed a small iOS app. I'm a member of their dev team, so I've been using a development certificate to sign my local test builds.
Now the app is almost done and it should go into internal testing on the clients side. I created an archived build of the app which I then sent to my client. They imported it into the organizer and tried to "Share" it to be able to re-sign it using an ad hoc profile.
Creating the .ipa fails with an "no such file or directory" error though. The archive appears to be fine otherwise - the organizer shows all the usual information, the icon, and it will let them export it as another archive. Creating an .ipa without re-signing fails as well, which leads me to believe this is not an issue with ther certs and provisioning profile.
If I try the same thing on my side, writing an .ipa from the very same archive using my development cert, the operation succeeds.
It may be worth mentioning that the same procedure was working fine while we were still using XCode 3.x on earlier projects. This is the first time we've been trying this using XCode 4.
No additional (static) libraries have been used.
Any help greatly appreciated!!
Edit:
Someone at the apple dev forums suggested to me that I should check the system console for xcode error messages while attempting to export the .ipa - none were printed out. We discovered some other, older messages however, which read as follows:
18.04.11 13:54:35 /Developer/Applications/Xcode.app/Contents/MacOS/Xcode[123] /Users/User/Library/Developer/Xcode/Archives/2011-04-15/Foobar.xcarchive/dSYMs/Foobar.app.dSYM/Contents/Info.plist:
set flags (was: 00200000): Operation
not permitted
The timestamp is roughly at the time when my client first imported my archive, but we can't be sure since we didn't watch the console back then.
The message had been printed multiple time, once for every single ressource file contained in the bundle. Does this tell you guys something?
Problem solved.
Following another suggestion on the apple dev forum, we repaired permissions on both systems. Additionally, I built and archived the app again and used a different way to transmit the archive to my client. We did all of this in one try, so I can't quite tell which of these measures actually did the trick. If you stumble across this because you have the same problem, you might want to try all of this, too.
Thanks for listening!
Update:
It happened again - and this time, we tried to solve it step by step. Result: It's all about how the file is being transmitted. I just attached the archive package to a mail to my client, that's what broke it, although I don't know why. Zipping the archive before transmitting it solved the problem, however.
After downloading XCode 4.3 beta with the IOS 5 SDK, the Organizer function to share and archive stopped working with a cryptic error "No such file or directory found".
It turns out that this is related to having two different versions of codesign_allocate . To fix the problem, do the following in a terminal window.
sudo ln -s /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate /usr/bin
Another hint - try the manual way to create a shared ipa - since it gives you a lot more detail of what went wrong. See http://blog.dmahajan.net
Can you see if this is also linked to your problem?
EasyCoder's answer fixed this issue for me - I have the 5.0 beta SDK and had the same problem.
I ran the following and it was fixed:
ln -s /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate /usr/bin/codesign_allocate

Resources