Dive into the vast array of tools and services available to developers.

Posts under General subtopic

Post

Replies

Boosts

Views

Activity

Change the OSLog level that is written to Xcode console of a dependent library
I'd like to give control to the app developer that uses my library to select which level of logs they'd like to see from my lib (e.g. do they want to see all debug messages or just errors). I know there are filtering controls that Xcode gives us, but I'm wondering if there is a way to pull this off with code. Ideally the user callsite would look like MyLib(logLevel: .info). And then I would pass that info level somehow to OSLog. Today, I create my logger like this: let myLogger = Logger( subsystem: Bundle.main.bundleIdentifier ?? "UnknownApp", category: "MyLibrary" ) As far as I can tell, there is nothing I can then pass to my myLogger instance to configure the threshold level. I'm imagining an interface like: myLogger.logLevel(.warning) // Later... myLogger.debug("You won't see this") myLogger.error("But you will see this") Does OSLog and friends give us any ability to do this out of the box, or are we building little wrappers around OSLog to accomplish this? Thank you, Lou
4
0
409
Mar ’25
iOS 18.5 crash with iPad 7 only
Weirdness going on here. Our app is crashing on startup with iPad 7s running iOS 18.5. Before updating to iOS 18.5, it was working fine on iPad 7s. Even with iOS 18.5, it is working fine on every device we have tried including dozens of other iPads and iPhones. We have narrowed it down to the SquareReaderSDK. If we remove that SDK, it will launch and work without issues. But, many of our users need the SquareReaderSDK. The crash happens at app load, before appDelegate didFinishLaunchingWithOptions. So we can't figure out any way to debug the issue. Is anyone else having a similar issue? Square thinks it is an Apple issue.
4
0
103
Jun ’25
iOS Sdk Version vs iOS Version
When you update XCode it updates the sdk version, but do changes in the sdk take effect for apps running in a lower iOS version or only the corresponding iOS version or higher? For instance, https://developer.apple.com/documentation/ios-ipados-release-notes/ios-ipados-18_1-release-notes Do changes listed in the notes only happen for apps that are running on iOS 18.1 devices or on any device with the app compiled against the 18.1 sdk version? Am I the only person who finds the docs totally unclear on this?
4
0
454
Feb ’25
Xcode 26 Beta Simulator Bug: Issue with Fast Account Creation Using Passkeys
Hi everyone, We’re testing the new iOS 26 capability, Performing Fast Account Creation with Passkeys, using the sample project provided here: Performing Fast Account Creation with Passkeys. When running the project on the iOS 26 simulator and tapping the "Sign Up" button, we encounter the following error: The operation couldn’t be completed. (com.apple.AuthenticationServices.AuthorizationError error 1010.) From the header file, this error is described as: /// ASAuthorizationError.h /// This error signals that the device is not currently set up to create passkeys. ASAuthorizationErrorDeviceNotConfiguredForPasskeyCreation AS_API_AVAILABLE(ios(19.0), macos(16.0), visionos(3.0)) = 1010, We’ve tested this on both Xcode 26 Beta 1 and Beta 2, and the error persists on the simulator in both versions. However, when testing on a physical iOS 26 device, everything works as expected, just like in the WWDC demo. Could this issue be related to missing simulator settings? Or is it a potential bug in the simulator? Any advice would be greatly appreciated. Thanks in advance!
4
0
226
Jul ’25
Using resources with Swift Testing
Hey guys. I’m working on a project where I’m using the SwiftTesting framework instead of XCTest to run my unit tests. I have a file (test.png) located in my test resources folder: PackageName > Tests > PackageNameTests > Resources > test.png I’m trying to access this file in my tests, but I’m running into issues when trying to load it dynamically. Here’s what I’ve tried so far: Using Bundle.module.path(forResource:ofType:): This approach didn’t work, as Bundle.module seems to be unsupported or returns nil in Swift Testing. Using #file Macro for Relative Paths: I tried constructing a path based on #file and navigating to the resources directory, but it also didn’t yield the correct path. Has anyone successfully loaded test resources in the Swift Testing framework? Is there a recommended way to access resource files in Swift Testing, especially for projects where Bundle.module isn’t available? I've gone through the Apple Docs for Swift Testing, but I can't seem to find anything that answers my question. Thanks in advance guys!
4
1
1.4k
Dec ’24
Installer package is terminated after 600 seconds
Hi, I have an installer package that runs a postinstall script. The script can take a long time to complete, as one thing it does is copy about 10-30 GB of files using the rsync tool. We noticed on macOS 15 that the installer would fail almost exactly 10 minutes after it started. Looking in the /var/log/install.log, I see a message like this: 2025-07-01 12:54:32-07 Work-M1 package_script_service[21562]: PackageKit: Terminating PKInstallTask(pid:21573). Task has exceeded its 600 seconds of runtime. This does not happen in my testing on macOS 12 (Monterey) I have a few questions about this: A) Is this documented, and which OS introduced this? B) Is there a way a developer can extend or disable the time limit via a setting in the installer package. Or if not, is there a way end end user can disable it temporarily on their system? Thanks, Andrew
4
0
135
Sep ’25
Importing files to Files.app in iOS 26 Simulator
In previous versions of the simulator, it was possible to import files into the Files app by dragging them from the Finder into the Simulator. It appears that in the iOS 26 Simulator, this opens the file in Safari. I've only tried it with .json files so far. The documentation at https://developer.apple.com/documentation/xcode/sharing-data-with-simulator says that the original behaviour should happen: To add files to Simulator, select one or more files in Finder on your Mac, then click the Share button. Select Simulator from the share destination list. Choose the simulated device from the drop-down list. Simulator opens the Files app, and lets you select where to save the files. I'd love to learn if this is intentional behaviour, and if so, what workarounds there might be. I use this pattern quite a lot, as I have a HealthKit app, and I've built a system that allows me to export workouts as JSON files from a real device, that I can then import into a simulator for testing. Edit: I found a workaround. Make a folder in Files.app, then search for it within ~/Library/Developer/CoreSimulator/Devices. Open the folder in Finder, then add any files you want to be available in the Simulator.
4
6
207
Sep ’25
Clarification Regarding App Denial on Simulator and Its Impact on App Review Process
I would like to inquire about a concern related to the app review process. Specifically, I would like to understand if forcefully denying an application's execution on the iOS Simulator (for instance, by implementing a check in the code that prevents the app from running in a simulated environment) could negatively impact or delay the app’s approval during the App Store review process. This measure is intended solely for security and integrity reasons during development and distribution. The app functions normally on real devices, and all other guidelines and requirements outlined by Apple are being strictly followed. Could you please confirm whether such a restriction on the Simulator is acceptable, and if there are any best practices or recommendations from Apple regarding this? Thank you for your support, and I look forward to your guidance.
4
0
78
Jun ’25
Can't install iOS 26.0 beta through xcodes or xcodebuild
I need to automate updating to latest iOS betas as part of my ci script, but I can't get it to install iOS 26.0 beta for the life of me, using xcodes or xcodebuild. I can see the version listed using xcodes runtimes --include-betas, and I tried sudo xcodes runtimes install "iOS 26.0-beta1", but I would get the error Downloading Runtime iOS 26.0-beta1: 0% Error: ProcessExecutionError()\ I also tried xcodebuild -downloadPlatform iOS -buildVersion 23A5260l, where I found the specific build id on apples dev images website. But I would get the error iOS 23A5260l is not available for download. Specific version download failed, trying downloadPlatform ios latest... And similar error for trying xcodebuild -downloadPlatform iOS -buildVersion 26.0 or other version ids I found online. But this command would work for any other versions and betas listed on the website. I was able to install iOS 26.0 through xcodebuild -downloadPlatform iOS, which automatically installed it for me, but this is unideal for my situation, as I want to control which betas to install instead of just the latest one (like iOS 18.6 beta that just came out). Is anyone else also struggling with these errors? xcodes version 1.6.2 Xcode version 26.0 Beta (installed and selected through xcode)
4
1
247
Sep ’25
Swift Testing environment differences from regular executable
I am working on a Swift package which uses CoreAudio, and includes some tests in a testTarget which use the Testing framework, and a couple of executableTarget targets which exercise the same code. I'm using Xcode 16.2 on macOS 15.3.1. One of the things I do in the test code is create a HAL plugin, then find that plugin using the kAudioHardwarePropertyTranslateUIDToDevice. Finding the plugin that I just created always fails from within a Swift Testing test, unless I run the test which creates the plugin individually first, then separately, run the test which finds the plugin, by clicking on the little arrows next to the function names. If I put the tests in a serialized suite (so creation always happens first, then finding), running the suite always fails - it creates the plugin, but can't find it. If I run the 'find my plugin' test again manually, it is always found. If I call the same functions from a regular executable (the thing created by a "executableTarget" in my .package.swift file), the just-created plugin is always found. Is there a way to mimic the runtime environment of a regular executable in a Swift Testing target, or am I misunderstanding something? this my be related to this issue: https://github.com/swiftlang/swift/issues/76882 but I don't understand it well enough to be sure.
4
0
443
Feb ’25
Portal of Apple for tracking health(crashes/hangs)
We are looking for a platform or portal provided by Apple that allows us to track crashes, hangs, or other runtime issues faced by users while using our iOS/macOS application. This is similar to how we currently use Windows Error Reporting (WER) for our Windows application. Important note: Our application is not distributed via the Apple App Store — it is delivered through enterprise distribution or ad-hoc provisioning.
3
0
97
Apr ’25
notarization: ".pkg could not be extracted."
Hi, after a software update of our previously successfully notarizated installion .pkg we now receive a cryptic notarization issue refusing the entire .pkg: { "logFormatVersion": 1, "jobId": "5cff2d71-7228-4fb4-a39d-329084cd2713", "status": "Invalid", "statusSummary": "Archive contains critical validation errors", "statusCode": 4000, "archiveFilename": "my_installer.pkg.zip", "uploadDate": "2024-12-04T23:17:14.016Z", "sha256": "2f26d0376506abe130ac904d7cb0d0cd5428666624428da9f44da7756352844f", "ticketContents": null, "issues": [ { "severity": "error", "code": null, "path": "my_installer.pkg.zip", "message": "Package my_installer.pkg.zip has no signed executables or bundles. No tickets can be generated.", "docUrl": null, "architecture": null }, { "severity": "warning", "code": null, "path": "my_installer.pkg.zip/my_installer.pkg", "message": "The contents of the package at my_installer.pkg.zip/my_installer.pkg could not be extracted.", "docUrl": null, "architecture": null } ] } What could be the reason for that? We've also submitted the .pkg (not zipped) with the same result. We build it on different macOS versions, including Sonoma 14.7 with latest developer tools installed, without any change in outcome. But when extracting it via the undocumented: pkgutil --expand-full and .zipping the raw contents (without re-packaging it as .pkg) and sending it again, notarization succeeds for all components. However the installation for the .pkg still fails with the notarization dialog. I was under the assumption that it is sufficient to notarize the .pkg contents but this does not seem to be true, or? Any hints or help is highly appreciated, Thanks!
3
0
532
Dec ’24
Embed/Do Not Embed & Mach-O type
My Xcode project has the following configuration: 1 iOS app target 1 Xcode framework target (mach-o-type "Dynamic Library") 5 static libraries Dependencies: All the static libraries are target dependencies of the framework. The framework is the only target dependency of the iOS app. For the iOS app target, within the General tab > Frameworks, Libraries & Embedded content, I've set the framework as "Do not embed" So now I have a dynamic framework which won't be copied to the .app bundle in the build output. As per my understanding, this should result in a runtime error, dyld should not be able to find the framework files as they were not embedded in the final .app bundle. But regardless, my app runs without any errors, using all the methods exposed by the framework. What is the correct understanding here? What exactly does Embed/Do not embed mean (apart from excluding the files from .app bundle) When both settings are specified, is there any priority or precedence of one setting over the other?
3
0
145
4w
Do I need to down load iOS 18 for testing on iPhone 11 having iOS version 17.6.1 ?
I am using two iPhone11 devices, having iOS v17.6.1 for automation testing using Seleniumv4.X-Appium v2.x. Today I updated the mac to Sequoia15 version which updated the XCode to v16. Just after this update, I could not able to run the previously running automation script. The console message is "org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: Unable to launch WebDriverAgent. Original error: xcodebuild failed with code 70. This usually indicates an issue with the local Xcode setup or WebDriverAgent project configuration or the driver-to-platform version mismatch."
3
0
1.2k
Nov ’24