Post not yet marked as solved
Desciption:
The UI tests work on the local machine (Mac mini), but not on the Xcode server. The Mac mini is also used for the Xcode server. For some integrations on the server, some UI tests work, but often they fail again for the next integrations.
iOS simulators and devices were used when running the UI tests. The error usually happens when typing into a textfield.
Some people suggested to modify the "setUp" and "tearDown" functions to this:
override func setUp() {
XCUIApplication().terminate()
super.setUp()
XCUIApplication().launch()
}
override func tearDown() {
super.tearDown()
XCUIApplication().terminate()
}
But that also didn't work.
I don't understand why the UITests don't work on the server, but do work on the local machine without the server.
Error:
Bot Issue for ProjectXYZ (test assertion in MovieTests.testXYZ())
Integration #1 of Bot on Mac mini
Test Failure: Failed to synthesize event: Timed out while synthesizing event.
Server-Environment:
Mac mini (2018)
Server API v19
Xcode 12.4
macOS 11.2.3
Server 5.11
Post not yet marked as solved
Context -
We have E2E Testing running on the CI on the iPhone devices.
The script performs the following steps -
Build the Test runner app from code.
Extracts the app file from the IPA.
Re-codesign the app with the required Provision Profiles.
Creates a .xctestrun file
Uses the xcodebuild command like the following to run the test -
xcodebuild -sdk iphoneos -destination id=<device_id> -xctestrun <path_to_xctestrun_file> -resultBundlePath <path_to_test_bundle_file> test-without-building -only-testing:E2ETestsBundle.xctest/<test_filter>
The above command installs the runner and target app into the device and starts executing the test.
The apps get installed and uninstalled at each run during a single execution.
Problem -
During the execution, the xcodebuild CLI tool, suddenly loses connection to the device and is not able to install the apps into the device and then results in the following error -
Testing failed:
E2ETestsBundle.xctest:
E2ETestsBundle-Runner encountered an error (Early unexpected exit, operation never finished bootstrapping - no restart will be attempted. (Underlying Error: Test runner exited before starting test execution. If you believe this error represents a bug, please attach the log file at /var/folders/1r/0xlnbmzd0yj3m_cc7p95yb4r0000gn/T/tmpl7d9p1s6/testResults.bundle/Staging/1_Test/Diagnostics/E2ETestsBundle-Configuration-Test Scheme Action-Iteration-1/E2ETestsBundle/Session-E2ETestsBundle-2022-04-13_205520-muaMCx.log))
** TEST EXECUTE FAILED **
Points to note -
The xcodebuild CLI tool will keep on failing with the error once it occurred until recovered.
Even while the xcodebuild is in a failed state, the devices are still accessible via Xcode IDE and other CLI tools like libimobiledevice and are able to install both the test runner and target applications.
This is occurring intermittently across all devices models and across subversions of iOS 14 and 15.
Recovery -
The only way to recover is to reboot the device.
Even after a reboot, the devices start facing this exception again after a few days of execution.
As we can't keep on rebooting the device every time before execution, we need a solution to fix this problem.
Any help would be appreciated!!
Post not yet marked as solved
I have issue of crackling sound from the right speaker of MacBook Pro 13 inches 2020. I started getting this problem after downloading macOS Big Sur 11.4. I am considering this is an issue. Any suggestions or solution for it?
Post not yet marked as solved
When loading an app into TestFlight, there is a required input for a Beta Testing License Agreement. Are we supposed to provide our own agreements, or can we provide the link to Apple's "TestFlight Terms of Service" which covers Apple, the App Provider, and the tester? Thanks
https://www.apple.com/legal/internet-services/itunes/testflight/sren/terms.html
Post not yet marked as solved
Since upgrading to Xcode 13.3.1 unit-tests doesn't start anymore with "execute in parallel" set on.
"XYZ" (1234) encountered an error (Unexpected TestCaseDidStart...)
Post not yet marked as solved
I am getting a problem where builds in my Swift Playgrounds App project are failing -> Command CompileSwiftSources failed with nonzero exit code. When I rebuild the error goes away and it is successful, but is there a way I can get to the root of the issue and stop it?
Post not yet marked as solved
By using the UIKit views and controls, I wanted to know if the accessibility attributes (e.g. traits, value, identifier) are automatically added to the element in the screen? Or do I need to add manually the information for each attribute?
If it is done automatically, will it appear in the Accessibility Inspector when looking at each element in the screen on the simulator?
Post not yet marked as solved
I am trying to change the Mac OS Apps to a new locale other than English using the following arguments in XCUITest:
app.launchArguments = [
"-inUITest",
"-AppleLanguages",
"(nl)",
"-AppleLocale",
"nl_NL"
]
But I get the following message on the console:
Launching macOS application via NSWorkspace while sandboxed. Launch arguments and environment variables may be dropped
The app loads in English itself.
Is there any other way I can change the language of such apps ?
I DONT mind changing the system language as well, but it needs to be done programatically. I tried writing a zsh script to do sudo languagesetup but it requires a restart for the system language to change, which I can't do when my automation is running. If there is any other way please let me know.
EDIT: I open a third party app using the bundle Identifier, like this:
XCUIApplication(bundleIdentifier: "<app-bundle-name>")
Post not yet marked as solved
When importing an executable target for testing purposes, Xcode says the casing in the import is wrong, however it is not.
The module is named Swiftly, importing it as Swiftly results in the error Cannot load module 'swiftly' as 'Swiftly'.
Building it using the Swift CLI however, works perfectly fine, no issues. Also the Swift build using GitHub actions works. Xcode is the only tool that throws this error and denies to build the package.
I've already tried clearing all of Xcode's cache, cloning a clean version of the package, changing the executable name to use upper case, all without any results...
Is this an Xcode issue? Any suggestions for getting this solved?
Also note that changing the import to lower case makes the build work in Xcode, but this then breaks builds using the Swift CLI and GitHub actions, so this is not a solution.
The import:
@testable import Swiftly // Cannot load module 'swiftly' as 'Swiftly'
Package.swift
// swift-tools-version: 5.5
import PackageDescription
let package = Package(
name: "Swiftly",
platforms: [
.macOS(.v10_12),
],
products: [
.executable(
name: "swiftly",
targets: ["Swiftly"]),
],
dependencies: [
.package(url: "https://github.com/apple/swift-argument-parser", from: "1.0.0"),
.package(url: "https://github.com/JochenBe/Shell", from: "1.0.0")
],
targets: [
.executableTarget(
name: "Swiftly",
dependencies: [
.product(name: "ArgumentParser", package: "swift-argument-parser"),
"Shell"
]),
.testTarget(
name: "SwiftlyTests",
dependencies: ["Swiftly"]),
]
)
Post not yet marked as solved
tldr:
Our app is randomly crashing on startup (about 1 every 10 times) but no Crash Report alert is being shown on screen nor sent to the Crash Logs tab on TestFlight. The app just simply opens and immediately closes with no apparent reason. No logs of the crash are kept inside Settings -> Privacy -> Analytics & Improvements -> Analytics Data.
On the iPhone, the options Share iPhone Analytics and Share With App Developers are checked ( Settings -> Privacy -> Analytics & Improvements).
No memory leaks detected using the Instruments app.
More detailed explanation:
Out of 6 iPhones used for testing, only 1 iPhone is presenting the crash. It's an iPhone 11 iOS 15.4 and no one has been able to replicate the crash using the other iPhones. We have an iPhone SE (2020) and an iPhone 12 Pro Max both with iOS 15.4, but we haven't been able to replicate the bug.
The steps to reproduce the bug are these:
Open the app, switch views, then force-close it (swipe up the app in the App Switcher)
Quickly open the app again, switch views and force-close it again.
Repeat the previous step and in about the 10th iteration, the app will load and immediately close (crash)
I know that this the most unlikely scenario possible, but the company won't let pass the app to production until the cause of the crash is identified.
Specific questions:
Any idea how can we obtain a crash log in this situation?
How possible is the scenario where NOT the app, but the OS or the phone itself is the responsible for the crash? How can we prove that this is the case?
Is there any scenario where an App on TestFlight crashes without showing the crash dialog and without sending a crash record to the developer (Obviously assuming that you previously agreed to do it on the Privacy settings)?
How does TestFlight defines and handles crashes? Under those parameters and definitions, can this behavior be considered a crash?
Any idea of what can be happening?
Thank you very much.
Post not yet marked as solved
I am trying to test the In-App purchases by adding my test email to"Testers" in the Developer console.
When I use any of the sandbox emails added there, I get the following message:
Ask Permission
A request to buy ____ will be sent to your parent or guardian
[Environment: sandbox]
if I click on "Ask", nothing happens. I've rechecked that this email is not a child account. it has a DOB of 1980. In fact, it's not enrolled in any family sharing program.
I've tested multiple accounts after adding them to sandbox. Same issue occurs in all the accounts. One of those accounts is:
testkinderpass123@gmail.com
I also tried adding these accounts to family sharing plan so that even if a parental request is sent, I can accept that from another device. Unfortunately, "Try again" pop up errors started coming while doing so.
Hello,
When I try to test a new non-renewing subscription in-app purchase I get a weird prompt from iOS:
"Ask Permission", "A request to buy ... will be sent to your parent or guardian"
(please see screenshot below)
I'm using sandbox testers that can be specified at https://appstoreconnect.apple.com/access/testers
(all testers have a birth year specified at 1980 or older, so there should be now reason for Apple to consider it a child account)
I already tried to set up new and different sandbox testers with different App Store regions at https://appstoreconnect.apple.com/access/testers but nothing helps.
(Only a non-renewing subscription seems to be affected. I was able to complete other (non consumable) in-app purchases without any problems.)
I can't complete the purchase and can't finish my app as long as this problem exists. Does someone has a solution?
(nothing at all happens when I tap "ask")
Thank you so much!
Post not yet marked as solved
Hi all, with the latest XCode 13 (13A233) when we launch the unit test with any iOS 13 emulator some targets are not running and after a while this error is shown (no more info shown):
xctest (67626) encountered an error (Test runner never began executing tests after launching. If you believe this error represents a bug, please attach the result bundle at /Users/user/Library/Developer/Xcode/DerivedData/APP/Logs/Test/Test-APP-2021.10.07_16-36-23-+0200.xcresult)
If we use any iOS 12 emulator then it works. anyone have the same issue and managed to fix it?
Post not yet marked as solved
Hello everyone,
I'm running some tests and after upgrading my Xcode from 12.5 to 13.2.1, I can't run them anymore.
It shows me "Testing..." and after waiting 10 minutes it fails and this output is presented in the console:
LLVM Profile Error: Failed to write file : Filename not set
LLVM Profile Note: Profile data not written to file: already written.
LLVM Profile Note: Profile data not written to file: already written.
LLVM Profile Note: Profile data not written to file: already written.
LLVM Profile Note: Profile data not written to file: already written.
LLVM Profile Note: Profile data not written to file: already written.
LLVM Profile Note: Profile data not written to file: already written.
LLVM Profile Note: Profile data not written to file: already written.
LLVM Profile Note: Profile data not written to file: already written.
LLVM Profile Note: Profile data not written to file: already written.
LLVM Profile Note: Profile data not written to file: already written.
LLVM Profile Note: Profile data not written to file: already written.
LLVM Profile Note: Profile data not written to file: already written.
LLVM Profile Note: Profile data not written to file: already written.
LLVM Profile Note: Profile data not written to file: already written.
LLVM Profile Note: Profile data not written to file: already written.
LLVM Profile Note: Profile data not written to file: already written.
LLVM Profile Note: Profile data not written to file: already written.
LLVM Profile Error: Failed to write file : Filename not set
LLVM Profile Error: Failed to write file : Filename not set
LLVM Profile Note: Profile data not written to file: already written.
LLVM Profile Error: Failed to write file : Filename not set
LLVM Profile Error: Failed to write file : Filename not set
LLVM Profile Error: Failed to write file : Filename not set
LLVM Profile Error: Failed to write file : Filename not set
LLVM Profile Error: Failed to write file : Filename not set
LLVM Profile Error: Failed to write file : Filename not set
LLVM Profile Error: Failed to write file : Filename not set
LLVM Profile Error: Failed to write file : Filename not set
LLVM Profile Error: Failed to write file : Filename not set
LLVM Profile Error: Failed to write file : Filename not set
LLVM Profile Error: Failed to write file : Filename not set
LLVM Profile Error: Failed to write file : Filename not set
LLVM Profile Error: Failed to write file : Filename not set
LLVM Profile Error: Failed to write file : Filename not set
LLVM Profile Error: Failed to write file : Filename not set
LLVM Profile Error: Failed to write file : Filename not set
LLVM Profile Error: Failed to write file : Filename not set
LLVM Profile Error: Failed to write file : Filename not set
LLVM Profile Error: Failed to write file : Filename not set
LLVM Profile Note: Profile data not written to file: already written.
LLVM Profile Note: Profile data not written to file: already written.
LLVM Profile Error: Failed to write file : Filename not set
LLVM Profile Note: Profile data not written to file: already written.
LLVM Profile Error: Failed to write file : Filename not set
LLVM Profile Error: Failed to write file : Filename not set
LLVM Profile Error: Failed to write file : Filename not set
LLVM Profile Error: Failed to write file : Filename not set
LLVM Profile Error: Failed to write file : Filename not set
LLVM Profile Note: Profile data not written to file: already written.
LLVM Profile Note: Profile data not written to file: already written.
LLVM Profile Note: Profile data not written to file: already written.
LLVM Profile Note: Profile data not written to file: already written.
LLVM Profile Note: Profile data not written to file: already written.
LLVM Profile Note: Profile data not written to file: already written.
LLVM Profile Note: Profile data not written to file: already written.
LLVM Profile Note: Profile data not written to file: already written.
LLVM Profile Note: Profile data not written to file: already written.
LLVM Profile Error: Failed to write file : Filename not set
LLVM Profile Note: Profile data not written to file: already written.
LLVM Profile Note: Profile data not written to file: already written.
LLVM Profile Note: Profile data not written to file: already written.
LLVM Profile Note: Profile data not written to file: already written.
LLVM Profile Note: Profile data not written to file: already written.
LLVM Profile Note: Profile data not written to file: already written.
LLVM Profile Note: Profile data not written to file: already written.
LLVM Profile Note: Profile data not written to file: already written.
LLVM Profile Note: Profile data not written to file: already written.
LLVM Profile Error: Failed to write file : Filename not set
LLVM Profile Error: Failed to write file : Filename not set
LLVM Profile Error: Failed to write file : Filename not set
LLVM Profile Error: Failed to write file : Filename not set
LLVM Profile Error: Failed to write file : Filename not set
LLVM Profile Error: Failed to write file : Filename not set
LLVM Profile Error: Failed to write file : Filename not set
LLVM Profile Note: Profile data not written to file: already written.
LLVM Profile Note: Profile data not written to file: already written.
LLVM Profile Note: Profile data not written to file: already written.
LLVM Profile Note: Profile data not written to file: already written.
LLVM Profile Note: Profile data not written to file: already written.
LLVM Profile Note: Profile data not written to file: already written.
LLVM Profile Note: Profile data not written to file: already written.
LLVM Profile Error: Failed to write file : Filename not set
LLVM Profile Error: Failed to write file : Filename not set
LLVM Profile Note: Profile data not written to file: already written.
LLVM Profile Error: Failed to write file : Filename not set
LLVM Profile Error: Failed to write file : Filename not set
LLVM Profile Note: Profile data not written to file: already written.
LLVM Profile Note: Profile data not written to file: already written.
LLVM Profile Note: Profile data not written to file: already written.
LLVM Profile Note: Profile data not written to file: already written.
LLVM Profile Note: Profile data not written to file: already written.
LLVM Profile Note: Profile data not written to file: already written.
LLVM Profile Error: Failed to write file : Filename not set
LLVM Profile Error: Failed to write file : Filename not set
LLVM Profile Error: Failed to write file : Filename not set
I'm using an iPhone 11 Simulator (version 13.2) running iOS 15.2
Any ideas?
Post not yet marked as solved
Our automated tester has a suite of ui tests he's been working on. When these are enabled on our release pipeline they are:
Very slow
While all tests pass, when building the app afterwards the build hangs indefinitely
When disabling the tests the build is successful. The build machine is a 2020 M1 with 16GB ram running Xcode 13.1, I remoted in while it was running and the CPU usage / Ram seemed fine.
The CI log / Fastlane gives no error indication, it just freezes trying to link a library and I have to manually cancel the build
I'm wondering if the tests have exhausted something within Xcode build itself so it gives up at a certain point, is there anything obvious I can check?
Thanks
Post not yet marked as solved
I'm trying to test an API I'm writing with Structured Concurrency. I prefer to run my tests with continueAfterFailure = false so that I may establish preconditions on my tests. At the moment my test is:
func testRssUrl() async throws {
self.continueAfterFailure = false
let xml = PodcastXml.url(url)
let feed = try await xml.feed
let rssFeed: RSSFeed? = feed.rssFeed
XCTAssertNil(rssFeed) // Included for this sample
XCTAssertNotNil(rssFeed)
validate(zebraFeed: rssFeed!)
}
My expectation of Swift Concurrency is that the try await should hold the method, until xml.feed resolves to a value or throws. Either of the XCTAssertNil or XCTAssertNotNil should fail (in the actual test, I'm not using NotNil). As written, between the two asserts and the try, validate(zebraFeed: ) should never be called because of continueAfterFailure.
Yet it is. The test still fails because XCTAssertNil is failing, which is my actual expectation. Test execution should also be stopping there.
What am I missing?
Post not yet marked as solved
Sometimes when running UI tests, the tests fail on keyboard input because the "Speed up your typing" keyboard tutorial overlay obscures the keys. This happens randomly, but sometimes repeatedly.
Is there a way to turn this off? Checking for this tutorial before any keyboard input would significantly complicate tests just to check for one edge case...
Post not yet marked as solved
I have been developing my App with my Developer and it was all going well. Splash Screen worked, App loaded correctly. It linked to my Backend Server. All the relevant backend content was displayed. But now, I get a TestFlight or Diawi link to install the latest Beta Build of my App.
It doesn't work on my iPhone 12 Pro Max. But it does work on my developers iPhone in India. I am in the UK. He has had people test the build there. It works. I have invited people to download the TestFlight build here (the UK) and it doesnt work (no splash screen, no hamburger menu, no search screen).
So my Dev and I are stumped.
Screen Recordings:
India Install (working) on my Devs iPhone
https://youtu.be/52ZuSW1GvuQ
UK Install (not working) on my iPhone - No Hamburger Menu Working, No Search Button Working, No Splash on Launch
https://youtu.be/SmdyG5XapBw
If anyone who reads this has any comments/feedback as I am stumped.
Thank you in advance. MB
Post not yet marked as solved
Hi, i am testing with uitest our application, but tests are too slow. I cannot find any tips or how to accelerate it. Is there any option to make it quickier? Thanks
Post not yet marked as solved
MKLocalSearch.start - https://developer.apple.com/documentation/mapkit/mklocalsearch/1452652-start is giving me MKErrorGEOError=-8 which is not documented in MKError - https://developer.apple.com/documentation/mapkit/mkerror.
This only happens in my CI machine!
This only happens when running the tests, the app code works fine
I tried enabling location services on macOS just in case, but it didn't work.
That machine shouldn't have any network requests/URLs blocked
What fixed for me was to add request.naturalLanguageQuery = "Venue", but I don't understand why, nor why this would fix an error that is happening in only 1 machine.
Does anyone have any information about this?
Here's some sample code:
let request = MKLocalSearch.Request()
request.naturalLanguageQuery = "Venue" // this fixes it, but why?!
let ibereCamargoMuseumCoordinates = CLLocationCoordinate2D(latitude: -30.0777596,
longitude: -51.2477212)
let span = MKCoordinateSpan(latitudeDelta: 5, longitudeDelta: 5)
request.region = MKCoordinateRegion(center: ibereCamargoMuseumCoordinates, span: span)
if #available(iOS 13.0, *) {
request.resultTypes = .pointOfInterest
}
let localSearch = MKLocalSearch(request: request)
localSearch.start { response, error in
...
}
Here's some debugging output:
(lldb) po error
Error Domain=MKErrorDomain Code=4 "(null)" UserInfo={MKErrorGEOError=-8}
(lldb) po error.userInfo
▿ 1 element
▿ 0 : 2 elements
▿ key : AnyHashable("MKErrorGEOError") - value : "MKErrorGEOError"
value : -8
If you're interested I asked this on Stack Overflow - https://stackoverflow.com/questions/66976777/mklocalsearch-start-returning-undocumented-mkerrorgeoerror too.