Xcode Cloud

RSS for tag

Automate workflows to test, analyze, build, and distribute your app, and integrate them with other developer tools, such as TestFlight and App Store Connect.

Xcode Cloud Documentation

Posts under Xcode Cloud tag

213 Posts
Sort by:
Post not yet marked as solved
4 Replies
16k Views
Here is my ci_post_clone.sh #!/bin/sh # fail if any command fails set -e # debug log set -x # Install CocoaPods using Homebrew. HOMEBREW_NO_AUTO_UPDATE=1 # disable homebrew's automatic updates. brew install cocoapods # Install Flutter using git. git clone https://github.com/flutter/flutter.git -b stable $HOME/flutter export PATH="$PATH:$HOME/flutter/bin" # Install Flutter artifacts for iOS (--ios), or macOS (--macos) platforms. flutter precache --ios # Install Flutter dependencies. flutter channel master flutter doctor flutter pub get # Generate IOS file flutter build ios --release --no-codesign # Install CocoaPods dependencies. #cd ios && pod install # run `pod install` in the `ios` directory. exit 0
Posted
by
Post not yet marked as solved
2 Replies
1.5k Views
Hi, I'm writing here because I'm having some difficulties with the Xcode Cloud API. I'm trying to start a build on Xcode Cloud through API on a specific branch. I have tried to structure the body of the requests using the sourceBranchOrTag relationship, but I keep running into 409/422 HTML codes. Currently this is my body: { "data": { "type": "ciBuildRuns", "attributes": {}, "relationships": { "workflow": { "data": { "type": "ciWorkflows", "id": WORKFLOW_ID } }, "sourceBranchOrTag": { "data": { "type": "CiGitRefKind", "id": "develop", "attributes": { "kind": "branch" } } } } } } I have tried different combinations, but to no avail. Looking at the documentation there is no clear way on how to structure the scmGitReferences object required in the body, does anyone have an example of a body like this one? Extra: Also the documentation is really bad at explaining how query parameters works. Some more practical examples would help a ton. (e.g. filtering the list of builds of a workflow by executionProgress=RUNNING seems impossible?) Thanks for your time and have a great day, Davide
Posted
by
Post not yet marked as solved
2 Replies
1.4k Views
Hello, I'm trying to visualize code coverage data in our project but I've faced issues getting the coverage data from the .xcresult bundle produced by xCode Cloud. On my local machine, I'm using xccov view to preview coverage data and everything looks fine: /Users/d.kuznetsov/Git/***/***.swift:     1: *     2: *     3: *     4: *     5: *     6: *     7: *     8: *     9: *    10: *    11: *    12: *    13: *    14: *    15: *    16: 4    17: *    18: *    19: *    20: *    21: *    22: *    23: *    24: *    25: *    26: *    27: *    28: *    29: *    30: *    31: 3    32: 3    33: 3    34: 3    35: *    36: 3    37: 3 [ (56, 0, 0) ]    38: 0    39: 0    40: 3 [ (1, 9, 0) ]    41: 3    42: 3    43: 3    44: 3    45: *    46: 3    47: 3    48: 3    49: 3    50: * But when I tried to use the same approach in ci_post_xcodebuild.sh I couldn't see the coverage data: #!/bin/sh xcrun xccov view --archive $CI_RESULT_BUNDLE_PATH Am I missing something? The schema settings are the same for both Cloud and local machine and code coverage gathering setting is enabled.
Posted
by
Post marked as Apple Recommended
3.0k Views
I'm having issue using Xcode Cloud with my developer account. I have active Apple Developer Program membership (Individual) associated with my Apple ID: Same Apple ID is the only Apple ID added in Preferences > Accounts in Xcode 13.4.1 (13F100). But with that setup, for any project I can try, Report Navigator > Cloud tab shows this error: Your developer account is not a member of a team that is eligible to use Xcode Cloud And Product > Xcode Cloud > Create Workflow... shows error This operation could not be completed. If I switch to a different developer account that I have (associated with a team, not individual membership) – the issue is resolved and I can start creating first Xcode Cloud workflow in same projects. Can Xcode Cloud be used with individual ADP memberships? If so, why my account is not eligible? How can I further diagnose the problem?
Posted
by
Post not yet marked as solved
2 Replies
2.9k Views
I'm installing texturepacker in ci_post_clone.sh script using below command in Xcode Cloud workflow. ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null ; brew install caskroom/cask/brew-cask 2> /dev/null brew install --cask texturepacker But I'm getting sudo warning in log. ==> Downloading https://www.codeandweb.com/download/texturepacker/6.0.2/TexturePacker-6.0.2.dmg ==> Installing Cask texturepacker sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper sudo: a password is required sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper sudo: a password is required sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper sudo: a password is required sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper sudo: a password is required ==> Purging files for version 6.0.2 of Cask texturepacker Error: Permission denied @ dir_s_mkdir - /usr/local/Caskroom How can i fix this issue? Any idea or suggestions would be appreciated. Thank You
Posted
by
Post not yet marked as solved
4 Replies
3.4k Views
In the "Resolve package dependencies" step I see this error occur: Scheme <scheme-name> is not currently configured for the build action. I cannot reproduce locally. When I run the command: xcodebuild -resolvePackageDependencies it finishes fine. I'm on Xcode 13.4.1 and MacOS 12.4.1 Other things I've tried: Verified scheme is in the workspace (not the project) Deleted all schemes and auto created schemes again Recreating the build action in the scheme Enabled all actions in the scheme
Posted
by
Post not yet marked as solved
2 Replies
1.2k Views
Hello. I'm using XCode Cloud to replace an existing fastlane workflow where the end result is to post an IPA to in internal Slack channel. I've written a ci_post_xcbuildscipt.sh and it runs: xcodebuild -exportArchive -archivePath ${CI_ARCHIVE_PATH} -exportPath ${EXPORT_PATH} -exportOptionsPlist ${EXPORT_OPTIONS} -authenticationKeyIssuerID ${AUTH_KEY_ISSUER_ID} -authenticationKeyID ${AUTH_KEY_ID} -authenticationKeyPath ${AUTH_KEY_PATH} -allowProvisioningUpdates My problem is resigning the IPA with the environment variables set as secrets. The autenticationKeyPath expects to be a file, but I'm only able to pass strings as environment variables. I tried passing the key as a string and in my script writing it to a file, but the result is always an empty file. I've tested locally and this idea works, so I think it's a consequence of how the environment variables are protected when marked as a secret. Any suggestions on how I could successfully export my archive but keep the key a secret?
Posted
by
Post not yet marked as solved
1 Replies
2k Views
Setup I've been experimenting with migrating to Xcode Cloud for our CI but I'm struggling with getting Snapshot Testing to work. I've been involved in some discussions here... https://github.com/pointfreeco/swift-snapshot-testing/discussions/553 And I saw this site also which explains a little... https://wojciechkulik.pl/xcode/xcode-cloud-overview-and-setup But so far I've been unsuccessful in getting it to work at all. I'm using the swift-snapshot-testing library from PointFree https://github.com/pointfreeco/swift-snapshot-testing and I have overridden the assertSnapshot function to change the snapshot testing directory. The function looks like this... func snapshotDirectory( for file: StaticString, ciScriptsPathComponent: String = "ci_scripts", relativePathComponent: String = "Tests" ) -> String { var sourcePathComponents = URL(fileURLWithPath: "\(file)").pathComponents if let indexFolder = sourcePathComponents.firstIndex(of: relativePathComponent) { sourcePathComponents.insert("resources", at: indexFolder) sourcePathComponents.insert(ciScriptsPathComponent, at: indexFolder) } var pathsComponents: [String] = sourcePathComponents.dropLast() let fileUrl = URL(fileURLWithPath: "\(file)", isDirectory: false) let folderName = fileUrl.deletingPathExtension().lastPathComponent pathsComponents.append("__Snapshots__") pathsComponents.append(folderName) let directory = String(pathsComponents.joined(separator: "/").dropFirst()) return directory } public func assertSnapshot<Value, Format>( matching value: @autoclosure () throws -> Value, as snapshotting: Snapshotting<Value, Format>, named name: String? = nil, record recording: Bool = false, timeout: TimeInterval = 5, file: StaticString = #file, testName: String = #function, line: UInt = #line ) { let failure = verifySnapshot( matching: try value(), as: snapshotting, named: name, record: recording, snapshotDirectory: snapshotDirectory(for: file), timeout: timeout, file: file, testName: testName ) guard let message = failure else { return } XCTFail("\(message) snap: \(snapshotDirectoryUrl) file: \(file) ", file: file, line: line) } Essentially this takes my test file path... repoRoot/Tests/FeatureTests/FeatureTestFile.swift. And injects some path component into it so that you end up with a directory path... repoRoot/ci_scripts/resources/Tests/FeatureTests/__Snapshots__/FeatureTestFile/. And then the snapshot file will be located in that directory using the name of the test function with a suffix of .1.txt or .2.txt (etc... for each subsequent snapshot in each function). i.e. testSnapshotStuff.1.txt, testSnapshotStuff.2.txt. Problem This all works locally. And all the files are checked into GitHub. But, when I run this on Xcode Cloud it fails the tests and tells me the files are not there. Having added some logging in it is writing new snapshot files to where I am expecting them to be so it just looks like those files are not available to the Test environment. This is where I read about putting them into the ci_scripts file at the root of the repo. Which is what I've done. Files in this directory are supposed to be copied into the test environments so that they can be accessed... but it seems that they're not being. I have tried using ci_scripts/resources and ci_scripts/Artifacts but it's always the same. The files aren't there and the Xcode Cloud tests write those files there over time. I'm running out of options of what to do with this now. I just want a way that I can access these snapshot files in the test environment on Xcode Cloud. Any help would be much appreciated. Thanks
Posted
by
Post not yet marked as solved
3 Replies
961 Views
On our projects we have separate targets for staging and production (and also separate accounts). I was able to connect xcode cloud to staging account and builds were working ok, but when I made workflow for production (with same app on gitlab) I could not get access. I never got an option to make new app in gitlab so I went and delete all xcode cloud data and gitlab app. Now when It wants to connect to gitlab I get no option to authorize app or create a new one. I also cannot delete SCM
Posted
by
Post marked as solved
2 Replies
1.6k Views
Recently, I have trouble with my Xcode Cloud builds, where they seemingly complete, but the very final step does not happen. I am building from the same codebase for both macOS and iOS (I have two “Archive” steps in my workflow, one for iOS and one for macOS). The iOS one usually completes fast without problems. The macOS log ending looks like this, and remains stuck forever, with the macOS build in the “spinning progress” state and never completing. Is there something I can do on my end to make this work better? I would not want to go back to manual builds, Xcode Cloud is convenient and was working well for a while, but this is really annoying lately.
Posted
by
Post not yet marked as solved
5 Replies
4.9k Views
When Building with XCode Cloud I receive errors reading Cocoapods xcfilelist files. The errors are as follows: Unable to load contents of file list: '/Target Support Files/Pods-<Project Name>/Pods-Anytune-frameworks-Release-output-files.xcfilelist' Unable to load contents of file list: '/Target Support Files/Pods-Anytune/Pods-<Project Name>-resources-Release-output-files.xcfilelist' When building through Xcode (Product > Build) everything works, however this is not the case with Xcode Cloud. I have verified that the xcfilelist paths exist on my machine, however with Xcode Cloud they are unable to load. I have also tried cleaning, updating and rebuilding my Cocoapods to no avail. This issue exists on stackoverflow. Link is found here. The solutions here did not work for me. Any help would be appreciated.
Posted
by
Post not yet marked as solved
1 Replies
688 Views
Hi I'm piloting using Xcode Cloud for my builds. Recently, I inadvertently burned up all my compute hours for the month. I know I could move to a higher-level plan, but I really want to understand how I can avoid doing this in the future. I know I can view my usage in App Store Connect but I'm looking for ways to be alerted if my remaining compute hours go below a threshold that gives me time to react. Questions: I don't think I got any emails from Apple warning me that my compute hours were near to being used up - should I have received something? I don't see an options for this in the Settings or Usage pages. I have been using the App Store Connect API and have been going through the API docs trying to find an endpoint that returns the compute hours balance for my account but haven't found one - does one exist? Thanks, Dave
Posted
by
Post not yet marked as solved
9 Replies
2.9k Views
I'm new to Xcode cloud - working with a Mac OS app, build is working great. Now I am trying to add a Test action; the testing target builds but won't run, and the error indicates it can't find the testing bundle in the expected build output. There's also mention of a code signing error, but I have automatic code signing enabled with the same settings on test target as the app. I am only running the unit test (XCTest) scheme, not the UI tests. When I run it locally from the IDE it works fine, either selecting the test scheme explicitly or as the test step of the app scheme. I notice the XCTest target's scheme setup uses Debug builds and expects the test output to be in the Debug .app bundle, I thought perhaps that was the problem (in case only the release app bundle actually gets built in the Xcode Cloud environment). So I created a duplicate scheme and set the build targets to Release - again I can run this fine locally (after creating a release build), but it fails with the same error in Xcode cloud. I also tried changing the code signing certificate from "Development" to "Sign to run locally" to see if that made a difference, but I get the same error. (It's using my developer account Team, and "Automatically manage signing".) Can anyone relate the proper way to set up an XCTest scheme so that the tests will actually run in a Mac OS Xcode Cloud workflow? I'm using Xcode 14.0.1. Here's the full error output, with [AppName] and [TestTargetName] substituted for the actual: [AppName] (....) encountered an error (Failed to load the test bundle. If you believe this error represents a bug, please attach the result bundle at /Volumes/workspace/resultbundle.xcresult. (Underlying Error: The bundle “[TestTargetName]” couldn’t be loaded. The bundle couldn’t be loaded. Try reinstalling the bundle. dlopen(/Volumes/workspace/TestProducts/Debug/[AppName].app/Contents/PlugIns/[TestTargetName].xctest/Contents/MacOS/[TestTargetName], 0x0109): tried: '/Volumes/workspace/TestProducts/Debug/[TestTargetName]' (no such file), '/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib/[TestTargetName]' (no such file), '/Volumes/workspace/TestProducts/Debug/[AppName].app/Contents/PlugIns/[TestTargetName].xctest/Contents/MacOS/[TestTargetName]' (code signature in <....> '/Volumes/workspace/TestProducts/Debug/[AppName].app/Contents/PlugIns/[TestTargetName].xctest/Contents/MacOS/[TestTargetName]' not valid for use in process: mapped file has no Team ID and is not a platform binary (signed with custom identity or adhoc?)))) Thanks!
Posted
by
Post not yet marked as solved
2 Replies
1.5k Views
Every time I the Xcode Cloud want to archive the project, after 30 minutes it says "The step invocation hit a user timeout. The xcodebuild archive invocation timed out. No activity has been detected on stdout, stderr or the result bundle in 30 minutes." I added a step before archiving to build the project and it was ok. Do you have any suggestions on why this keeps happening? It happens constantly to me.
Posted
by
Post not yet marked as solved
2 Replies
1.8k Views
Hello, I'm trying to upload my code coverage to an external service. I've created a workflow on Xcode Cloud that build and run my test + a ci_post_xcodebuild script that uploads my Project.xcresult to an external service My problem here is that I need the repository source code the moment I upload my coverage file. I have two steps in my workflow: Build tests (Which contain the sources but not the coverage results) Run tests (Which contain the coverage result but not the sources) I found this in the Apple documentation: Lastly, it should be noted that in a test action, multiple environments are used to build and run your tests. Only the environment that is used for building your tests will have your source code cloned into it by default. The environments that run your tests won't have source code cloned into them. They'll only have the ci_scripts folder made available on them. As a result, the post-clone script won't run in these environments and your custom scripts and any of their dependencies, such as other shell scripts and small tools, must be entirely contained within the ci_scripts folder. Source: https://developer.apple.com/videos/play/wwdc2021/10269/ I feel a bit stuck here maybe Xcode cloud is not the way to go for this but I was wondering if by any way I could still check out my project sources after the test execution.
Posted
by
Post not yet marked as solved
5 Replies
3.1k Views
I am getting an error on Xcode Build The bundle version must be higher than the previously uploaded version. I am at a loss. My bundle version is set at 20. The latest version uploaded has bundle version 18. The project is clearly higher than the most recently uploaded version. What am I doing wrong? I tried setting the Bundle version in both the General tab for the target, in the Build Settings and in the Info.plist. Which takes precedence? Fastlane reports the current build version as 18 on TestFlight. Confusingly, throughout Xcode, Bundle Version is variously referred to as both 'Bundle Version' and 'Current Project Version', and is 'Build' on App Store Connect. App Store Version is variously referred to as 'Version', 'Bundle version string (Short)', and 'Marketing Version'.
Posted
by
Post not yet marked as solved
2 Replies
3.3k Views
I encountered this error 2023-01-24T22:14:41.500565325Z Installing ri documentation for cocoapods-catalyst-support-0.2.1 2023-01-24T22:14:41.500827390Z Done installing documentation for colored2, concurrent-ruby, i18n, tzinfo, zeitwerk, activesupport, nap, fuzzy_match, httpclient, algoliasearch, ffi, ethon, typhoeus, netrc, public_suffix, addressable, cocoapods-core, claide, cocoapods-deintegrate, cocoapods-downloader, cocoapods-plugins, cocoapods-search, cocoapods-trunk, cocoapods-try, molinillo, atomos, nanaimo, rexml, xcodeproj, escape, fourflusher, gh_inspector, ruby-macho, cocoapods, cocoapods-catalyst-support after 50 seconds 2023-01-24T22:14:41.500997230Z 35 gems installed 2023-01-24T22:14:42.023353910Z [in /Volumes/workspace/repository] 2023-01-24T22:14:42.023798292Z 2023-01-24T22:14:42.024448317Z [!] Invalid `Podfile` file: cannot load such file -- cocoapods-catalyst-support. 2023-01-24T22:14:42.024714192Z 2023-01-24T22:14:42.024976712Z # from /Volumes/workspace/repository/Podfile:1 2023-01-24T22:14:42.025200239Z # ------------------------------------------- 2023-01-24T22:14:42.025463448Z > require 'cocoapods-catalyst-support' 2023-01-24T22:14:42.025663811Z # 2023-01-24T22:14:42.025900158Z # ------------------------------------------- from my post-clone script, which is #!/bin/sh # ci_post_clone.sh export GEM_HOME="$HOME/.gem" gem install bundler brew install cocoapods gem install cocoapods-catalyst-support # Install dependencies managed with CocoaPods. pod install
Posted
by
Post not yet marked as solved
4 Replies
1k Views
Trying to create my first Xcode Cloud Workflow, however the default workflow has a primary Repository URL that is in Derived Data for some reason. I am unable to update this URL even when selecting the drop down. Anyone have any idea on how to fix this? This is really frustrating because I am unable to get through the final step of workflow creation, connecting my git code: However, while editing the workflow, when doing choosing which branches to trigger a build from, it is correctly able to detect all my branches, etc Anyone have any idea on what is happening?
Posted
by
Post not yet marked as solved
2 Replies
1.7k Views
Hi I'm using flutter and integrated the repository to xcode cloud to compile the app and in my machine compiles and uploads fine to testflight but using xcode cloud it throws an error could not find included file 'Generated.xcconfig' in search paths it does not make sense to me if I'm honest, but I'm running out of options The other thing I like to confirm is if xcode cloud works at all with flutter, I'm getting the feeling that is the case
Posted
by