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

27 Posts
Sort by:
Post not yet marked as solved
19 Replies
12k Views
I have two macs at home. One in my bedroom which is my development mac and one in my living room which is an old mac i put to good use. i would like to occasionally sit in my living room and continue my work from there to avoid fatigue sitting at my desk all day. i have enabled source control using local git repo. how can i continue with my xcode project on my second mac which runs the same os x?
Posted
by
Post not yet marked as solved
9 Replies
4.9k Views
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?
Posted
by
Post not yet marked as solved
2 Replies
2.6k Views
Hi, My name is Bin, software engineer at VBreathe in Sydney. We have a mobile app developed in Ionic Angular framework and managed to use xcode cloud to build and deploy the app to TestFlight. It worked well, but the speed is a bit slow, takes around 1 hour to finish the build. After checking the logs, the ci_post_clone.sh script took over 20 minutes to finish, because it installs bunch of tools and node packages, which are necessary to build the app. My question is that is there a way to cache these tools and node packages on xcode cloud, so no need to download & install them in every build? Cheers, Bin
Posted
by
Post not yet marked as solved
6 Replies
4.6k Views
We have a bit of a complicated build process and need to build the Widget outside of our main app and repackage since we are using a cross platform framework. I tried scripting out updating my Widget's Marketing Version but agvtool won't update the MARKETING_VERSION in the project.pbxproj file. Therefore, we end up getting these emails from Apple: ITMS-90473: CFBundleShortVersionString Mismatch - The CFBundleShortVersionString value ‘1.2.2’ of extension ‘MyiOSApp.app/PlugIns/widgetExtension.appex' does not match the CFBundleShortVersionString value ‘1.2.3' of its containing iOS application ‘MyiOSApp.app'. I run this and it says it's updating in the Widget plist (but not the project.pbxproj) so when I build with xcode via command line it doesn't update and when we submit to the App Store we get the above message from Apple: /usr/bin/agvtool new-marketing-version $(/usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" ../My.Crossplatform.App/My.Crossplatform.App.iOS/Info.plist) Setting CFBundleShortVersionString of project ios to:    1.2.3. Updating CFBundleShortVersionString in Info.plist(s)... Cannot find "ios.xcodeproj/../YES" Updated CFBundleShortVersionString in "ios.xcodeproj/../widget/Info.plist" to 1.2.3 I've had to resort to manually updating then submitting every time. What is the correct way to update the MARKETING_VERSION in the project.pbxproj file in a CI environment using bash?
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
2 Replies
2.5k Views
Hello! I have a Swift package (SPM) with a number of tests associated with it. These all work well locally, and I have created a GitHub repository for the package that can be used by any app. I would like to set it up where my package's tests are triggered automatically whenever I push a change to a branch in the repository. Unfortunately, per the documentation, Xcode Cloud is currently unable to build and test standalone Swift packages. I hope that this will be rectified some point soon as automated testing for them seems like it'd be a pretty common and understandable use case. My question: Is there a way to set an Xcode Cloud workflow up wherein a package's tests are triggered? Xcode Cloud clearly does support Swift packages that are used when building full apps, and there is plenty of documentation to that end. But it's not clear how to trigger those package's tests even through the use of a "dummy" app without moving a bunch of tests to the app itself. Is this possible? I'd really not like to duplicate all my tests in a dummy app if at all possible. Thanks!
Posted
by
Post not yet marked as solved
4 Replies
1.3k Views
Hello, we have a bunch of macs which we use for running automated UI test and we need to allow services kTCCServiceScreenCapture and kTCCServiceAccessibility to our application bundles (it's a kind of a screen sharing application). We tried to do a direct change in: User's ~/Library/Application Support/com.apple.TCC/TCC.db but it doesn't take effect as it looks like these permissions need to be granted in system TCC database The system database at /Library/Application Support/com.apple.TCC/TCC.db is write-only due to rootless. Is there any other way than completely disable SIP to grant these TCC permissions to our bundles? Also we would be just fine to grant permissions manually when we're setting up the machine, but it seems these get reset from time to time. And that's my other question: How the TCC validation works? We're testing ad-hoc signed bundles as well as DeveloperID signed ones with the same Application ID and it seems that TCC gets confused over time and simply treats the permissions as not granted. Would modifying csreq in TCC.db record to contain only requirement identifier=my.bundle.app.id prevent this behavior or there is some other heuristics TCC uses for permission validation? Thank you, o/
Posted
by
Post not yet marked as solved
2 Replies
1.6k Views
I'm having problems with UI tests on an M1 runner using Xcode 14.3.1. In my project, I need to build using the Rosetta simulator because I have a dependency that is not updated to support the arm simulator. This dependency relies on OpenCV." This is the command that I use when I want to run UI tests on CI: xcodebuild ARCHS=x86_64 clean test -scheme UITests -configuration Debug -destination 'id=50E9C593-9A40-4E4D-B58D-1DE437CFBE3A' -parallel-testing-enabled YES -parallel-testing-worker-count 3 -maximum-concurrent-test-simulator-destinations 4 -test-iterations 3 -retry-tests-on-failure And this code run only with 1 clone of simulator. Anyone know why?
Posted
by
Post not yet marked as solved
2 Replies
1.5k Views
Hello guys, I was able to get code coverage and sonar-scanner working with Xcode Cloud. First in, in post-clone script I install sonar-scanner tool like this brew install sonar-scanner Then, in post-xcodebuild script, I do three things: (a) get current app version, (b) get app version, (c) run xcodebuild again with forced code coverage reporting, (d) find coverage data and convert it to the format that Sonarqube understands, and finally (e) run sonar-scanner, which uploads results to Sonarqube dashboard. cd $CI_WORKSPACE # declare variables SCHEME=[REMOVED] PRODUCT_NAME=[REMOVED] WORKSPACE_NAME=${PRODUCT_NAME}.xcworkspace APP_VERSION=$(sed -n '/MARKETING_VERSION/{s/MARKETING_VERSION = //;s/;//;s/^[[:space:]]*//;p;q;}' ./${PRODUCT_NAME}.xcodeproj/project.pbxproj) # clean, build and test project xcodebuild \ -workspace ${WORKSPACE_NAME} \ -destination 'platform=iOS Simulator,name=iPad (10th generation),OS=latest' \ -scheme ${SCHEME} \ -derivedDataPath DerivedData/ \ -enableCodeCoverage YES \ -resultBundlePath DerivedData/Logs/Test/ResultBundle.xcresult \ clean build test # find profdata and binary PROFDATA=$(find . -name "Coverage.profdata") BINARY=$(find . -path "*${PRODUCT_NAME}.app/${PRODUCT_NAME}") # check if we have profdata file if [[ -z $PROFDATA ]]; then echo "ERROR: Unable to find Coverage.profdata. Be sure to execute tests before running this script." exit 1 fi # extract coverage data from project using xcode native tool xcrun --run llvm-cov show -instr-profile=${PROFDATA} ${BINARY} > sonarqube-coverage.report # run sonar scanner and upload coverage data with the current app version sonar-scanner \ -Dsonar.projectVersion=${APP_VERSION} It all works fine but my team and I think that this is a workaround that shouldn't work like this, because technically xcodebuild command is executed two times, first by Xcode Cloud, then by my script, which takes a lot of time and feels hacky. Ideally, Xcode Cloud's Build and Test actions should generate code coverage (the option is already enabled in our project) and give us access to profile data in DerivedData folder which I can access with environment variable CI_DERIVED_DATA_PATH. However, there is none. My question is, do I do everything correctly? Is there a way to improve this flow? Do I miss on how to correctly get code coverage data from Xcode Cloud?
Posted
by
Post not yet marked as solved
0 Replies
747 Views
I'm trying to connect my Developer Account in App Store Connect with Slack for CI notifications from Xcode Cloud. Apple docs for reference: https://developer.apple.com/documentation/xcode/connecting-xcode-cloud-to-slack#Install-the-Slack-app-for-Xcode- Cloud-using-App-Store-Connect I've tried connecting to the Slack workplace from the App Store Connect User settings and from Xcode Cloud in Xcode and on App Store Connect but no luck so far. The process always goes through and the Xcode Cloud Slack app gets installed on the Slack workspace. However it does not show up on the App Store Connect. I’ve attached a screenshot of the App Store Connect Notification Settings page after I went through the “Slack | Connect” flow successfully. It states “Your Slack account for has been connected”. However The Slack account still does not show as connected on the same page under "Send To”. Any help appreciated! Was anyone able to connect successfully?
Posted
by
Post not yet marked as solved
3 Replies
1.6k Views
Hello! I have found a weird behavior change when running xcodebuild -create-xcframework in Xcode 15 compared to running it in Xcode 14.3.1. If I run the command like this in Xcode 15: xcodebuild -create-xcframework -framework "pathToFrameworkInATemporaryDirectory" -debug-symbols "pathToDebugSymbols" -output "Something.xcframework" I get this error: error: cannot compute path of binary 'Path(str: "temporaryPathToTheUnixExecutableFile")' relative to that of 'temporaryPathToTheFramework' But if I trace that path to the unix executable file in the framework, it is present. If I run that same command in Xcode 14.3.1, it works fine. I can create the xcframework successfully in Xcode 15 if I don't copy the framework to a temporary directory before calling xcodebuild -create-xcframework and I use that original path. Why is this problem happening now in Xcode 15? Any help is appreciated, thank you.
Posted
by
Post not yet marked as solved
0 Replies
741 Views
I've got a Mac Mini running as a CI/CD server; it's a game project, and every time we push a change to the repo, the server creates a build & uploads it to TestFlight. I've noticed that after running the server for around a week or so, the main drive is getting filled to the point of the machine becoming unresponsive (and our builds failing). After some investigation, I've determined that /private/var/folders/ is getting filled up with... something, related to the Xcode build/archive. It seems like we absolutely do not need this information, so I've periodically run rm -rf /private/var/folders/* to clean it out – some folders are permission-protected, but regardless, I'm able to recover >100GB with this method. Although this workaround does suffice, I'm just wondering what kinds of files Xcode is creating here, and whether there's a cleaner/best-practice method to remove them.
Posted
by
Post not yet marked as solved
0 Replies
522 Views
Hi, At this moment Xcode Cloud builds our SDK scheme. What we are interested is running a post-xcodebuild script that will run our custom: "xcodebuild -create-xcframework...." which in turn, will produce the product (file) we want to download and use. Of course, locally the script works great but we would like to integrate this process in Xcode Cloud CI. The way I see a good solution will be to have the product of the script available for download in the Artifact section inside Xcode Cloud. But, if it can't be done, how can we provide a link to the file after the machine has finished to run the script or does it mean that once the machine has finished the build it deletes everything. What about Xcode Cloud API ? is there a solution there ? Perhaps a another workaround would be to add another code to the script that will upload the script product/file to, for example, S3 so we would have access to it ? Thank you.
Posted
by
Post not yet marked as solved
2 Replies
773 Views
Since updating from Xcode 14 to Xcode 15, I've had to manually select all the changed files. Is there a preference setting or a way to automate this process, like before? I need to manually click on 'Stage Change' next to the 'M' in the 'Changes' view. Thank you very much for your heeeeelp!
Posted
by
Post not yet marked as solved
0 Replies
467 Views
Hello, I am looking for help with using TestPlans in my ci tool. My workspace consists of my main project and 2 frameworks, that are linked to my main project. I am using fastlane to run the test plan associated with my main app's scheme, which has my main project's test suite and my 2 frameworks' test suites. When using fastlane locally, it seems to build every test suite and run tests accordingly, but on my CI tool (I am using CircleCI), it just runs my main project's test suite. Can I get some help on this? I have tried to add a failing test to my CI tool and the tests still pass. Any help is much appreciated!
Posted
by
Post not yet marked as solved
2 Replies
728 Views
Our CI pipeline produces .xcresult bundles that allow developers to diagnose failures by opening them in Xcode. If the test crashes, we used to be able to open the diagnostic folders and inspect the raw test logs. As of Xcode 15, that option is no longer available. I know the Diagnostic data is there because I can view it with Xcode 14. Am I just missing something in the Xcode 15 UI? Or has the capability to browse the Diagnostics actually been removed?
Posted
by
Post not yet marked as solved
2 Replies
549 Views
I've pulled the project from Git. Someone else was working on it and it works perfectly fine for them, they can edit all the files. On mine I can only edit what I have added, the files which were already there I can edit, but their changes and additions do not show on the xcode directory on the left side. If i go to finder and click on the project folder there I can see their changes on there.. I tried clicking the lock icon on the preview screen and it says this: “file.swift” is currently locked because it is a remote resource. and when clicking Unlock The file is a remote resource. Try making a local copy. Literally have no idea what to do now. I tried copying their files and making new files and folders like how they made on their branch but it says its already existing even though it is not showing on my swift directory! If you need any other information I am happy to provide it for you!
Posted
by
Post not yet marked as solved
1 Replies
447 Views
Hi, I have created the applications (debug and runner) using xcodebuild. I have tried it both using Xcode 14.3.1 and 15.1. I used the xcodebuild build-for-testing... with -configuration set to Debug (I've also built the apps by omitting the -configuration altogether). The configurations are set correctly in Xcode, and I can run the automation from Xcode and running xcodebuild. I am using a different tool other than xcodebuild to run the tests (I'm using go-ios https://github.com/danielpaulus/go-ios). The issue I'm having is that right at the beginning of the test, I'm getting this error "Failed to retrieve test configuration from IDE". I know it's something to do with the two apps (debug and runner appp), because I've made comparison to a brand new application I had created using Xcode. I assume this is something to do with the build configurations we have in the app (Debug or Release), but they're all correctly set in Xcode, and I can also run the tests (albeit using the xctestrun file) without any problems. Do you know what could be causing this? In particular, what could cause the above error to be generated? Any help (however related or unrelated you think it could be) is greatly appreciated. Thanks in advance. Sep
Posted
by