Post not yet marked as solved
There is a question on stackoverflow for that too: https://stackoverflow.com/questions/66143815/xcode-12-5-spm-dependency-cache-location
Xcode 12.5 release notes mention the "per-user-basis" cache for SPM dependencies: https://developer.apple.com/documentation/xcode-release-notes/xcode-12_5-beta-release-notes
Is the location outside of DerivedData folder so cache still persists somewhere in ~/Library/Caches and can be reused even for clean build?
It's very important to know for CI performance!
Any guidance/help is appreciated.
Post not yet marked as solved
Hello,I had *.png files (as binary data) in my xCode project. I don't need those files anymore so I removed them locally.In the meantime I created new files (*.cpp, *.h and other *.png). And after all I tried to commit project. But there was old files marked with "!".So I went to Github repository through website and removed those files by my own.Then when I tried to commit project from xCode, the removed files was still marked with "!". But I decide to uncheck them and commit.But then I get error that my repository locally is out of date, but mark "M" from all files (M - means files to commit) disappeared. But on github website there was still old files.So I tried various things, and suddenly I clicked in xCode "discard all changes" (but please notice there was no "M" mark, just "?" mark on new files), and all those new files disappeared from my project, from finder, from anywhere.I lost whole day work. Is there any way to recovery those files? I didn't make any backups during day. But did those files really disappear permanently? Isn't there any "trash" or "temp" folder for such files?I tried to checkout repository from commit history, but it doesn't help. The file is still in red colour in the browser, and doesn't exist anywhere on the drive.
I've developed an SPM module in which I have a CoreData model defined as a xcdatamodeld file and I'm having trouble executing tests from the command line, which I want for a CI integration.
In the package I load the model by constructing a URL using Bundle.module.url(forResource: "ModelName", withExtension: "momd"). This works when building and testing in Xcode.
When executing commands such as swift test from the terminal however, it doesn't, as Bundle.module.url(forResource:withExtension) fails to find the file. Comparing the build artifacts between Xcode's DerivedData and SPM's .build I see that both produce a PackageName_PackageName.bundle but while the Xcode version contains a momd file the SPM version contains an unprocessed xcdatamodeld file.
I've tried adding the xcdatamodeld as an explicit resource in the Package.swift file such that the package target now includes resources: [.process("Resources/ModelName.xcdatamodeld")] as an argument. This does not impact the Bundle output.
Any ideas how I can address this to be able to execute unit tests via the command line?
Historically I suppose the solution would be to use generate-xcodeproj but my understanding is that that has been deprecated and executing it via Xcode 14.2 fails due to a missing toolchain tool.
Post not yet marked as solved
We got the newly issue that our Test devices keeps us asking for the pin code to "Enable UI Automation".
Then it works for some hours or days, but after some time it starts again.
"Enable UI Automation" is already enabled in "Settings" - "Developer" menu.
The devices are located remotely and we can't access them directly, so this is a big issue for us right now.
Is there any way to avoid this?
Post not yet marked as solved
I'm thinking of transitioning the build infrastructure from locally managed build machines to the cloud. Unfortunately Xcode Cloud is not an option as I'm building an EndpointSecurity app, and then run build scripts to package it into a pkg. So I'm looking into using Amazon EC2 instances for it.
Apps with EnpointSecurity entitlements require special provisioning profiles during codesigning, which can be easily setup in Xcode project and then fetched during xcodebuild when -allowProvisioningUpdates is passed.
But this requires signing in with developer account in Xcode and also automatically adds the device to the Apple development program. In case of building with random EC2 instances it can be a new machine each time, and using a flag -allowProvisioningDeviceRegistration will quickly reach a quota of 100 device.
How can this be solved? Will adding a logged in Xcode to an AMI image just once help?
Post not yet marked as solved
Hi! I'm currently developing a swift package for the first time. I was trying to setup CI to run my tests but ran into an error locally. I can run my tests just fine in Xcode, but when using the xcodebuild command line tool I get this error: "error: Build input file cannot be found:" Here's some additional info that may be useful.
Command
xcodebuild test -scheme Project -destination 'platform=macOS,arch=arm64' | xcpretty -s
Full output
--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:macOS, arch:arm64, id:00006000-001658C63C23801E }
{ platform:macOS, arch:arm64, variant:Mac Catalyst, id:00006000-001658C63C23801E }
{ platform:macOS, arch:arm64, variant:DriverKit, id:00006000-001658C63C23801E }
❌ error: Build input file cannot be found: '/path/to/Project/Sources/Project/main.swift'. Did you forget to declare this file as an output of a script phase or custom build rule which produces it? (in target 'Project from project 'Project')
❌ error: Build input file cannot be found: '/path/to/Project/Sources/PRoject/main.swift'. Did you forget to declare this file as an output of a script phase or custom build rule which produces it? (in target 'Project from project 'Project')
Testing failed:
Build input file cannot be found: '/path/to/Project/Sources/Project/main.swift'. Did you forget to declare this file as an output of a script phase or custom build rule which produces it?
Testing cancelled because the build failed.
** TEST FAILED **
The following build commands failed:
SwiftDriver\ Compilation\ Requirements Project normal arm64 com.apple.xcode.tools.swift.compiler (in target 'Project' from project 'Project')
SwiftDriver\ Compilation Project normal arm64 com.apple.xcode.tools.swift.compiler (in target 'Project' from project 'Project')
(2 failures)
Package.swift
// swift-tools-version: 5.7
import PackageDescription
let package = Package(
name: "Project",
platforms: [
.macOS(.v12)
],
dependencies: [
.package(url: "https://github.com/apple/swift-syntax.git", exact: "0.50700.1"),
.package(url: "https://github.com/apple/swift-argument-parser.git", from: "1.2.1")
],
targets: [
.executableTarget(
name: "Project",
dependencies: [
.product(name: "SwiftSyntax", package: "swift-syntax"),
.product(name: "ArgumentParser", package: "swift-argument-parser")
]
),
.testTarget(
name: "ProjectTests",
dependencies: ["Project"]),
]
)
Post not yet marked as solved
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.
Post not yet marked as solved
Hi,I'm attempting to use xcodebuild to automate our release process. Because our build has an associated provisioning profile, I have added the `-allowProvisioningUpdates` flag to the xcodebuild command.If I run my xcodebuild command while logged in locally to the build machine, Xcode's automatic process of downloading the correct prov profile appears to work - the archive completes succesfully.However. If I ssh into the build machine and run the exact same xcodebuild command, I get the following error.2019-10-08 00:04:50.828 xcodebuild[53165:1665565] DVTPortal: Service '' encountered an unexpected result code from the portal ('1100')
2019-10-08 00:04:50.828 xcodebuild[53165:1665565] DVTPortal: Error:
Error Domain=DVTPortalServiceErrorDomain Code=1100 "Your session has expired. Please log in." UserInfo={payload={type = mutable dict, count = 9,
entries =>
0 : responseId = {contents = "78442697-9dda-449d-90b7-cfc0d646fde4"}
2 : {contents = "protocolVersion"} = QH65B2
3 : {contents = "requestUrl"} = {contents = "https://developerservices2.apple.com/services/QH65B2/viewDeveloper.action"}
6 : {contents = "userLocale"} = en_US
8 : resultCode = {value = +1100, type = kCFNumberSInt64Type}
9 : userString = {contents = "Your session has expired. Please log in."}
10 : {contents = "resultString"} = {contents = "Your session has expired. Please log in."}
11 : httpCode = {value = +200, type = kCFNumberSInt64Type}
12 : {contents = "creationTimestamp"} = {contents = "2019-10-07T22:04:50Z"}
}
, NSLocalizedDescription=Your session has expired. Please log in.}In my attempts to fix this issue I made sure the login keychain was unlocked using the `security` command, but it made no difference.Is there any way of fixing this? Is it possible to log into the service via the command line?The user I ssh in as is present in the Accounts pane of Xcode, but I guess this login is somehow "lost" over ssh.Thanks in advance!Heather.
Post not yet marked as solved
I have been trying to solve this issue for a week, and I know that there are a lot of similar questions like this already solved, but none of them works for me, I would appreciate any help.
I am building a CI/CD pipeline for my React Native application, and this is the IOS part. I am trying to build from the Bitbucket Pipelines over an SSH connection on a remote Mac.
I am trying to build an Xcode achieve, it works when I do it manually on the remote Mac, from Xcode, but when I run this command I get an error.
xcodebuild archive -scheme dst -configuration Release -archivePath ../builds/dst.xcarchive -workspace dst.xcworkspace PROVISIONING_PROFILE_SPECIFIER="test-dst-provisioning-release" -UseModernBuildSystem=NO CODE_SIGN_STYLE="Manual" CODE_SIGN_IDENTITY="Apple Distribution: $(Team code)"
This is the error I get:
Ld /Users/user931603/Library/Developer/Xcode/DerivedData/dst-gisgtbcaheaxrqbgvvzueprfinbl/Build/Intermediates.noindex/ArchiveIntermediates/dst/InstallationBuildProductsLocation/Applications/dst.app/dst normal arm64
cd /Users/user931603/build/dst-mobile-prototype/ios
export
PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/Users/user931603/.nvm/versions/node/v14.17.6/bin/:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/usr/local/munki:/Applications/Xamarin Workbooks.app/Contents/SharedSupport/path-bin"
ld: warning: directory not found for option '-L-L/Users/user931603/Library/Developer/Xcode/DerivedData/dst-gisgtbcaheaxrqbgvvzueprfinbl/Build/Intermediates.noindex/ArchiveIntermediates/dst/BuildProductsPath/Release-iphoneos/BoringSSL-GRPC'
ld: library not found for -lBoringSSL-GRPC
clang: error: linker command failed with exit code 1 (use -v to see invocation)
For a while I thought that I have a problem with the Library Search Paths
These are my Target - Build settings - Library Search Paths
These are my Project - Build settings - Library Search Paths
But then it turned out that the achieve works from Xcode, but it doesn't work when I do it remotely on the terminal, so I think there must be an issue with the environment variables or something like this.
I use Cocoapods, there can be a problem with that, the settings are the ones generated automatically by React Native.
I have no clue about this issue, I would appreciate greatly if you could help!
FB7864358
Upon replacing Xcode 12.0 Beta 1 with 12.0 Beta 2, the Xcode Server settings configuration is no longer accessible. One the 'Server & Bots' preference pane the message presented is:
Xcode Server Is Already Running Your computer is already configured to run Xcode Server and this version of Xcode is not compatible. If you manually switch the service off and back on, an alert is presented with the following:
This version of Xcode is not supported (version is too old) I have managed to revert back to Xcode 12.0 Beta one, and continue managing my server.
Has anyone had the same experience or any suggestions on getting Xcode 12.0 Beta 2 to work with Xcode Server?
Post not yet marked as solved
Hello,
We have multiple iOS real devices attached to a Mac mini which serve as a server in a CI pipeline. From iOS 15 after a few hours, the phone requires the pin code, even if the UI automation is enabled and the pin was set at the first run.
A few mentions:
We need to have a pin set because the app under test needs a pin for security reasons
We set the display to never sleep because we cannot unlock the phone through the automation script
For automation, we're using Appium (https://github.com/appium/appium)
My question is, how can we handle the case without unlocking manual the phone considering that we're using the devices in a CI pipeline?
Is there a way to stop the whole UI tests execution on a single test failure? I'm already using continueAfterFailure flag which stops further test execution for that particular test suite. But this does not suit our requirement since it will jump to next test suite and execute tests further.
Any help would be appreciated, thanks.
Post not yet marked as solved
hello developers,
First priority I couldn't find a proper title for the question :(
The reason why I open a topic here is not to find the answer by direct point shooting; My goal is what do Apple, Developer, Companies and Devops teams think and comments about the subject I'm going to ask here?
We use Jenkins as the Devops CI/CD tool at our company, and in Macos/Apple/iOS development, we use a lot of Mac Mini devices. Since we build/compilers on a project-based, version-based basis, we cannot get 100% efficiency from our devices. (For example, because the dependencies of a project are different from other projects; we dedicate only 1 Mac Mini to that project. (As the dependecys of the projects are too many and large, the migration process is very difficult for us, the cost of moving to a lower-level Mac Mini device is high / but this is just an example))
While researching, I saw that there is no docker container image for MacOs X (enterprise or legal) and I know about the Apple EULA. (For virtualization, Apple hardware must be used as a basis. Because the MacOs system is paid for on a device-based basis.)
What I want to ask here is can I find or create a MacOs docker container image legally?
How is the structure of other companies in their CI processes?
If I install MacOs with more than one VMware/VirtualBox on Mac Mini, What harm could it do me in Jenkins? (I'm curious about people's comments on this.)
Post not yet marked as solved
Hello, I'm fairly new to the Xcode Cloud workflow and I would like to know, is there a way to automatically include release notes to a build after it's been uploaded?
I can for example set up a Fastlane script that will gather changes since the last build (from git history) and put them in a file on the repository. But is there a way to upload the notes after the build is uploaded to TestFlight?
Post not yet marked as solved
Hi!
I have an issue to build Archive when using xcodebuild in GitHub Action workflow. The project s quite basic iOS project. Archiving works fine locally using command
xcodebuild -quiet -workspace MyProject.xcworkspace -scheme "MyProject Release" clean archive -configuration release -destination=generic/platform=iOS -archivePath MyProject.xcarchive
Same command via SSH gives an error
errSecInternalComponent. Command CodeSign failed with a nonzero exit code
IF I run a command security unlock-keychain beforehand, then creating .xcarchive passes.
In Keychain Access, I have necessary certificates. Those are located in login.keychain and every certificate seems to be valid.
Also, based on this answer, I have tried to put 6 different Apple Worldwide Developer Relations Certification Authority -certs in System.keychain and removed same stuff from login.keychain. This didn't bring solution either.
Our GitHub (Enterprise) Action workflow is quite simple (here is an extract):
name: Build_Tests
on:
push:
branches:
- 'GHA_tests'
workflow_dispatch:
jobs:
build:
runs-on: [ self-hosted, macos-1 ]
.....
- name: Archive
shell: bash
run: |
xcodebuild -quiet -workspace MyProject.xcworkspace -scheme "MyProject Release" clean archive -configuration release -destination=generic/platform=iOS -archivePath MyProject.xcarchive
In our CI/CD environment is a stack of Macs with latest macOS, and every those has a unique password, so embedding "security unlock-keychain" with password is not a (good) solution. If it is only one to get our build and test environment to work, then we have to start to live with it, but I would love to get some other solution to work. Easiest for us would be that old workflows, with example above, continues to work. I mean that just using commands like "xcodebuild" would work like a charm.
I have also run through this excellent post by eskimo and seems like that certificates are fine. No issues found.
Locally run security find-identity -p codesigning gives in "Matching identities" "4 identities found" and in "Valid identities only" "4 valid identities found". Also, I can run codesign -s "Apple Development" -f "MyTrue" for my certificates four time in a row with success. (We have four certificates, yes. There is one dev for in-house, one for public, one Distribution and an old iPhone Distribution from...past.)
Also, each 4 certs in login.keychain has in Access Control "Confirm before allowing access" selected and in the list "Always allow access..." there is at least a tools codesign and Keychain Access. Apple Distribution cert's Key has four "Always allow..." apps: Keychain Access, Xcode, codesign and productbuild. These certificates are imported to Keychain Access using commands
security unlock-keychain -p <keychain password> login.keychain
security import <certificate file>.p12 -k login.keychain -P <cert password> -T /usr/bin/codesign
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k <keychain password>
Via SSH I have run command codesign -s and it gave similar issues than in eskimo's example: "MyTrue: errSecInternalComponent". A command security unlock-keychain naturally fixed this. The problem here is that I can't include passwords in CI after unlock-keychain command.
Any ideas what I am doing wrong? My guess is that I am not a far of working solution, but just can make in my mind what I am doing wrong atm. I think that I have tried about everything during these two weeks when wondering this issue. I appreciate everyone who reads this posts and specially you who posts a working solution :)
-Harri
Post not yet marked as solved
Hi,
I want to submit a build directly to TestFlight review from Xcode Cloud after a successful build. But the post actions are disabled.
I'm on Xcode 14. I followed the steps from the documentation but no luck. My workflow is as below.
Post not yet marked as solved
We have a suite of UI tests managed by QA.
They are developed on his machine (M1 MacBook Pro) and when they all pass he checks in
We use fastlane and an M1 Mac-mini as our build machine/pipeline.
When the tests are running in the pipeline we always get swipe failures such as
XCTAssertTrue failed - Failed to swipe so not on the correct page
XCTAssertTrue failed - Swipe not worked, delete not showing
And so on. What I find really strange is I can login to the build machine itself, open the project from the source directory and manually run all the UI Tests - they all pass.
I also ran the fastlane lane directly (ui_tests) from terminal to exactly mimic what the pipeline does and they all pass
As soon as I re-enable them in the full pipeline (fast file) we get the swipe failures on the same machine and emulator!
The only difference I can see is I ran them directly / standalone versus part of the pipeline. Also, they run immediately after our unit tests
unit_tests
ui_tests
Could this potentially affect things? From reading around I wondered about the M1 architecture potentially being the cause but they are written on an M1 and the build machine is the same architecture (and as above, in isolation they work)
Any ideas appreciated!
Post not yet marked as solved
Hi there, I'm trying to make a CI/CD system for iOS project using Jenkins, my project have a Notification Services Extension target. But when running xcodebuild script it's show this error:
framework not found Pods_NotificationServiceExtension
Ld /Users/administrator/Library/Developer/Xcode/DerivedData/BitcastleApp-diipivlljnhqkjhlbsmgsjjgynbn/Build/Intermediates.noindex/ArchiveIntermediates/BitcastleApp-Dev/IntermediateBuildFilesPath/BitcastleApp.build/Debug-iphoneos/NotificationServiceExtension.build/Objects-normal/arm64/Binary/NotificationServiceExtension normal arm64 (in target 'NotificationServiceExtension' from project 'BitcastleApp')
When using xcode it's still success. Below is my build script for archiving:
xcodebuild build -workspace BitcastleApp.xcworkspace -scheme BitcastleApp-Dev -sdk iphoneos15.5 -configuration Debug archive -archivePath /Users/administrator/.jenkins/workspace/Dev -destination generic/platform=iOS
Did anyone know how to fix this error? I have to spend 2 days to tried to search around the internet but still can't found any solution. Please help!
Post not yet marked as solved
I've been using Xcode Server for a few days for the continuous integration of our projects.
Most of the time, it works as expected : the projects compiles, the unit tests are executed with success, then I have a post-integration script that compiles an archive and upload it to TestFlight (using Fastlane).
It works. Most of the time...
Once in a while, I get a "internal-processing-error" value (instead of "success" or "warnings") in XCS_INTEGRATION_RESULT variable, after the unit tests have passed. I've been trying to look into the bot logs to find any useful information, but no luck 'til now.
Does anyone have an idea about what I could do to move forward on this issue ?
Post not yet marked as solved
From the release notes of Xcode 14:
"Xcode Server is no longer supported. (73888675)"
I haven't read or heard that being mentioned somewhere else.
Does anybody knows, what that means for Xcode Server users?
What is the plan to support corporations, which can not share the code to other companies and thus can not use Xcode Cloud for testing.
...or the ones, that just can't (or do not want to) afford Xcode Cloud?
Are we off to other CI/CD solutions?