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

129 Posts

Post

Replies

Boosts

Views

Activity

"DVTPortal: Error: Your session has expired" with xcodebuild
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.
6
1
22k
Jan ’23
ld: library not found for -lBoringSSL-GRPC Xcodebuild React Native
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!
1
0
4.4k
Dec ’22
Xcode 12 Beta 2 causes Xcode Server to be unmanageable
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?
2
0
1.7k
Dec ’22
iOS 15 - UI Test keeps asking pin code for "Enable UI Automation" in CI
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?
1
1
1.5k
Nov ’22
Xcode stop UI testing on any single test failure
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.
1
0
1.9k
Nov ’22
Xcode Cloud - build release notes
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?
1
8
2.2k
Oct ’22
Xcodebuild Archive fails to errSecInternalComponent in GitHub Action
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
4
0
3.5k
Oct ’22
Swipe issue UITesting + fastlane
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!
0
0
1.3k
Oct ’22
failed to archive with xcodebuild script due to error framework not found Pods_NotificationServiceExtension on Jenkins
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!
0
0
1.2k
Aug ’22
Xcode Server bot internal-processing-error
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 ?
0
1
1.3k
Aug ’22
Xcode Server no longer supported?
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?
4
5
2.3k
Jul ’22
Parallel testing fails - failed to prepare simulator
Recently we get more and more problems due to non bootstraping or starting simulator clones on parallel testing. Unit & UI-Tests were all successful but the status is failed, because of this errors 'The test runner encountered an error (Failed to prepare device 'Clone 1 of iPhone 12' for impending launch.' The test runner encountered an error (Failed to prepare device 'Clone 4 of iPhone 12' for impending launch. CI environments are MacMinis based on intel and apple silicons, with Xcode 13.3.1.
0
1
1.5k
Jul ’22
Remote access to test system dying every few days
I'm using a Mac Mini as a Jenkins agent, which we use to run our Xcode tests on physical iOS devices. It's configured for remote access with SSH & screen sharing with VNC. Every few days they start failing completely. Sometimes one of them is up a bit longer, but more usually they're both down. If I look in the GUI it says it's running. The correct ports are listening. In Console I can see that the sshd process exits with 255 the instant it's started, but I haven't been able to get anything more specific. I've found that I can get SSH & VNC access back with launchctl bootout system/<svc name> launchctl disable system/<svc name> launchctl enable system/<svc name> launchctl bootstrap system <plist file name> The problem is that I can't tell from the remote device that it's not accessible by SSH/VNC. The different interfaces say that sure, everything's fine. When I do a launchctl print there are some differences between the non-working and working versions. I don't know if these are actual indicators that it's down, or artifacts of the way I restarted them. The differences are consistent for both VNC & SSH: Not working but apparently running: path = (submitted by smd.215) submitted job. ignore execute allowed. system service = 0 Working after launchctl stop/restart: path = /System/Library/LaunchDaemons/<plist file> system service = 1 So, a few questions: Has anyone else seen this? Is there some way to get more error information about why sshd is exiting in the logs/console? Is there a way to detect that sshd is failing, even though there's no system log entry for the failure, and the various interfaces show that everything's fine? What's the cleanest way to tell the system to restart remote access every day just in case it can't be identified any other way?
1
0
1.5k
Jul ’22
Github CI UITest gives flaky tests 'Unable to monitor event loop'
I am running my UI Tests on Github CI and the tests are flaky. I don't understand how I can fix it. The animations are disabled and I am running the tests on a iPhone 13 plus. A lot of tests are running green, but some are not working. Locally, I got everything working. These are some logs: 2022-06-21T13:42:23.2627250Z t = 63.34s Tap Cell 2022-06-21T13:42:23.2707530Z t = 63.34s Wait for com.project.project to idle 2022-06-21T13:42:23.2733620Z t = 63.41s Unable to monitor event loop 2022-06-21T13:42:23.2734250Z t = 63.41s Unable to monitor animations 2022-06-21T13:42:23.2734800Z t = 63.42s Find the Cell 2022-06-21T13:42:24.1158670Z t = 64.45s Find the Cell (retry 1) 2022-06-21T13:42:24.1287900Z t = 64.45s Collecting extra data to assist test failure triage 2022-06-21T13:42:24.2022460Z /Users/runner/work/project/UITestCase.swift:665: error: -[project.UserTagTest testTapInTextView] : Failed to get matching snapshot: Lost connection to the application (pid 12676). (Underlying Error: Couldn’t communicate with a helper application. Try your operation again. If that fails, quit and relaunch the application and try again. The connection to service created from an endpoint was invalidated: failed to check-in, peer may have been unloaded: mach_error=10000003.) It can not find the cell because of these logs: Unable to monitor event loop Unable to monitor animations I know this because I sometimes get different errors than the error above, which says that the connection to the application is lost, right below the Unable to monitor... error logging. Is there anything I can try? I don't have a reproduction project. This is the command that is executed: xcodebuild test -project project.xcodeproj -scheme project-iosUITests -destination 'platform=iOS Simulator,name=iPhone 13 Pro,OS=15.5' The CI runs 35 tests and 5 fails randomly with the Unable to errors. Is there any suggestion to fix this problem?
1
1
1.2k
Jun ’22
How to beta test a non-production environment in TestFlight?
I want to use TestFlight to distribute a beta version of my app but I don't want it to point to my production environment. After testing, I would like to submit a build to the app store that point to my production environment. However, I do not want to include a setting in my app that allows for changing environments because I don't want production users doing that. What is the best practice in this case? For now, I am not using TestFlight to distribute my beta version and then I separately make a build pointing to production that gets sent to Apple.
1
0
1.2k
Jun ’22
SPM in a continuous integration platform like CircleCI
Hi, We are currently using xcframework dependencies in our large project and we've got a compile time of ~15min on CircleCI. We are trying to move a few dependencies from xcframework to Swift Package Manager but I'm seeing that there is a lot of time being added to our compile time as xcodebuild will always compile spm also. I've tried caching SourcePackage to limit the download steps but I wasn't able to find a way to cache the spm dependency builds also. Is this possible ? What is the strategy of compiling large projects with multiple SPM dependencies on a CI system.
0
2
1.6k
Jun ’22
"DVTPortal: Error: Your session has expired" with xcodebuild
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 =&gt; 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.
Replies
6
Boosts
1
Views
22k
Activity
Jan ’23
ld: library not found for -lBoringSSL-GRPC Xcodebuild React Native
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!
Replies
1
Boosts
0
Views
4.4k
Activity
Dec ’22
Xcode 12 Beta 2 causes Xcode Server to be unmanageable
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 &amp; 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?
Replies
2
Boosts
0
Views
1.7k
Activity
Dec ’22
iOS 15 - UI Test keeps asking pin code for "Enable UI Automation" in CI
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?
Replies
1
Boosts
1
Views
1.5k
Activity
Nov ’22
Xcode stop UI testing on any single test failure
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.
Replies
1
Boosts
0
Views
1.9k
Activity
Nov ’22
Xcode Cloud - build release notes
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?
Replies
1
Boosts
8
Views
2.2k
Activity
Oct ’22
Xcodebuild Archive fails to errSecInternalComponent in GitHub Action
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
Replies
4
Boosts
0
Views
3.5k
Activity
Oct ’22
Cannot create post action in Xcode Cloud
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.
Replies
0
Boosts
1
Views
1.1k
Activity
Oct ’22
Swipe issue UITesting + fastlane
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!
Replies
0
Boosts
0
Views
1.3k
Activity
Oct ’22
failed to archive with xcodebuild script due to error framework not found Pods_NotificationServiceExtension on Jenkins
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!
Replies
0
Boosts
0
Views
1.2k
Activity
Aug ’22
Xcode Server bot internal-processing-error
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 ?
Replies
0
Boosts
1
Views
1.3k
Activity
Aug ’22
Xcode Server no longer supported?
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?
Replies
4
Boosts
5
Views
2.3k
Activity
Jul ’22
Xcode cloud enterprise version
Will Xcode cloud release an enterprise version? As a developer in a bank, our source are hosted in internal GitHub, and those dependencies are stored in internal nexus. So we could only access source and dependencies internally.
Replies
2
Boosts
0
Views
2.4k
Activity
Jul ’22
Parallel testing fails - failed to prepare simulator
Recently we get more and more problems due to non bootstraping or starting simulator clones on parallel testing. Unit & UI-Tests were all successful but the status is failed, because of this errors 'The test runner encountered an error (Failed to prepare device 'Clone 1 of iPhone 12' for impending launch.' The test runner encountered an error (Failed to prepare device 'Clone 4 of iPhone 12' for impending launch. CI environments are MacMinis based on intel and apple silicons, with Xcode 13.3.1.
Replies
0
Boosts
1
Views
1.5k
Activity
Jul ’22
Remote access to test system dying every few days
I'm using a Mac Mini as a Jenkins agent, which we use to run our Xcode tests on physical iOS devices. It's configured for remote access with SSH & screen sharing with VNC. Every few days they start failing completely. Sometimes one of them is up a bit longer, but more usually they're both down. If I look in the GUI it says it's running. The correct ports are listening. In Console I can see that the sshd process exits with 255 the instant it's started, but I haven't been able to get anything more specific. I've found that I can get SSH & VNC access back with launchctl bootout system/<svc name> launchctl disable system/<svc name> launchctl enable system/<svc name> launchctl bootstrap system <plist file name> The problem is that I can't tell from the remote device that it's not accessible by SSH/VNC. The different interfaces say that sure, everything's fine. When I do a launchctl print there are some differences between the non-working and working versions. I don't know if these are actual indicators that it's down, or artifacts of the way I restarted them. The differences are consistent for both VNC & SSH: Not working but apparently running: path = (submitted by smd.215) submitted job. ignore execute allowed. system service = 0 Working after launchctl stop/restart: path = /System/Library/LaunchDaemons/<plist file> system service = 1 So, a few questions: Has anyone else seen this? Is there some way to get more error information about why sshd is exiting in the logs/console? Is there a way to detect that sshd is failing, even though there's no system log entry for the failure, and the various interfaces show that everything's fine? What's the cleanest way to tell the system to restart remote access every day just in case it can't be identified any other way?
Replies
1
Boosts
0
Views
1.5k
Activity
Jul ’22
Github CI UITest gives flaky tests 'Unable to monitor event loop'
I am running my UI Tests on Github CI and the tests are flaky. I don't understand how I can fix it. The animations are disabled and I am running the tests on a iPhone 13 plus. A lot of tests are running green, but some are not working. Locally, I got everything working. These are some logs: 2022-06-21T13:42:23.2627250Z t = 63.34s Tap Cell 2022-06-21T13:42:23.2707530Z t = 63.34s Wait for com.project.project to idle 2022-06-21T13:42:23.2733620Z t = 63.41s Unable to monitor event loop 2022-06-21T13:42:23.2734250Z t = 63.41s Unable to monitor animations 2022-06-21T13:42:23.2734800Z t = 63.42s Find the Cell 2022-06-21T13:42:24.1158670Z t = 64.45s Find the Cell (retry 1) 2022-06-21T13:42:24.1287900Z t = 64.45s Collecting extra data to assist test failure triage 2022-06-21T13:42:24.2022460Z /Users/runner/work/project/UITestCase.swift:665: error: -[project.UserTagTest testTapInTextView] : Failed to get matching snapshot: Lost connection to the application (pid 12676). (Underlying Error: Couldn’t communicate with a helper application. Try your operation again. If that fails, quit and relaunch the application and try again. The connection to service created from an endpoint was invalidated: failed to check-in, peer may have been unloaded: mach_error=10000003.) It can not find the cell because of these logs: Unable to monitor event loop Unable to monitor animations I know this because I sometimes get different errors than the error above, which says that the connection to the application is lost, right below the Unable to monitor... error logging. Is there anything I can try? I don't have a reproduction project. This is the command that is executed: xcodebuild test -project project.xcodeproj -scheme project-iosUITests -destination 'platform=iOS Simulator,name=iPhone 13 Pro,OS=15.5' The CI runs 35 tests and 5 fails randomly with the Unable to errors. Is there any suggestion to fix this problem?
Replies
1
Boosts
1
Views
1.2k
Activity
Jun ’22
How to beta test a non-production environment in TestFlight?
I want to use TestFlight to distribute a beta version of my app but I don't want it to point to my production environment. After testing, I would like to submit a build to the app store that point to my production environment. However, I do not want to include a setting in my app that allows for changing environments because I don't want production users doing that. What is the best practice in this case? For now, I am not using TestFlight to distribute my beta version and then I separately make a build pointing to production that gets sent to Apple.
Replies
1
Boosts
0
Views
1.2k
Activity
Jun ’22
SPM in a continuous integration platform like CircleCI
Hi, We are currently using xcframework dependencies in our large project and we've got a compile time of ~15min on CircleCI. We are trying to move a few dependencies from xcframework to Swift Package Manager but I'm seeing that there is a lot of time being added to our compile time as xcodebuild will always compile spm also. I've tried caching SourcePackage to limit the download steps but I wasn't able to find a way to cache the spm dependency builds also. Is this possible ? What is the strategy of compiling large projects with multiple SPM dependencies on a CI system.
Replies
0
Boosts
2
Views
1.6k
Activity
Jun ’22
Xcode Cloud MacBook Question
Hi all, If I understand right Xcode Cloud run on real devices but does run on real macOS devices?For Xcode Cloud I need to have a github project done before I can use it?
Replies
1
Boosts
0
Views
1.4k
Activity
Jun ’22
Sample code with tests
Does Apple have Xcode Cloud sample code, or any sample code that contains tests?
Replies
0
Boosts
0
Views
1.2k
Activity
Jun ’22