macOS build fails with exit status 65

Bitrise Build Issue Report template

Description of the issue

I’ve build a really small SwiftUI app for macOS and try to build and run it, building goes fine but then it crashes with below error and exit status 65 . The pipeline for the iOS part of my app runs fine with both Unit and UI Test.

▸ Copying /Applications/Xcode-12.5.beta.3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/usr/lib/libXCTestSwiftSupport.dylib
▸ Copying /Applications/Xcode-12.5.beta.3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/PrivateFrameworks/XCTAutomationSupport.framework
▸ Copying /Applications/Xcode-12.5.beta.3.app/Contents/Developer/Platforms/MacOSX.platform/Developer/Library/Frameworks/XCTest.framework
▸ Touching Tests\ macOS.xctest (in target 'Tests macOS' from project 'PoC_AZ-pipeline')
Last lines of the Xcode's build log:
Test session results, code coverage, and logs:
	/Users/vagrant/Library/Developer/Xcode/DerivedData/PoC_AZ-pipeline-gpdcytfqyoypbndbmunaumrhvirk/Logs/Test/Run-PoC_AZ-pipeline (macOS)-2021.04.14_18-05-36-+0100.xcresult
Testing failed:
	Tests macOS:
		Tests macOS-Runner (1799) encountered an error (Failed to whitelist test runner process for UI testing. If you believe this error represents a bug, please attach the result bundle at /Users/vagrant/Library/Developer/Xcode/DerivedData/PoC_AZ-pipeline-gpdcytfqyoypbndbmunaumrhvirk/Logs/Test/Run-PoC_AZ-pipeline (macOS)-2021.04.14_18-05-36-+0100.xcresult. (Underlying Error: Unable to run UI Tests because Xcode Helper does not have permission to use Accessibility. To enable UI testing, go to the Security & Privacy pane in System Preferences, select the Privacy tab, then select Accessibility, and add Xcode Helper to the list of applications allowed to use Accessibility))
** TEST FAILED **
Testing started
Test failed, error: exit status 65

It doesn’t matter if I only have Unit Tests or also UI Tests. And as this page states it should work when not having a development team assigned. Locally my tests run fine, but I indeed have that Xcode Helper enabled in my system settings.

Environment:

Bitrise
The project has Deployment Target 11.0, I have Xcode 12.4 on my Mac.
The stack on Bitrise is Xcode 12.5 on macOS 11.2 (Big Sur), but there is no other option with Big Sur.

If on Bitrise.io: which stack? If not on Bitrise.io: on what operating system? (Plus any other information you can share)

Xcode test for Mac, version 1.4.1

I tried the suggestions under ** Xcode Unit Test fails without any error, with exit code 65 :anchor:** but the same error pops up. It does give way more logging now and I can see this part just above the previous error but I don’t know what to do with it:

xcodebuild[1544:9742] [MT] DVTLocalComputerLogAspect: generateRuntimeProfileDirectoryPathForApplicationWithBundleIdentifier:runnableLocation:error:: Failed to create directory within application data container because either the app record ({ bundleID: xx.xxxxxxxxxx.Tests-macOS.xctrunner, URL: file:///Users/vagrant/Library/Developer/Xcode/DerivedData/PoC_AZ-pipeline-gpdcytfqyoypbndbmunaumrhvirk/Build/Products/Debug/Tests%20macOS-Runner.app }) or the data container URL ((null)) was nil; falling back to superclass implementation.
Tests macOS-Runner[1629:10970] Running tests...

Reproducibility

  • Does a “Rebuild” help? (You can trigger a rebuild from the Build’s page, by clicking the “Rebuild” button in the top right corner of a finished build) : YES/NO
  • Does a rebuild without caches help? (You can remove the Cache:Pull and Cache:Push steps temporarily to not to use the cache, or you can delete all the caches on the Settings tab of the app. : YES/NO
  • Does the issue happen sporadically, or every time? : Every time
  • Does upgrading the build Step to the latest version help? : YES/NO
  • When did the issue start? : From the start a few days ago

Local reproduction

Can it be reproduced on your own Mac/PC by following our local debug guide? Please follow at least the first section (“Testing with a full clean git clone”) to make sure to test the state of the code what bitrise.io will get when it does a git clone in the clean environment! If possible please note which sections you tried.

Only by disabling the Xcode Helper in system preference (the opposite of the suggested fix in the error log).

Build log

Please copy paste the build’s bitrise.io URL here (or if the issue happens somewhere else then the full logs), or if you can’t share the url / log here then send the url or full log through a private channel (e.g. email - Contact us ), with a link to the related Discuss issue.

I’ve added the suspicious parts of the log above. If more is needed I can send it through a private channel.

Hello there @TimFH88 :wave:

Can you please send us the log file or the URL of the related build and also enable Support Access on the Settings tab of the app ( Enabling the Bitrise Support user for your app | Bitrise DevCenter ) so that we can take a more in-depth look?
I’d be happy to check some configs, and get back to you as soon as we have something. :slightly_smiling_face:

Hi @Roland-Bak,

I’ve enable the Support Access, you can find the builds here: https://app.bitrise.io/app/c09fff624af8786d#/builds

I’ve tried a couple of things I found online so there are a few builds you can check.
This app is a small test app so that I can try the Bitrise service, once it works I want to add my real projects here as well.

Thanks in advance!

Hello @TimFH88 :wave:

I was wondering if the issue comes up with Xcode 12.5 as well? If it does, could you please send me the latest build (with Support Access enabled)? :slight_smile: We’ll keep investigating!

Hi @Roland-Bak :wave:,

A regular build and one with just a unit test will build and succeed now! :smiley:
When I added a UI Test for macOS it now fails with this message:

Testing failed:
UI_Tests_macOS:
No signing certificate “Mac Development” found: No “Mac Development” signing certificate matching team ID “XXXXXXXX” with a private key was found.
Testing cancelled because the build failed.
** TEST FAILED **

But I guess I need to do what it says, will try to figure that out over the weekend.
So it seems the initial problem was solved by using Xcode 12.5. :+1:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.