How do I add private Pods to Xcode Cloud's list of Additional Repositories

Hi folks!

I'm looking to see if anyone has had any luck adding their own private Cocoapods as Additional Repositories with granted access in Xcode Cloud?

My understanding was that Xcode Cloud would be able to pick up on these additional requirements, and to an extent it has been able to capture the top level private Cocoapod repository specified has a source in my Podfile.

However when it comes to the private Cococapods specified as dependencies, no dice. I have ensured that the private Cocoapods are in the same repo ecosystem as detailed by the documentation.

Any insight anyone might have on the subject would be greatly appreciated!

Replies

Hey Alex,

I'm working through Xcode Cloud builds myself and have run into a similar situation. We have a private Cocoapod Pod Spec repo, and lots of private repos (~15) hosted on Github. My builds have been failing one by one and listing that they need access to one of the private repos, even though our Github admin has added the Xcode Cloud application integration access to all our repos. When I go to App Store Connect > The App > Xcode Cloud > Settings, it only lists access granted to 7 of our private repos. Each time a build fails, another private repo shows up in the "Grant Access" section. I click the grant access button, then it succeeds and adds it to the "Additional Repositories" section. The problem is I still have 8 other private repos to grant access to and I can't add them manually. It seems I have to let the build fail, before it will identify the next private repo in line to be added. I'll add that one and re-build, then wait for the failure to suggest granting access to the next. Real pain in the *** if you ask me. I should be able to add repos to the "Additional Repositories" section manually without requiring a failed (8m) re-build each time.

Just wanted to share my experience with you. I am making progress, so let me know if you have other questions I may help with.

Cheers, Erik

Same here. I have added 2 private frameworks to my app as git submodules. They are not being added to "additional repositories" in Xcode cloud settings. They do show up in the list when creating the workflow though. Build works fine in Xcode but fails with no access on Xcode Cloud.

Update: after a couple of failed builds they do show up in the settings (at least for ssh urls)

you can add an access by creating .netrc file inside ci_post_clone.sh. so, first of all create and add ci_post_clone.sh file docs are here: https://developer.apple.com/documentation/xcode/writing-custom-build-scripts secondly, add something similar to my one:

 #!/bin/sh.

rm -rf ~/.netrc
echo "machine bitbucket.org" > ~/.netrc
echo "login YOUR_LOGIN" >> ~/.netrc
echo "password YOUR_PASSWORD_OR_APP_TOKEN" >> ~/.netrc
echo "" >> ~/.netrc
echo "" >> ~/.netrc

chmod 600 ~/.netrc