Hi,
Our team uses Xcode Cloud to run unit tests, and since around November, we’ve been frequently experiencing timeouts with the following type of process:
@Test func hogeTest() async {
// do something
hoge.do()
// wait until done
await wait(condition: { hoge.isDone })
// test result
#expect(hoge.isSucceeded)
}
private func wait(condition: () async -> Bool, timeout: TimeInterval = 0.5, pollingInterval: TimeInterval = 0.01) async throws {
let deadline = Date().addingTimeInterval(timeout)
while Date() < deadline {
if await condition() { return }
try await Task.sleep(nanoseconds: UInt64(round(pollingInterval * TimeInterval(NSEC_PER_SEC))))
}
Issue.record("timeout")
}
Although sleep is supposed to wait for only a few milliseconds, there are cases where it takes more than 10 seconds, leading to a timeout.
What could be causing this instability in the sleep duration? Additionally, if there are other recommended ways to implement polling and waiting in Swift Testing, I would appreciate it if you could share them.
A feedback report (FB15899163) has already been submitted.
Best regards,
Dive into the vast array of tools, services, and support available to developers.
Post
Replies
Boosts
Views
Activity
I work on an SDK, and one of the ways we distribute it is as a pre-compiled static XCFramework.
As far as I know, it’s the nature of a static framework to not contain symbols since the framework will be embedded in the final app binary, and the symbols should then be generated.
However, when testing the "Validate" function of the Xcode 16 deployment process, our users are receiving a warning that says the framework does not contain symbols.
Is my assumption about static frameworks and symbols incorrect? Could this be a bug in Xcode 16? Should we modify something in our framework to inform Xcode that symbols are not needed?
Why did I receive a CONSUMPTION_REQUEST for the same transaction_id the day after I already received a REFUND for it?
I received a CONSUMPTION_REQUEST, but due to a program error, I failed to submit the customer information. Later, I was notified with a REFUND, indicating that the transaction had been refunded. However, the next day, I received another CONSUMPTION_REQUEST notification for the same transaction_id.
Can someone give me an easy way to fix this code?
Hi,
I tried to make a new branch of my project and upon doing so, all of my old files disappeared. They are no longer in my folder directory or available in Xcode. Please let me know if there is any way to recover these files. I don't see the files in my trash either.
I am using GoogleMobileAds package dependencies and now when I want to archive and export an app I get this two warnings :
Upload Symbols Failed
The archive did not include a dSYM for the GoogleMobileAds.framework with the UUIDs [13B55A37-D103-36E1-8D7B-FA4EAB2C8146]. Ensure that the archive's dSYM folder includes a DWARF file for GoogleMobileAds.framework with the expected UUIDs.
Upload Symbols Failed
The archive did not include a dSYM for the UserMessagingPlatform.framework with the UUIDs [A3941120-02A1-30B5-8C28-BFC0F9496E16]. Ensure that the archive's dSYM folder includes a DWARF file for UserMessagingPlatform.framework with the expected UUIDs.
I have updated the packages to 11.9.0 (lasted) and Xcode 16 to 16 RC (lasted also) and I would like to know how to fix this... With Xcode 15 I have no problem !! I can export with no warnings ! But now with Xcode 16 no... Thanks for helping !
I have a problem with my xcode. I try to install apps xcodes to manage multiple xcode. My xcode version on 15.2(i try to run on iOS 15 SE1 it's no problem) and after that i try to install xcode 16 beta 3 i try to run iOS 15 SE1 the simulator blank. After that, i delete xcode 16 beta 3 and use xcode 15.2 i try to run on Simulator SE1 iOS 15 the simulator can't response touch. I try to trigger with Device menu on simulator Home, lock, trigger screenshot, etc. The simulator not response touch. How to solve this problem ? how to remove all simulator if uninstall xcodes.
Hello fellow developers,
My team has been running into a persistent INVALID_CLIENT error while trying to implement Sign In With Apple JS in our Nextjs app with signInWithPopup from firebase/auth. Here is the full error:
Error getting access token from https://appleid.apple.com, OAuth2 redirect uri is: https://[redacted]/__/auth/handler, response: OAuth2TokenResponse{params: error=invalid_client, httpMetadata: HttpMetadata{status=400, cachePolicy=NO_CACHE, cacheDurationJava=null, cacheImmutable=false, staleWhileRevalidate=null, filename=null, lastModified=null, retryAfter=null, crossOriginEmbedderPolicy=null, crossOriginOpenerPolicy=null, crossOriginResourcePolicy=null, permissionsPolicies=[], headers=HTTP/1.1 200 OK, contentSecurityPolicies=[], originTrials=[], reportToHeaders=[], varyHeaderNames=[], cookieList=[]}}
I've checked every thread on these forums and stackoverflow for solutions to this very common issue, and we tried them all. We made sure to verify that the Services ID, Apple Team ID, Key ID and Private key are all correctly used in the firebase console, we have regenerated our keys, all to no avail.
We also contacted Apple Support via the Development And Technical option with Certificates, Identifiers, and Provisioning Profiles topics, but they directed us to code-level support, which excludes 3rd Party libraries so this does not seem appropriate for us.
Does anyone have any idea of what might be wrong or suggestions for something we could try? We are able to get the pop up to open with an Apple login form, allow us to enter the credentials, but then when we hit continue the error occurs.
We are using firebase version ^10.4.0
Any help would be greatly appreciated and let me know if I need to provide any additional info. Thank you.
Been using Xcode's Download Container for a short time, and at first there were no issues.
But lately, it doesn't always download all the files from my iPhone to the Mac. Sometimes cleaning the build folder works, other times not.
As well, the same happens whether I am connected to my iPhone via cable, or wifi.
Has anyone else had this issue?
Does the new HTTP Traffic instrument require iOS15 running on the device? I am attempting to profile my app and I get an error saying 'This device is lacking a required capability'?
This is for a profile page for the app I am building.
let updatedUser = User(
coder: <#NSCoder#>,
id: userId,
name: name,
email: email,
phoneNumber: phoneNumber,
profilePictureURL: nil,
bio: bio
)
Error code by line 1: Extra arguments at positions #2, #3, #4, #5, #6, #7 in call
Error code by profile picture: 'nil' requires a contextual type
This error at the bottom of the code: Expected '}' in struct
Can someone please help me?
How do I get out of the Apple Beta Developer Program? Stop receiving developer beta software updates, Can someone help me, please?
ps: Sorry for my English
I tried to apply for the developer account from September to November. But the status is always "Pending".
I reached out to Apple support and they said they cannot receive my payment from bank.
The bank transaction is "Pending" as well. I asked the bank support and they said they have allowed Apple to collect the $99 USD money. And Apple support said it's the responsibility of the bank to give Apple the money.
And the Apple support recommended me to use the Developer app to apply for the Developer Program. But the app requires US driver’s license or state identification card to verify. I'm not a US citizen so I cannot use the Developer app. I'm forced to use the website.
I'm so confused and want to know:
Isn't it the responsibility of Apple to collect the money authorized by the bank?
The status of my last three bank transactions are still "Pending" and the bank said it's the responsibility of Apple to collect the money. They cannot cancel the pending transaction.
I feel like a piece of shit being thrown around by terrible customer services. I really want to cry.
I am not able to load my Apple Developer account details in Xcode in my new MacBook. After going to preferences in Xcode and signing in with Apple ID, after few seconds, it prompts the following error “Unexpected nil property at path: 'Actor/relationships/providerid’”. How can I fix this.
Since about two weeks Xcode has been unable to download other app versions than the pre-selected set of versions shown in Organizer for any of the sub selections like Crashes or Feedback. I can see some crashes and feedback for the versions that were already there but when i choose "More versions..." in the version selector the popup shows but after about a minute i get a message that the versions failed to load due to a network error.
I've tried every few days, on multiple networks (all with good fiber connections), for two different team accounts and for multiple apps, but in none of these scenario's Xcode is able to download new versions so i'm pretty sure there is something broken on Apple's side but i don't see many reports online about this nor anything here on the forum.
Is anybody else experiencing these issues?
Our use case is that we need to run a CLI script (on Mac) to set up backend configuration before each test case (UI test on real iOS device). The setup logic is test specific, so using pre-build scripts is not an option.
Is this support in any way or what are best practices around such a setup?
Ideally, we would still be able to execute the tests from within Xcode.
Our use case is that we need to run a CLI script (on Mac) to set up some backend configuration for a UITest that then runs on iOS (simulator or actual device). The setup logic is test specific so using pre-build scripts is not a an option. Is that support in any way or what would be alternatives to go about this.
I am working on implementing App Clip functionality in my iOS application. While I can successfully launch the App Clip using a QR code, I am unable to launch it through other means such as the Messages app or deep links shared through other applications.
I'm not able to see my account information on the Mac Mini machine with M2 CPU.
I log in to my account in Settings, but in Xcode 16.1 it fails with the
Decoding Error
There was a failure decoding response
I think this is the same as here:
https://developer.apple.com/forums/thread/767673
https://developer.apple.com/forums/thread/769069
https://developer.apple.com/forums/thread/759877
Hello,
I am using Xcode 16.1 (16B40) on MacOS Sequoia 15.1.0 using a Macbook pro M1 Max
I am developing an app for iOS 17 and 18 using SwiftUI
I created UITests to take the screenshots for the appStore on the simulator
The tests run well and all of them are succeded
The problem appears when I try to get the screenshot files from the xcresult files after the test. There is not any screenshot inside it.
I found a data folder and a Info.plist file. In the data folder there are a lot of files with this pattern data.03zD4C6IGFFthK14NwA8mNvcwFHT16g6Tl40Tl1YmBC1bNh6d0YIcnWKyUaQPDXoa8fYo6C3Xcv8xvMtE3_NEXA== and other files with this pattern refs.03zD4C6IGFFthK14NwA8mNvcwFHT16g6Tl40Tl1YmBC1bNh6d0YIcnWKyUaQPDXoa8fYo6C3Xcv8xvMtE3_NEXA==
Ok, I tryed to use fastlane to automatize the screenshots but the problem is still present. The xcresult files have not any png file.
I had no problems doing this action (getting screenshots from a xcresult file) in previous versions of MacOS and Xcode in my current machine.
I just updated my machine to MacOS Sequoia 15.1.1 and the problem is still present
Honestly I don't know how to fix this situation.
With Xcode 15 I had not any problem with that but I am not sure if Xcode 16.0 was runing without problems because I didn't need to use this functionality in those months
Here is my code for a UITest:
import XCTest
final class ScreenshotsUITests: XCTestCase {
let app = XCUIApplication()
let device = "iPhone16"
override func setUpWithError() throws {
continueAfterFailure = true
}
override func tearDownWithError() throws {}
@MainActor
func testEnglishScreens() throws {
let lang = "en"
app.launchArguments.append("UITestMode")
app.launchArguments += ["-AppleLanguages", "(en)"]
app.launchArguments += ["-AppleLocale", "en_US"]
app.launch()
executeTestsForMenus(lang: lang, backLabel: "Back")
executeTestForMatch(lang: lang)
}
@MainActor
func testSpanishScreens() throws {
let lang = "es"
app.launchArguments.append("UITestMode")
app.launchArguments += ["-AppleLanguages", "(es)"]
app.launchArguments += ["-AppleLocale", "es_ES"]
app.launch()
executeTestsForMenus(lang: lang, backLabel: "Atrás")
executeTestForMatch(lang: lang)
}
private func executeTestForMatch(lang: String) {
let startButton = app.buttons["start-button"]
startButton.tap()
let key4 = app.buttons["key-4"]
XCTAssertTrue(key4.waitForExistence(timeout: 30), "Key 4 in match screen is not found")
key4.tap()
let key2 = app.buttons["key-2"]
XCTAssertTrue(key2.exists, "Key 2 in match screen is not found")
key2.tap()
makeScreenShot("playing", lang: lang)
let closeButton = app.buttons["close-button"]
XCTAssertTrue(closeButton.exists, "Close button in match screen is not found")
closeButton.tap()
}
private func executeTestsForMenus(lang: String, backLabel: String) {
let mainHeader = app.staticTexts["Math match"]
XCTAssertTrue(mainHeader.exists, "Header in main screen is not found")
makeScreenShot("mainMenu", lang: lang)
let settingsButton = app.buttons["settings-button"]
XCTAssertTrue(settingsButton.exists, "Settings button in main screen is not found")
settingsButton.tap()
makeScreenShot("Settings", lang: lang)
let backButton = app.buttons[backLabel]
XCTAssertTrue(backButton.exists, "Back button in match screen is not found")
backButton.tap()
let helpButton = app.buttons["help-button"]
XCTAssertTrue(helpButton.exists, "Help button in main screen is not found")
helpButton.tap()
makeScreenShot("Help", lang: lang)
backButton.tap()
let scoreButton = app.buttons["score-button"]
XCTAssertTrue(scoreButton.exists, "Scores button in main screen is not found")
scoreButton.tap()
makeScreenShot("Scores", lang: lang)
backButton.tap()
let playButton = app.buttons["play-button"]
XCTAssertTrue(playButton.exists, "Play button in main screen is not found")
playButton.tap()
makeScreenShot("matchBuilder", lang: lang)
let startButton = app.buttons["start-button"]
XCTAssertTrue(startButton.exists, "Start button in match builder screen is not found")
}
private func makeScreenShot(_ name: String, lang: String) {
takeScreenshot(app, named: "\(lang)-\(name)-\(device)")
}
}
import XCTest
extension XCTestCase {
func takeScreenshot(_ app: XCUIApplication, named name: String, fullScreen: Bool = false) {
let screenshot: XCUIScreenshot
if fullScreen {
screenshot = app.windows.firstMatch.screenshot()
} else {
screenshot = XCUIScreen.main.screenshot()
}
let screenshotAttachment = XCTAttachment(
uniformTypeIdentifier: "public.png",
name: "screenshot-\(name).png",
payload: screenshot.pngRepresentation,
userInfo: nil)
screenshotAttachment.lifetime = .keepAlways
add(screenshotAttachment)
}
}
and here is the content of my testplan file:
{
"configurations" : [
{
"id" : "35BC7C0B-9A5A-4027-9F30-36958C4C1AAF",
"name" : "Test Scheme Action",
"options" : {
"preferredScreenCaptureFormat" : "screenshot",
"testExecutionOrdering" : "random",
"uiTestingScreenshotsLifetime" : "keepAlways",
"userAttachmentLifetime" : "keepAlways"
}
}
],
"defaultOptions" : {
"targetForVariableExpansion" : {
"containerPath" : "container:myAppProject.xcodeproj",
"identifier" : "B27D1B022CA00314001A259B",
"name" : "MyAppProject"
}
},
"testTargets" : [
{
"parallelizable" : true,
"target" : {
"containerPath" : "container:MyAppProject.xcodeproj",
"identifier" : "B27D1B122CA00315001A259B",
"name" : "MyAppProjectTests"
}
},
{
"parallelizable" : true,
"target" : {
"containerPath" : "container:MyAppProject.xcodeproj",
"identifier" : "B27D1B1C2CA00315001A259B",
"name" : "MyAppProjectUITests"
}
}
],
"version" : 1
}
I made tests with old projects in my machine and those projects have the same problem with screenshot files in the xcresult bundles
I don't know if the problem is in my machine, my Xcode, MacOS or other ting. I don't know how to fix this problem
Please, can anyone help me?
Thanks in advance