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 randomly fails to resolve package dependencies
Hi folks, I've been having this issue for the last few months, where Xcode Cloud fails to resolve Swift package dependencies while compiling my builds, seemingly at random. Some of my Xcode Cloud builds will fail after several minutes, with an error log looking like that : xcodebuild: error: Could not resolve package dependencies: failed downloading 'https://dl.google.com/firebase/ios/bin/grpc/1.62.2/rc0/grpcpp.zip' which is required by binary target 'grpcpp': downloadError("The request timed out.") Whenever this happens, I have to manually restart an Xcode Cloud build process (or several builds, since the error can happen multiple times in a row), to the point it's becoming increasingly painful to rely on Xcode Cloud for my workflow. The failing packages are mostly random (meaning, it's not always the same one that Xcode fails to resolve), but they are always publicly accessible, even though I have an environment variable set in my Xcode workflows to retrieve a single Github private dependency (maybe this has some kind of importance). Could anyone tell me if this is an isolated issue, or if I could do anything on my end to resolve this ? Thank you !
4
1
147
1w
`xcodebuild test` stuck because of app data container protection
Hi, I have recently noticed a very-very annoying thing in my CI pipeline, that I managed to reproduce locally. Using macOS Sonoma 14.7.1 and Xcode 15.4, running a test target from Terminal, the first run produces this output: $ xcodebuild test -workspace [redacted].xcworkspace -scheme [redacted] -quiet --- xcodebuild: WARNING: Using the first of multiple matching destinations: { platform:macOS, arch:arm64, id:[redacted], name:My Mac } { platform:macOS, arch:x86_64, id:[redacted], name:My Mac } { platform:macOS, name:Any Mac } Testing started Test suite '[redacted]' started on 'My Mac - [redacted] (75944)' Test case '[redacted].[redacted]()' passed on 'My Mac - [redacted] (75944)' (0.001 seconds) Test case '[redacted].[redacted]()' passed on 'My Mac - [redacted] (75944)' (0.001 seconds) 2024-11-29 19:31:02.311 xcodebuild[75908:47784216] [MT] IDETestOperationsObserverDebug: 1.380 elapsed -- Testing started completed. 2024-11-29 19:31:02.311 xcodebuild[75908:47784216] [MT] IDETestOperationsObserverDebug: 0.000 sec, +0.000 sec -- start 2024-11-29 19:31:02.311 xcodebuild[75908:47784216] [MT] IDETestOperationsObserverDebug: 1.380 sec, +1.380 sec -- end so the test actually completes, but the process does not end, because I get a popup that “Terminal.app” would like to access data from other apps. Removing the "App Sandbox" entitlement immediately alleviates this problem, but it would be very silly to do so because of unit tests. This ultimately means that whenever we use a new device or include a new project or test target, this popup comes up. Very undesirable for CI servers (especially if the servers are ephemeral virtual machines created for the current job). Is there a permanent solution that disables this popup for test runs?
0
0
215
3w
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
380
Nov ’24
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
236
Oct ’24
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
405
Oct ’24
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
382
Oct ’24
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?
7
5
1.9k
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
431
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
1.1k
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
237
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
411
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
403
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
426
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
2
511
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
909
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
800
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.5k
May ’24