Detect issues like logic failures, UI problems, and performance regressions by running tests on your app.

Posts under Testing tag

107 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

Distribute iOS app to Tester from website
Background: We are developing an App for both Windows, Android and iOS. Our process is that virtually every pull request must be tested by a tester before being pushed to the main branch. Up until now, we have been distributing the 3 versions to our testers via Microsoft AppCenter. Unfortunately, AppCenter is stopping per 31 March 2025 and we are looking for an alternative method. As the Play Store isn't really useful for us for distributing android apps (a test build can take a few hours before appearing according to their documentation), we may have to look into setting up our own distribution website for our apps. As such I was wondering, rather then using Test Flight for iOS, to also distribute the iOS app via our own website to our testers as it would be easier for our testers to have everything together. Even though our apps are build and signed using an "ad hoc" provisioning profile, it's still not possible to just install the .IPA files just by downloading it. The actual question: So my question is, how can I install our app to our testers from a website. Do I have to set the link as something specific? Or has AppCenter been using a trick not available to us mere mortals? To clarify: I am only asking for distributing to our testers using the ad hoc provisioning profile with the test devices registers at apple. I am NOT asking for distribution to end users, that goes via the App Store as usual.
3
0
126
6d
Problema con SPM y pods en xcode 16 y macos sequoia 15.1.1
When I try to install packages through spm it doesn't find the packages.swift file, and with pods I have problems with Foundation. Trying to install Firebase shows that many pods have issues with double quotes. I don't know if it's my PC using everything updated or what, but I'm having a lot of problems and I haven't been able to reconcile my first application. I don't want to give up, and I would like some advice, since you have managed it, I would appreciate some help. I have followed tutorials, cases of people with similar problems, but it always throws some error. My pc is mac m1
0
0
137
1w
Swift Testing tests in enum (namespace) extensions are acting strange
Using Xcode 16.1 (16B40). When adding a test suite with tests in an extension to an enum: The tests can be compiled and executed as expected (by clicking the diamond), and e.g. "Reveal in Test Navigator" works as expected. But after the tests have been executed, there is no check or cross diamond icons in the Test Navigator, If I right click the empty diamond in the margin for one of the tests and click "Jump to report", Xcode shows an alert saying "No test found matching the identifier MyEnumNameSpace/SomeTests/example()", which is very strange. Steps to reproduce: Create a new iOS app project using SwiftUI and Swift Testing. Add a file in the app target defining an enum namespace: public enum NamespaceDefinedInSomeApp {} Replace the content of the already created …Tests.swift file with: import Testing @testable import SomeApp // This works as expected: @Suite struct SomeTests { @Test func example() async throws { #expect(true) } } // This compiles and executes but acts strange: extension NamespaceDefinedInSomeApp { @Suite struct SomeTests { @Test func example() async throws { #expect(true) } } } // This compiles and executes but acts strange: enum AnotherNamespace {} extension AnotherNamespace { @Suite struct SomeTests { @Test func example() async throws { #expect(true) } } }
1
1
163
2w
My iOS app that I created since 2011, crashes on M4 machine (M1 is fine!)
A user gave me the crash log on his M4 machine when he first launches the app. I have M1 and my app works fine, which begs the question, why M4 has the crash! This is my app the I developed since 2011 until now. Any hints will be appreciated or anyone has similar issues like to share? ------------------------------------- Translated Report (Full Report Below) ------------------------------------- Incident Identifier: DA1CEECB-28D4-40A9-8F0C-7125812084F4 CrashReporter Key: FB8A5DBB-7140-D370-AC72-EC158266383C Hardware Model: Mac16,3 Process: Stocks Live [5506] Path: /private/var/folders/*/Stocks Live.app/Stocks Live Identifier: com.cinnamonmobile.StocksLive Version: 34.2 (34.2.0) AppStoreTools: 16B39 AppVariant: 1:MacFamily20,1:18 Code Type: ARM-64 (Native) Role: Foreground Parent Process: launchd [1] Coalition: com.cinnamonmobile.StocksLive [2018] Date/Time: 2024-11-27 12:41:48.0456 -0500 Launch Time: 2024-11-27 12:41:47.5710 -0500 OS Version: macOS 15.1.1 (24B2091) Release Type: User Report Version: 104 Exception Type: EXC_BAD_ACCESS (SIGBUS) Exception Subtype: KERN_MEMORY_ERROR at 0x0000000120034000 Exception Codes: 0x000000000000000a, 0x0000000120034000 VM Region Info: 0x120034000 is in 0x120034000-0x120038000; bytes after start: 0 bytes before end: 16383 REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL CoreAnimation 120030000-120034000 [ 16K] rw-/rwx SM=PRV ---> mapped file 120034000-120038000 [ 16K] r--/rw- SM=COW Object_id=14630bfe CoreAnimation 120038000-12003c000 [ 16K] r--/r-- SM=PRV Termination Reason: SIGNAL 10 Bus error: 10 Terminating Process: exc handler [5506] Triggered by Thread: 0 Kernel Triage: decmpfs - (arg = 0x80000001) compressor is not registered APFS - (arg = 0x200040) Pagein of compressed inode failed VM - (arg = 0x190000002d) Filesystem pagein returned an error in vnode_pagein VM - (arg = 0x0) Page has error bit set Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 CoreFoundation 0x18803f48c __CFStringCreateImmutableFunnel3 + 716 1 FincancialCoreFrameWork 0x10358d3c4 -[MOStringDocument loadFromContents:ofType:error:] + 156 2 UIKitCore 0x1ba34a67c __32-[UIDocument readFromURL:error:]_block_invoke + 104 3 libdispatch.dylib 0x187e20658 _dispatch_client_callout + 20 4 libdispatch.dylib 0x187e2fdb0 _dispatch_async_and_wait_invoke + 92 5 libdispatch.dylib 0x187e20658 _dispatch_client_callout + 20 6 libdispatch.dylib 0x187e2ef68 _dispatch_main_queue_drain + 980 7 libdispatch.dylib 0x187e2eb84 _dispatch_main_queue_callback_4CF + 44 8 CoreFoundation 0x1880f8e60 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16 9 CoreFoundation 0x1880b8a4c __CFRunLoopRun + 1996 10 CoreFoundation 0x1880b7bc4 CFRunLoopRunSpecific + 588 11 HIToolbox 0x193529f64 RunCurrentEventLoopInMode + 292 12 HIToolbox 0x19352fd54 ReceiveNextEventCommon + 636 13 HIToolbox 0x19352feb8 _BlockUntilNextEventMatchingListInModeWithFilter + 76 14 AppKit 0x18bbe398c _DPSNextEvent + 660 15 AppKit 0x18c523ddc -[NSApplication(NSEventRouting) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 688 16 AppKit 0x18bbd6a64 -[NSApplication run] + 480 17 AppKit 0x18bbad2e8 NSApplicationMain + 888 18 AppKit 0x18bdfb7f4 _NSApplicationMainWithInfoDictionary + 24 19 UIKitMacHelper 0x1a28f8b38 UINSApplicationMain + 972 20 UIKitCore 0x1b99de3a8 UIApplicationMain + 148 21 Stocks Live 0x102bcc058 0x102bc4000 + 32856 22 dyld 0x187c50274 start + 2840 Thread 1:: Dispatch queue: UIDocument File Access 0 libsystem_kernel.dylib 0x187f93b8c __ulock_wait + 8 1 libdispatch.dylib 0x187e21048 _dlock_wait + 56 2 libdispatch.dylib 0x187e20dfc _dispatch_thread_event_wait_slow + 56 3 libdispatch.dylib 0x187e2ffc4 __DISPATCH_WAIT_FOR_QUEUE__ + 368 4 libdispatch.dylib 0x187e2fb70 _dispatch_sync_f_slow + 148 5 UIKitCore 0x1ba351384 -[UIDocument(UIDocumentInternal) _performBlock:synchronouslyOnQueue:] + 76 6 UIKitCore 0x1ba347ff0 __40-[UIDocument openWithCompletionHandler:]_block_invoke + 588 7 libdispatch.dylib 0x187e1e8f8 _dispatch_call_block_and_release + 32 8 libdispatch.dylib 0x187e20658 _dispatch_client_callout + 20 9 libdispatch.dylib 0x187e27c60 _dispatch_lane_serial_drain + 744 10 libdispatch.dylib 0x187e28768 _dispatch_lane_invoke + 380 11 libdispatch.dylib 0x187e337e8 _dispatch_root_queue_drain_deferred_wlh + 288 12 libdispatch.dylib 0x187e33034 _dispatch_workloop_worker_thread + 540 13 libsystem_pthread.dylib 0x187fcf3d8 _pthread_wqthread + 288 14 libsystem_pthread.dylib 0x187fce0f0 start_wqthread + 8 Thread 2: 0 libsystem_pthread.dylib 0x187fce0e8 start_wqthread + 0 Thread 3: 0 libsystem_pthread.dylib 0x187fce0e8 start_wqthread + 0
3
0
228
3w
I get this Issue : ContentView.swift:3016:25 The compiler is unable to type-check this expression in reasonable time; try breaking up the expression into distinct sub-expressions. But I don´t know what I have to do. I am a noob. Can anybody help me.
// Füge OrderRow hinzu struct OrderRow: View { let order: Order var body: some View { VStack(alignment: .leading, spacing: 8) { HStack { Text("Tisch \(order.tableNumber)") .font(.headline) Spacer() Text(order.status.rawValue) .font(.caption) .padding(.horizontal, 8) .padding(.vertical, 4) .background(order.status.color.opacity(0.2)) .foregroundColor(order.status.color) .cornerRadius(8) } Text(order.timestamp, style: .time) .font(.caption) .foregroundColor(.gray) ForEach(order.items) { item in Text("\(item.quantity)x \(item.item.name)") .font(.subheadline) } HStack { Spacer() Text(String(format: "%.2f €", order.totalAmount)) .bold() } } .padding() .background(Color.white) .cornerRadius(12) .shadow(radius: 2) } } struct MenuItemRow: View { let item: MenuItem var body: some View { HStack { Text(item.name) .font(.headline) Spacer() Text(String(format: "%.2f €", item.price)) .font(.subheadline) } .padding() } } struct MenuItemsView: View { @Binding var selectedItems: [OrderItem] @Environment(.dismiss) private var dismiss func filteredItems(for category: MenuCategory) -> [MenuItem] { return sampleMenuItems.filter { $0.category == category } } func addItemToOrder(_ item: MenuItem) { if let index = selectedItems.firstIndex(where: { $0.item.id == item.id }) { selectedItems[index].quantity += 1 } else { selectedItems.append(OrderItem(item: item, quantity: 1)) } } var body: some View { NavigationView { List { ForEach(MenuCategory) { category in Section(header: Text(category.rawValue)) { let filteredItems = sampleMenuItems.filter ForEach(filteredItems) { item in } MenuItemRow(item: sampleMenuItems.filter) { addItemToOrder } } } } } .navigationTitle("Menü") .toolbar { ToolbarItem(placement: .navigationBarTrailing) { Button("Fertig") { dismiss() } } } } } } // Sample Menü-Items let sampleMenuItems: [MenuItem] = [ MenuItem(name: "Cola", description: "0,33l", price: 3.50, category: .drinks, image: "cola"), MenuItem(name: "Sprite", description: "0,33l", price: 3.50, category: .drinks, image: "sprite"), MenuItem(name: "Bier", description: "0,5l", price: 4.00, category: .drinks, image: "beer"), MenuItem(name: "Nachos", description: "mit Käsesauce", price: 5.50, category: .snacks, image: "nachos"), MenuItem(name: "Pommes", description: "mit Ketchup", price: 4.50, category: .food, image: "fries"), MenuItem(name: "********", description: "alkoholfrei", price: 6.50, category: .specials, image: "********") ] struct NewEventView: View { var body: some View { Text("New Event") } } struct EventManagementView: View { var body: some View { Text("Event Management") } } struct OrderRow: View { var order: String var body: some View { Text("Order: (order)") } } #Preview { ContentView() }
4
0
257
2w
NEPacketTunnelProvider stopped connecting on arm macOS 14 during tests
I have tests where I connect to NEPacketTunnelProvider. I run tests with circleci and fastlane, on self hosted intel and arm macs. I updated macs from macOS 13 to macOS 14 and the tests on arm stopped connecting, while the same tests on intel kept working as usual. Moreover, I noticed the tests don't work when run from circleci and fastlane. If I cancel the job and click "connect" myself on the app that stayed hanging from the cancelled tests, the connection will succeed. But if the tests are running, the connection will fails. Running the tests from xcode succeeds too. These are the logs from the tunnel. Could you suggest me where to dig? Or maybe you can see the issue from the logs? Tunnel logs when they fail
1
0
183
3w
Testing Right-to-Left localization in a macOS app
I’m currently trying to localize one of my Mac apps for Right-to-Left languages. In Xcode, to test this, I set the language to ‘Arabic’ in the scheme, which then displays the language and mirrors the layout accordingly. I have two questions about this: macOS titlebar buttons: In the title bar at the top, shouldn’t the Close and Minimize buttons also be on the right side (mirrored)? How can I test this? Numerals: My UI still displays Latin numerals (123). I know this is correct in some Arabic-speaking regions, but I’d also like to test cases where Arabic-Indic numerals (١٢٣) are used. Is there a way to configure the scheme to test this?
2
0
214
Nov ’24
How to Test FinanceKit Transaction History in iOS?
Hello, I am currently developing an iOS application that leverages FinanceKit to access transaction history. I have already enabled FinanceKit in my developer account, but I am encountering challenges when trying to test the transaction history feature. Could anyone guide me on the best practices or specific steps needed to effectively test FinanceKit’s transaction history in a development environment? Any insights on mock data handling, API responses, or potential limitations during testing would be greatly appreciated. Thank you in advance for your help!
0
2
137
Nov ’24
Unable to run test in devices with MDM Profiles
Requirement : We wanted to run UI Automation using xcuitest in devices with MDM profiles. Steps : We have created a test target for our app and signed with MDM profile (in-house) Generated app and testbundle-Runner along with xctestrun files using “xcodebuild build-for-testing -scheme “App-TestRelease" -configuration “Release” -derivedDataPath "${CURDIR}/derivedData" -workspace "${PROJECT_NAME}.xcworkspace" -sdk iphoneos” Tried running “xcodebuild test-without-building -destination platform=iOS,id=000842883-**** -xctestrun App-TestRelease_iphoneos17.5-arm64.xctestrun -derivedDataPath /derived/“ Facing below issues xcodebuild[35481:3588352] IDELaunchReport: e2934a094f300d40:e2934a094f300d40: Finished with error: Unable to launch com.org.mdm.XCTest.xctrunner Domain: com.apple.platform.iphoneos Code: -12 User Info: { IDERunOperationFailingWorker = IDELaunchiPhoneLauncher; } -- Request to launch com.org.mdm.XCTest.xctrunner failed. Domain: com.apple.dt.deviceprocesscontrolservice Code: 2 Failure Reason: The request to open "com.org.mdm.XCTest.xctrunner" failed. : Failed to launch process with bundle identifier 'com.org.mdm.XCTest.xctrunner'. -- The request to open "com.org.mdm.XCTest.xctrunner" failed. Domain: FBSOpenApplicationServiceErrorDomain Code: 1 Failure Reason: The request was denied by service delegate (SBMainWorkspace) for reason: Security ("Unable to launch com.org.mdm.XCTest.xctrunner because it has an invalid code signature, inadequate entitlements or its profile has not been explicitly trusted by the user"). User Info: { BSErrorCodeDescription = RequestDenied; FBSOpenApplicationRequestID = 0x9f9; } -- The operation couldn’t be completed. Unable to launch com.org.mdm.XCTest.xctrunner because it has an invalid code signature, inadequate entitlements or its profile has not been explicitly trusted by the user. Domain: FBSOpenApplicationErrorDomain Code: 3 Failure Reason: Unable to launch com.org.mdm.XCTest.xctrunner because it has an invalid code signature, inadequate entitlements or its profile has not been explicitly trusted by the user. User Info: { BSErrorCodeDescription = Security; }
1
0
295
Oct ’24
xcrun xcresulttool Failed to create a new result bundle reader
I need to read results of a test in Xcode post-action of Test. So the script that runs after tests contains SUMMARY=$(xcrun xcresulttool get test-results summary --path $RESULT_FILE 2>> "$LOGS") If I run my script from terminal, everything is ok but if I launch tests and the post-action is executed, I got Warning: unknown environment variable SWIFT_DEBUG_INFORMATION_FORMAT Warning: unknown environment variable SWIFT_DEBUG_INFORMATION_VERSION Warning: unknown environment variable SWIFT_DEBUG_INFORMATION_FORMAT Warning: unknown environment variable SWIFT_DEBUG_INFORMATION_VERSION Error: Failed to create a new result bundle reader, underlying error: failed to read metadata with underlying error (type: FileSystemError: 3 - [:] - The operation couldn’t be completed. (MinimalTSCBasic.FileSystemError error 3.) Usage: xcresulttool <subcommand> See 'xcresulttool --help' for more information. It might be that the environment set by Xcode is missing something but I cannot figure out what, any idea?
2
1
354
Nov ’24
ios 18.0 bug UITabBarController "More" Tab First Item Not Displaying Properly on iOS 18
Hello everyone, I'm working on an iOS application using Objective-C and UITabBarController. My app has more than 5 tabs, so the additional tabs are placed under the "More" tab. However, I've encountered an issue specific to iOS 18 where the first item in the "More" tab does not show up properly. This issue does not occur in iOS 17 or earlier versions. Here's my setup method: (void)mainTabbarSetUp { NSMutableArray *tabItemArray = [NSMutableArray array]; UIViewController *viewController1, *viewController2, *viewController3, *viewController4, *viewController5, *viewController6, *viewController7; UINavigationController *navviewController1, *navviewController2, *navviewController3, *navviewController4, *navviewController5, *navviewController6, *navviewController7; viewController1 = [[UIViewController alloc] init]; navviewController1 = [[UINavigationController alloc] initWithRootViewController:viewController1]; navviewController1.tabBarItem.title = @"Watch List"; navviewController1.tabBarItem.image = [UIImage imageNamed:@"tab_icn_watchlist"]; [tabItemArray addObject:navviewController1]; // Similarly adding other view controllers... viewController6 = [[UIViewController alloc] init]; navviewController6 = [[UINavigationController alloc] initWithRootViewController:viewController6]; navviewController6.tabBarItem.title = @"Cancelled"; navviewController6.tabBarItem.image = [UIImage imageNamed:@"tab_icn_cancelled"]; [tabItemArray addObject:navviewController6]; self.mainTabBarController.viewControllers = tabItemArray; } What I've Tried: Verified that each view controller is correctly initialized and assigned to a UINavigationController before being added to the tab array. Logged the contents of the moreNavigationController to confirm that it contains the correct view controllers. Tested by reducing the number of view controllers to less than 5, and the issue does not occur. Ensured that all UINavigationControllers are configured consistently (e.g., translucency, bar style, etc.).
1
0
900
Oct ’24
Xcode not generating code coverage.
No coverage is generated for private xxxx.framework, but tests are running under this framework. This was perfectly working before and started giving this error after updating to Xcode 16. Failed to generate coverage for target xxxx.framework at paths ( "/Users/xxxxxx/Desktop/xcode/Debug-iphonesimulator/Common/xxxxxx.framework/xxxx" ): No object file for requested architecture The operation couldn’t be completed. (XCTHCoverageReportGenerationErrorDomain error 2.). (Underlying Error: No object file for requested architecture)
1
0
332
Nov ’24
Swift Testing not recognising tests
For my app I was trying to write some tests to ensure the functionality of all features. As I am using Xcode 16.0 I thought I might use Swift testing which was newly introduced and replaces XCTest. I created a new test target with Swift Testing and tried to run the first test, which was created automatically by the system. struct FinancialTests { @Test func testExample() async throws { #expect(true) } } Xcode is also showing the test diamond next to the function so I clicked on it to execute it. The app started to build and the build ended successfully. The the next step was testing. And after waiting for 10 minutes or so, no test was executed. First I thought maybe the test was not found, but in the test case overview all tests were shown: The run only shows this: Can someone help me to get this running. Many thanks!
3
1
434
Oct ’24
Accessing Window Server and other GUI services when running tests via SSH vs LaunchAgent
According to Technical Note TN2083 the Window Server advertises itself in the global bootstrap namespace, which is why you can launch GUI applications from SSH sessions, even if sshd/sshd-keygen-wrapper is launched as a launch daemon (in a non-GUI per-session bootstrap namespace). As I understand it this is also why SessionGetInfo() reports NO for sessionHasGraphicAccess, as the SSH session is not an Aqua session type, while CGSessionCopyCurrentDictionary() does return a valid dict, because in practice you have access to the window server. However, the tech note advices against running GUI programs from SSH sessions, as other GUI services may not be exposed to the global or non-GUI per-session bootstrap namespace. It uses com.apple.dock.server as an example of such a service, showing how Activity Monitor has different behavior when launched via SSH than via the UI. Based on the advice of the tech note, articles like https://aahlenst.dev/blog/accessing-the-macos-gui-in-automation-contexts/ recommends running CI UI tests via a Launch Agent instead of SSH. Now, I've tried to reproduce the the Activity Monitor case on macOS 12 and macOS 15, and I can not reproduce the missing Dock features. The Testing with Xcode documentation also says that: By default, when you use ssh to login to an macOS system that has no active user session running, a command-line session is created. To ensure that an Aqua session is created for an ssh login, you must have a user logged in on the remote macOS host system. The existence of a user running on the remote system forces Aqua session for the ssh login. Once there is a user running on the host system, running xcodebuild from an ssh login works for all types of tests. Which begs the question: Does modern macOS versions expose GUI services to the global or non-GUI per-session bootstrap namespace, or otherwise enable UI testing from SSH sessions, so that UI tests can safely be run from SSH sessions (as long as the user is logged in to the remote system's UI). Has things changed in this regard?
7
0
437
Oct ’24
Bonjour not working with UI Test Target
I am trying to browse an SSH Service from UI Test Target using NWBrowser let descriptor = NWBrowser.Descriptor.bonjour(type: "_superapp._tcp", domain: "local.") let browser = NWBrowser(for: descriptor, using: .tcp) browser.stateUpdateHandler = { newState in print("browser.stateUpdateHandler \(newState)") } I get failed(-65555: NoAuth) error nw_browser_fail_on_dns_error_locked [B1] DNSServiceBrowse failed: NoAuth(-65555) I have added _superapp._tcp in Bonjour Services for UI Test Target Info.plist. I have also added Local Network Permission in UI Test Target Info.plist. Everything works fine, when I call this Bonjour service from App Target. Doesn't work when I call this from UI Test Target.
3
0
371
Oct ’24
Xcode do not pause at breakpoints
In the latest version of Xcode, breakpoints are not displaying correctly, making it difficult to track code behavior. Previously, Xcode allowed you to step through each function, showing clear execution steps and allowing interaction to debug effectively. However, now it only shows memory addresses without providing meaningful insights, limiting the ability to interact with or test the code as it's being developed. Is anyone else experiencing this issue, or does anyone know of a workaround?
1
1
308
Sep ’24
Non-XCode crash logging for iOS?
I test my app, by building it and hoping it will go on my iOS. This is the only workflow I have to test my testing app. I use AVAudioEngine and AVAudioSession. It sounds painful but, yes. I literally comment out parts and build the app everytime and see if it would crash or not. Sometimes I'd get Crash Logs in the Analytics part, but I haven't managed to get them there anymore. So I had no more Crash Logs. I was wondering if there's a function or something. Maybe something that I can do in AppDelegate to make it create a Crash Log somewhere? Uncaught Exception overwrite, didn't solve the issue for me. It really has to be an actual crash log, something that catches these. If someone knows, let me know! Thanks
1
0
305
Sep ’24