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.

Posts under Xcode Cloud tag

197 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

How to sudo command in xcode cloud ci_post_clone.sh?
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
2
6
3.1k
Aug ’23
Scheme is not currently configured for the build action.
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
5
1
3.8k
Sep ’23
How to export an IPA with Xcode Cloud
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?
2
0
1.4k
Aug ’23
Xcode Cloud snapshot testing using ci_scripts directory
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
2
1
2.2k
Oct ’23
Cannot remove SCM
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
3
0
1.1k
Oct ’23
Xcode Cloud build gets stuck after completion?
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.
2
0
1.8k
Mar ’24
XCode Clouds Build Fails: Un-abled to load contents of Pods xcfilelist
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.
5
1
5.7k
Oct ’23
Xcode Cloud Compute Hours Monitoring
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
1
0
842
Oct ’23
Xcode Cloud macOS won't run test scheme - "Failed to load the test bundle"
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!
10
3
3.6k
May ’24
In Xcode Cloud the archiving process keeps failing due to time out.
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.
2
1
1.7k
Dec ’23
Xcode cloud access source code after test execution
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.
2
1
2.0k
Aug ’23
Xcode Cloud "The bundle version must be higher than the previously uploaded version."
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'.
5
0
3.7k
Feb ’24
Invalid `Podfile` file: cannot load such file -- cocoapods-catalyst-support
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
2
0
3.8k
Sep ’23
Xcode Cloud
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
2
0
2k
Sep ’23
App Store API for Xcode Cloud
Can we get a new feature? Ability to set the bundle ID via the API for Xcode Cloud? When we run multiple version - we want to set it to be the same as our Bitbucket bundle number. And we do a ton of builds that are not sent to Xcode Cloud. So if we could set the next build number (the UX already has this - but need it programmatically). https://developer.apple.com/documentation/appstoreconnectapi/xcode_cloud_workflows_and_builds
1
1
699
Nov ’23
Swift build tool plugin unable to write to pluginWorkDirectory using Xcode Cloud
I have created a Swift package build tool plugin for colour generation. The plugin takes two input files from a project or swift package and from them generates a new Swift file containing references to all of the generated UIColors. When building locally and when using Github Actions the plugin is able to generate the required file within the pluginWorkDirectory and the project that references it can then access it as an input file during its build process. However, when building my project using Xcode Cloud, the plugin appears to be unable to create the file, it fails with the following error: Error while generating colours Files encountered an error at '/Volumes/workspace/DerivedData/SourcePackages/plugins/GLA.output/GLA/ColorGeneratorPlugin/GeneratedColors/Colors.swift'. 2022-11-22T15:46:11.344345498Z Reason: fileCreationFailed 2022-11-22T15:46:11.344390826Z LLVM Profile Error: Failed to write file "default.profraw": Operation not permitted` This then means that the build of the project fails with this error: Error opening input file '/Volumes/workspace/DerivedData/SourcePackages/plugins/GLA.output/GLA/ColorGeneratorPlugin/GeneratedColors/Colors.swift' (No such file or directory) It appears that Xcode Cloud is blocking the creation of files in the pluginWorkDirectory, even though locally it can. Has anyone faced a similar issue? Is there anything I can do to make it work in Xcode Cloud?
4
3
2.1k
Sep ’23
Xcode cloud cannot grant access to GitHub
I'm new to Xcode cloud and I am having trouble granting my GitHub repository access to Xcode cloud on my corresponding iOS app project, and I discovered that the username specified in the grant access window is listed my old GitHub username. Therefore, when trying to grant access to the corresponding source code, it gives me an error. I already unlinked and relinked my GitHub account to Xcode and it doesn't resolve. How can I relink my GitHub account so that on Xcode it will show as my current GitHub username? Also my repository is private. Does it only work when it's public?
1
0
862
Sep ’23