Continuous Integration

RSS for tag

Continuous integration is the process of automating and streamlining the building, analyzing, testing, and archiving of your apps, in order to ensure that they are always in a releasable state.

Posts under Continuous Integration tag

34 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

Xcode Cloud workflows are not being started (Pull Request Changes)
Any Xcode Cloud workflow with 'Pull Request Changes' as one of its start conditions has suddenly stopped working altogether. The workflow is never started. This issue seems to have begun within the last 48 hours. Removing the 'Pull Request Changes' start condition makes the workflows functional again. The test I just ran to confirm this: Created a new Xcode Cloud workflow Selected Start Conditions: 'Pull Request Changes' from/into any branch, when any files are changed Selected Test as the 'Actions' Created a pull request on my github repository The workflow was never started Added 'Branch Changes' to the Start Conditions, specifying branch-a under 'Custom Branches' Pushed to branch-a The workflow was never started Removed 'Pull Request Changes' from the Start Conditions Pushed to branch-a The workflow finally started Curious if others are having this issue? And if so, is there a timeline for when this will be resolved? I have confirmed that our Github actions are configured properly, and believe this is indeed an issue with Xcode Cloud.
3
4
256
2w
Give microphone permission programmatically
Hello, I am setting up macMinis as CI machines (using gitlab-runner) for my team. We are developing mostly audio stuff, and some of our unit tests imply using audio inputs with AVAudioSession/AVAudioEngine. These CI jobs trigger a microphone authorization pop-up on the macMinis, asking for permission to give gitlab-runner access to the microphone. Once the authorization is given, subsequent jobs run fine. My issue is that the macMinis are updated on a regular basis with scripts, and since the path of the gitlab-runner binary, installed with homebrew, changes on every version, the pop-up is triggered again every time gitlab-runner gets updated. Since we are having more and more CI runners, maintaining this manually is becoming impossible. Is there a way to either deactivate this security or scripting the authorization for a binary to access the microphone? Thank you for your help! Tom
1
0
158
3w
Re: "Unknown Apple ID" entries in Xcode Accounts settings
Hello! This post is a response to another post from Oct 17 that has already been locked for some reason: https://forums.developer.apple.com/forums/thread/766500 After upgrading to Xcode 16.0, our build machine was no longer able to archive and upload builds to App Store Connect automatically, as every single time it would say: `IDEDistribution: Failed to log in with account "(null)" while checking for an App Store Connect account` I tried using the workaround in the post above as suggested, but it does not help the problem. Removing and signing out of the account just results in Xcode not being able to do automatic signing because it no longer has access to the account with privileges to do that automatic signing. error: exportArchive No Accounts error: exportArchive No signing certificate "iOS Distribution" found I also tried Xcode 16.1 beta 3 as suggested and now the build machine's account is actually removed after every build via our build system! I have to log on after every build, log back in, and then upload the build to App Store Connect manually. I'm guessing that this "workaround" was added to Xcode itself, which is not serving its intended purpose and has actually made things worse. Not sure if there is a more official venue to send a bug report, but I'm posting here for help since that's where I originally found the post and it appeared to be written by an Apple engineer. Any other possible workarounds? Should I try one of the newer beta releases? Any help would be appreciated as this is becoming very cumbersome and a routine update of Xcode on our build machine has caused a ton of headaches.
4
0
262
3w
Resolving "Unknown Apple ID" entries in Xcode Accounts settings
In Xcode 16, if you use automatic signing to build your app from the command line, you may run into a bug where Xcode repeatedly attempts and fails to migrate invalid developer account credentials. The Accounts settings in Xcode displays an "Unknown Apple ID" entry for each failed attempt. The xcodebuild command logs a message similar to the following text: IDEDistribution: Failed to log in with account "(null)" while checking for an App Store Connect account (Error Domain=DVTServicesAccountBasedSessionErrorDomain Code=0 "Unable to log in with account ''." UserInfo={NSLocalizedFailureReason=Unable to log in with account ''., NSLocalizedRecoverySuggestion=The login details for account '' were rejected., DVTDeveloperAccountErrorAccount=<DVTAppleIDBasedDeveloperAccount: 0x600002390b40; username=''>, NSUnderlyingError=0x6000035617d0 {Error Domain=DVTPortalServiceErrorDomain Code=1100 "Your session has expired. Please log in." The issue is resolved in Xcode 16.1. If you use Xcode 16, you can workaround this issue by running the following command in Terminal: defaults delete com.apple.dt.Xcode DVTDeveloperAccountManagerAppleIDLists The command removes and signs you out of all your developer accounts on the system.
0
0
271
3w
Why xcodebuild in Xcode 16 in our CI logs out the Apple ID and creates a new one
Hello, We use automatic signing and Fastlane on our CI. Fastlane uses xcodebuild to create an archive. xcodebuild -workspace ourApp.xcworkspace -scheme app-dev -destination generic/platform=iOS -archivePath app-dev.xcarchive -skipPackagePluginValidation -allowProvisioningUpdates -authenticationKeyID OurAppStoreConnectAuthKey -authenticationKeyIssuerID OurAppStoreConnectAuthKeyIssuerId -authenticationKeyPath /path/to/OurAppStoreConnectKey.p8 clean archive All works fine, but .... Why does Xcode 16 log out logged Apple ID and create a new every build? As a result, we have more and more Unknown Apple IDs in Xcode, and for each of them an error appears in log. Error: xcodebuild[3174:1804334] DVTDeveloperAccountManager: Failed to load credentials for 0A1DF15C-ETC-ETC: Error Domain=DVTDeveloperAccountCredentialsError Code=0 "Invalid credentials in keychain for 0A1DF15C-ETC-ETC, missing Xcode-Username" UserInfo={NSLocalizedDescription=Invalid credentials in keychain for 0A1DF15C-ETC-ETC, missing Xcode-Username} Of course, the originally logged-in Apple ID has an error corresponding to his non-logged-in state. xcodebuild[3174:1804334] DVTDeveloperAccountManager: Failed to load credentials for originally_logged-in_user: Error Domain=DVTDeveloperAccountCredentialsError Code=0 "Invalid credentials in keychain for originally_logged-in_user, missing Xcode-Token" UserInfo={NSLocalizedDescription=Invalid credentials in keychain for originally_logged-in_user, missing Xcode-Token} Why does this happen and how can it be fixed? Why does Xcode 16 log out its logged Apple ID?
6
4
1.3k
Oct ’24
Accessing Window Server and other GUI services when running tests via SSH vs LaunchAgent
According to Technical Note TN2083 the Window Server advertises itself in the global bootstrap namespace, which is why you can launch GUI applications from SSH sessions, even if sshd/sshd-keygen-wrapper is launched as a launch daemon (in a non-GUI per-session bootstrap namespace). As I understand it this is also why SessionGetInfo() reports NO for sessionHasGraphicAccess, as the SSH session is not an Aqua session type, while CGSessionCopyCurrentDictionary() does return a valid dict, because in practice you have access to the window server. However, the tech note advices against running GUI programs from SSH sessions, as other GUI services may not be exposed to the global or non-GUI per-session bootstrap namespace. It uses com.apple.dock.server as an example of such a service, showing how Activity Monitor has different behavior when launched via SSH than via the UI. Based on the advice of the tech note, articles like https://aahlenst.dev/blog/accessing-the-macos-gui-in-automation-contexts/ recommends running CI UI tests via a Launch Agent instead of SSH. Now, I've tried to reproduce the the Activity Monitor case on macOS 12 and macOS 15, and I can not reproduce the missing Dock features. The Testing with Xcode documentation also says that: By default, when you use ssh to login to an macOS system that has no active user session running, a command-line session is created. To ensure that an Aqua session is created for an ssh login, you must have a user logged in on the remote macOS host system. The existence of a user running on the remote system forces Aqua session for the ssh login. Once there is a user running on the host system, running xcodebuild from an ssh login works for all types of tests. Which begs the question: Does modern macOS versions expose GUI services to the global or non-GUI per-session bootstrap namespace, or otherwise enable UI testing from SSH sessions, so that UI tests can safely be run from SSH sessions (as long as the user is logged in to the remote system's UI). Has things changed in this regard?
7
0
347
Oct ’24
Correct settings to setup Xcode/xcodebuild in a CI using automatically managed signing ? (Xcode 16)
Hello, We are using automatic signing for a couple of projects, and we're struggling to get it to work in a CI with Xcode 16. It was working with Xcode 15 but with Xcode 16 we get the following errors : error: The operation couldn’t be completed. Unable to log in with account ''. The login details for account '' were rejected. error: Provisioning profile "iOS Team Provisioning Profile: com.bundleid.my" doesn't include signing certificate "Apple Development: Foobar (TEAMID)". Any ideas ?
5
1
780
Oct ’24
Shell script phases not running in parallel from xcodebuild
I tried to enable FUSE_BUILD_SCRIPT_PHASES in my project (based on https://projects.blender.org/blender/blender), and this improves the build time when I use Xcode, but not on my CI machine, which builds the same project from command line via xcodebuild. And indeed, xcodebuild runs the shell script phases sequentially, even if I set -jobs 20. What am I doing wrong?
0
0
189
Sep ’24
Building App Store IPA
Building App Store IPA... Encountered error while creating the IPA: error: exportArchive Communication with Apple failed error: exportArchive No signing certificate "iOS Distribution" found error: exportArchive Communication with Apple failed error: exportArchive No signing certificate "iOS Distribution" found error: exportArchive Communication with Apple failed error: exportArchive No signing certificate "iOS Distribution" found error: exportArchive Communication with Apple failed error: exportArchive No signing certificate "iOS Distribution" found error: exportArchive Communication with Apple failed error: exportArchive No signing certificate "iOS Distribution" found error: exportArchive Communication with Apple failed error: exportArchive No signing certificate "iOS Distribution" found error: exportArchive Communication with Apple failed error: exportArchive No signing certificate "iOS Distribution" found error: exportArchive Communication with Apple failed error: exportArchive No signing certificate "iOS Distribution" found error: exportArchive Communication with Apple failed error: exportArchive No signing certificate "iOS Distribution" found error: exportArchive Communication with Apple failed error: exportArchive No signing certificate "iOS Distribution" found error: exportArchive Communication with Apple failed error: exportArchive No signing certificate "iOS Distribution" found error: exportArchive Communication with Apple failed error: exportArchive No signing certificate "iOS Distribution" found error: exportArchive Communication with Apple failed error: exportArchive No signing certificate "iOS Distribution" found error: exportArchive Communication with Apple failed error: exportArchive No signing certificate "iOS Distribution" found error: exportArchive Communication with Apple failed error: exportArchive No signing certificate "iOS Distribution" found error: exportArchive Communication with Apple failed error: exportArchive No signing certificate "iOS Distribution" found error: exportArchive Communication with Apple failed error: exportArchive No signing certificate "iOS Distribution" found error: exportArchive Communication with Apple failed error: exportArchive No signing certificate "iOS Distribution" found error: exportArchive Communication with Apple failed error: exportArchive No signing certificate "iOS Distribution" found error: exportArchive Communication with Apple failed error: exportArchive No signing certificate "iOS Distribution" found error: exportArchive Team "Anil kr Maurya" does not have permission to create "iOS App Store" provisioning profiles. error: exportArchive No profiles for 'com.mrappbuilder.arcgisapp' were found error: exportArchive Communication with Apple failed error: exportArchive No signing certificate "iOS Distribution" found Try distributing the app in Xcode: "open /Users/anilkumarmaurya/Documents/ArcGIsFlutterApp/build/ios/archive/Runner.xcarchive"
0
0
310
Sep ’24
What causes 502s when Xcode Cloud clones from GitHub?
I have an inconsistent Xcode Cloud failure that I'm hoping to learn more about? Additional context is available in Apple Support case 102378073626 and Feedback Assistant FB13769150. Every 3 months, ~half of my project's Xcode Cloud builds will fail for a few days in a row. I usually file a support request with Apple, they fix something on their end, builds succeed, and then exhibit the same failures again in 3 months. I'm hoping to learn anything that y'all can share about: Why does this happen? Does it coincide with new macOS versions being deployed onto Xcode Cloud? What did Apple do to fix it each time? Is there anything I can change about my project to make the failure less likely? (Such as putting a delay between the clone, brew install, and pod install steps that all hammer GitHub?) Specific symptoms: Xcode Cloud builds will fail after receiving an HTTP 502 from GitHub. This usually happens when it attempts to clone a repo, brew install, or pod install. One example: [!] Error installing FirebaseSessions [!] /usr/bin/git clone https://github.com/firebase/firebase-ios-sdk.git /Volumes/workspace/tmp/d20240809-12044-znknw7 --template= --single-branch --depth 1 --branch CocoaPods-10.28.0 Cloning into '/Volumes/workspace/tmp/d20240809-12044-znknw7'... error: RPC failed; HTTP 502 curl 22 The requested URL returned error: 502 fatal: expected flush after ref listing Error Command exited with non-zero exit-code: 1
1
0
349
Aug ’24
How to silence weekly/monthly screen capture access notification?
I'm running a launch agent in a CI node. The agent is responsible for launching CI build/test jobs. The agent, being the responsible process, has been granted kTCCServiceScreenCapture permission. With this in place I can run /usr/sbin/screencapture during CI test jobs, archiving the visual state of the CI machine if a test fails, which makes it easier to diagnose why the test failed. However with macOS 15 I get weekly/monthly notifications about the agent being able to record the screen. The general advice for this is that apps should migrate to ScreenCaptureKit, but I'm using a built in tool in macOS, /usr/sbin/screencapture, so how am I supposed to deal with that?
1
0
371
Aug ’24
Private key management with automatic signing
I am currently attempting to set up iOS app building via CI (using GitHub Actions). I would like to use automatic signing via xcodebuild -allowProvisioningUpdates and an App Store Connect API key. However, this will only work properly on the first CI run, since a certificate will be created, but is not available for subsequent runs since it is on a new machine (failing with Your account already has an Apple Development signing certificate for this machine, but its private key is not installed in your keychain). Is there a way to do either of the following? Via the CLI, generate a new p12 certificate on-demand which I can cache and add to the keychain for future signing Make just the RSA private key available to xcode so that in the automated signing process, it can create a CSR with that key if needed and download the cer (which may already exist for that key) and generate the p12 on demand
1
1
449
Jul ’24
Upload ipa from command line using individual API key
I'm trying to upload an ipa during CI/CD using the following command: API_PRIVATE_KEYS_DIR=<path_to_AuthKey_<key_id>.p8_dir> xcrun altool --upload-app --apiKey <my_key_id> --apiIssuer <issuer_id> -t ios -f my.ipa But it fails with the following error: Error Domain=ITunesConnectionAuthenticationErrorDomain Code=-26000 \"Failure to authenticate.\" UserInfo={NSLocalizedRecoverySuggestion=Failure to authenticate., NSLocalizedDescription=Failure to authenticate., NSLocalizedFailureReason=App Store operation failed.} I fear the reason is that the altool doesn't support individual API keys, is that correct or am I doing something wrong?
3
0
765
Jun ’24
Xcode Cloud SIGILL Crashes
This issue started to appear in the last couple of weeks. And it's annoying because Xcode Cloud actually is based on build duration. Here is a sample: The whole build took like 10 minutes. We can easily consume the 25 hours free tier because of these. The crash logs are completely useless. And the failing tests change from one run to the other and on different simulators. I really hope Xcode Cloud team look into this as it's frustrating and kills the whole point of Xcode Cloud (BTW, these issues won't happen on Bitrise).
6
0
723
Jul ’24
How to make CI build with Xcode project with automatic signing?
We have an iOS project that is configured with automatically managed signing. We cannot get automatic signing to work on our CI (GitHub Actions). To even get xcodebuild to archive we have to force it to not sign at all: xcrun xcodebuild \ -workspace app.xcworkspace \ -scheme prod \ -configuration 'Release' \ -destination generic/platform=iOS \ -archivePath ./build/prod.xcarchive \ CODE_SIGN_IDENTITY="" \ CODE_SIGNING_REQUIRED=NO \ CODE_SIGNING_ALLOWED=NO \ clean archive All our attempts to make xcodebuild archive do manual signing have failed. In order to have the app properly signed with the right entitlements we then call codesign: codesign -f \ -s Distribution \ --entitlements prod.entitlements \ ./build/prod.xcarchive/Products/Applications/prod.app Then we export the ipa: xcrun xcodebuild \ -exportArchive \ -archivePath ./build \ -exportOptionsPlist exportOptions.plist \ -exportPath ./build This seems to work so my question is: Is it supported to do manual signing this way? Is there a better way? If we omit the codesign step, the app will still be signed - by exportArchive we assume, but then the entitlements are missing.
2
0
1.3k
May ’24
Archiving swift package that supports visionOS requires x86_64 architecture
Hello, I have a swift package that supports visionOS and one of its targets is a xcframework that also support visionOS and when I try to archive that swift package (using xcodebuild archive) I get this error: note: '<xcframework path>' is missing architecture(s) required by this target (x86_64), but may still be link-compatible. (in target '[library name]' from project '<swift package name>') But starting in Xcode 15.2 (I have Xcode 15.4 installed), you cannot develop for visionOS on Intel machines. So why does it require that the xcframework needs x86_64 support for the visionOS simulator? Any help would be great. Thanks!
0
0
508
May ’24
Provide my own machine for Xcode Cloud
I'm working on some apps at the minute, with the intention of running a lot of automated UI tests. Xcode cloud looks great and has a lot of integrated features, but having to make sure I don't run too many hours so my subscription doesn't stop mid dev cycle, or getting a surprise large bill etc, are things I want to avoid. Even the cheapest paid plan for a year works out about the same cost as an M2 mac mini, which would probably be significantly faster than the cloud nodes. Github actions allow you to provide your own machines. But actions requires a lot more scripting, and so far they've been very slow to update Macos/Xcode versions (not sure how this will effect supplying own machine). My preference would be to deploy my own machine for Xcode cloud, similar to what we used to be able to do with Xcode server. I think this is currently impossible right? Is there any word that this might be an added feature in the near future?
1
0
596
May ’24