I have this code:
var eventIn = kevent(ident: UInt(self.socket),
filter: Int16(EVFILT_WRITE),
flags: UInt16((EV_ADD | EV_ENABLE)),
fflags: 0,
data: 0,
udata: nil
)
I looked at it and thought why do I have those extra parentheses? So I changed it to
var eventIn = kevent(ident: UInt(self.socket),
filter: Int16(EVFILT_WRITE),
flags: UInt16(EV_ADD | EV_ENABLE), // changed line!
fflags: 0,
data: 0,
udata: nil
)
and then kevent gave me EBADF.
Does this make sense to anyone?
Xcode
RSS for tagBuild, test, and submit your app using Xcode, Apple's integrated development environment.
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
Start from clean iOS 18.4 simulator. Application tried to request authorisation from user for microphone access. Clicking allow caused the application crashed.
Used Swift 6. Report Identifier FB17686864.
We using below command to run unit test and collect coverage:
xcodebuild -workspace Demo.xcworkspace -scheme VideoTests -configuration Debug -derivedDataPath ../build/derivedData -destination 'platform=iOS Simulator,id=E6630007-570B-4DEB-A023-2BCE91116A8D' -resultBundlePath './fastlane/test_output/VideoTests.xcresult' -enableCodeCoverage YES -testPlan 'Video' test-without-building | tee '/Users/rcadmin/Library/Logs/scan/VideoTests.log' | xcbeautify -q --is-ci
and using xcrun llvm-cov show command to generate coverage report:
xcrun llvm-cov show /build/unit-test/coverage/libraries/merged/video.o -instr-profile=/app/ios/build/derivedData/Build//ProfileData/E6630007-570B-4DEB-A023-2BCE91116A8D/video.profdata -show-branches count -show-expansions -show-line-counts -use-color -format=html -output-dir coverage
and the html report does not include branch coverage:
how to generate the branch coverage?
Hi everyone,
We're developing an AR app using Unity with Vuforia for object detection. Our app works well in full-screen mode, including detection and post-detection phases. However, we're facing a specific issue in iPad Split View multitasking mode.
Problem:
The AR camera (Vuforia-based) freezes during object detection if another app is opened in Split View.
Post-detection, everything works fine in Split View. The problem only occurs during detection.
Testing Environment:
iPadOS 16+
Unity with Vuforia plugin
Using EnableMultitaskingCameraAccess() method with AVFoundation to support camera multitasking
AR scene is set up properly with detection capabilities in full-screen
I know there has been issues with SFSpeechRecognizer in iOS 17+ inside the simulator. Running into issues with speech not being recognised inside the visionOS 2.4 simulator as well (likely because it borrows from iOS frameworks). Just wondering if anyone has any work arounds or advice for this simulator issue. I can't test on device because I don't have an Apple Vision Pro.
Using Swift 6 on Xcode 16.3. Below are the console logs & the code that I am using.
Console Logs
BACKGROUND SPATIAL TAP (hit BackgroundTapPlane)
SpeechToTextManager.startRecording() called
[0x15388a900|InputElement #0|Initialize] Number of channels = 0 in AudioChannelLayout does not match number of channels = 2 in stream format.
iOSSimulatorAudioDevice-22270-1: Abandoning I/O cycle because reconfig pending
iOSSimulatorAudioDevice-22270-1: Abandoning I/O cycle because reconfig pending
iOSSimulatorAudioDevice-22270-1: Abandoning I/O cycle because reconfig pending
iOSSimulatorAudioDevice-22270-1: Abandoning I/O cycle because reconfig pending
iOSSimulatorAudioDevice-22270-1: Abandoning I/O cycle because reconfig pending
iOSSimulatorAudioDevice-22270-1: Abandoning I/O cycle because reconfig pending
SpeechToTextManager.startRecording() completed successfully and recording is active.
GameManager.onTapToggle received. speechToTextManager.isAvailable: true, speechToTextManager.isRecording: true
GameManager received tap toggle callback. Tapped Object: None
BACKGROUND SPATIAL TAP (hit BackgroundTapPlane)
GESTURE MANAGER - User is already recording, stopping recording
SpeechToTextManager.stopRecording() called
GameManager.onTapToggle received. speechToTextManager.isAvailable: true, speechToTextManager.isRecording: false
Audio data size: 134400 bytes
Recognition task error: No speech detected <---
Code
private(set) var isRecording: Bool = false
private var recognitionRequest: SFSpeechAudioBufferRecognitionRequest?
private var recognitionTask: SFSpeechRecognitionTask?
@MainActor
func startRecording() async throws {
logger.debug("SpeechToTextManager.startRecording() called")
guard !isRecording else {
logger.warning("Cannot start recording: Already recording.")
throw AppError.alreadyRecording
}
currentTranscript = ""
processingError = nil
audioBuffer = Data()
isRecording = true
do {
try await configureAudioSession()
try await Task.detached { [weak self] in
guard let self = self else {
throw AppError.internalError(description: "SpeechToTextManager instance deallocated during recording setup.")
}
try await self.audioProcessor.configureAudioEngine()
let (recognizer, request) = try await MainActor.run { () -> (SFSpeechRecognizer, SFSpeechAudioBufferRecognitionRequest) in
guard let result = self.createRecognitionRequest() else {
throw AppError.configurationError(description: "Speech recognition not available or SFSpeechRecognizer initialization failed.")
}
return result
}
await MainActor.run {
self.recognitionRequest = request
}
await MainActor.run {
self.recognitionTask = recognizer.recognitionTask(with: request) { [weak self] result, error in
guard let self = self else { return }
if let error = error {
// WE ENTER INTO THIS BLOCK, ALWAYS
self.logger.error("Recognition task error: \(error.localizedDescription)")
self.processingError = .speechRecognitionError(description: error.localizedDescription)
return
}
. . .
}
}
. . .
}.value
} catch {
. . .
}
}
@MainActor
func stopRecording() {
logger.debug("SpeechToTextManager.stopRecording() called")
guard isRecording else {
logger.debug("Not recording, nothing to do")
return
}
isRecording = false
Task.detached { [weak self] in
guard let self = self else { return }
await self.audioProcessor.stopEngine()
let finalBuffer = await self.audioProcessor.getAudioBuffer()
await MainActor.run {
self.recognitionRequest?.endAudio()
self.recognitionTask?.cancel()
}
. . .
}
}
I am on MacOs 15.4.1 which is being deployed with an old version of Ruby ruby 2.6.10 and bundler version 1.17.2. I ran pod install after generating the pods with these versions and during the application compilation there have been several issues reported against pods code.
Test Coverage shows "No Coverage Data" on Xcode 16.3. Code Coverage is checked in my scheme. The same configurations worked on Xcode 16.2 but don't work on Xcode 16.3. any update on when it will be fixed?
Topic:
Developer Tools & Services
SubTopic:
Xcode
I have an iOS app and that has CarPlay enabled. I have Siri capability and the feature has been tested in Car. The voice commands are working perfectly fine.
However, I am facing a weird issue as described below,
The key NSSiriUsageDescription, is set to custom text in info.plist. After generating archive, I exported and checked the package contents, in which the the key NSSiriUsageDescription was reset to default text(Describe why your app needs Siri access) in the info.plist.
I do not have any dynamic build process that's writing to the info.plist. Only the Siri key is being reset, rest of keys like camera/location permissions are intact.
Kindly suggest what needs to be done at my end
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags:
Siri and Voice
App Intents
Organizer Window
Privacy
after upgrade macos version to 15.4
the rsync start failing that cause the xcodebuild fail and not generate ipa
rsync: on remote machine: --extended-attributes: unknown option
rsync error: syntax or usage error (code 1) at main.c(1802) [server=3.4.1]
rsync(73444): error: unexpected end of file
rsync(73444): error: io_read_nonblocking
rsync(73444): error: io_read_buf
rsync(73444): error: io_read_int
rsync(73444): warning: child 73445 exited with status 1
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags:
App Store
Xcode Server
Xcode
Developer Tools
I am trying to setup a unversal linking for my new developing app.
but it look like not function well. did any one have some examples or demo domains suggest to use?
In fact finally my app is just internal using, user will not suppose connect to internet , how can I using the universal linking without a website ?
Thanks
Hi,
You're here because your project has issues related to Xcode Previews or Swift Previews. The issue you're experiencing may be the result of any of the following:
An error in your SwiftUI app, Xcode previews, or on-device previews.
A configuration error in your Xcode project, including any third-party dependencies or packages.
A system issue in the operating system, SwiftUI, or in Xcode Previews.
Based on your request, I need more information about your SwiftUI app when rendering Xcode Previews or on-device previews. Specifically, I’ll need the diagnostics Swift Previews generates to make sure I understand the error encountered by the preview system. Please create a report in Feedback Assistant to share the details requested in the instructions below.
For issues with macOS, Mac Catalyst, on-device iOS, or on-device visionOS previews, perform the following steps to gather diagnostics:
Download and install the Swift Previews logging profile for your device.
Reproduce the error while previewing on device, taking note of the timestamp when the error occurred.
Attach the Previews diagnostics, sysdiagnose from your Mac, a sysdiagnose from the previewing iOS or visionOS device.
For issues with Xcode Previews, perform the following steps to gather diagnostics:
Download and install the Swift Previews logging profile for your device.
Reproduce the error in Xcode Previews, if you haven’t already done so.
If an error banner appears in the canvas, click the "Diagnostics" button within the banner, then go to Step 5; otherwise, continue to Step 4.
If the error banner is missing, navigate to the menu in Xcode: Editor > Canvas > Diagnostics
In the presented sheet, click the "Generate Report" button.
Attach a zip file containing the diagnostic report to your bug report (it will be named something like previews-diagnostics-0123456789.zip).
Submitting your feedback
Before you submit to Feedback Assistant, please confirm the following information is included in your feedback:
with the Swift Previews logging profile installed, attach the sysdiagnose logs gathered after reproducing the issue
the Previews diagnostics generated by Xcode
timestamp identifying when the issue was reproduced
focused sample Xcode project that reproduces the issue (if applicable)
screenshots or videos of the error (optional)
Please include all requested information to prevent delays in my investigation.
After your submission to Feedback Assistant is complete, please respond to your original Forums post with the Feedback ID. Once received, I can begin my investigation and determine if this issue is caused by an error within your SwiftUI app, a configuration issue within your Xcode project, or an underlying issue in the operating system, SwiftUI, in Xcode Previews, or on-device previews.
Cheers,
Paris X Pinkney | WWDR | DTS Engineer
I have two targets:
Library
and
Generate-Library-Modulemap
I use a modulemap to help bridge the Objective-C++ code to Swift.
Generate-Library-Modulemap is set up to run only when new headers are added (this is done reliably through some trickery). This seems to work, but the problem is that if I add Generate-Library-Modulemap as a dependency of Library, it seems that by the time Library Generate-Library-Modulemap is run, the Library target has already loaded up an outdated modulemap file.
The result is my first attempt to build after adding headers is that the framework fails, as even though the modulemap was generated, it was not attached to the framework. The second attempt succeeds as it reads the updated modulemap.
Is there any way to force Xcode to run the Generate-Library-Modulemap step before starting on Library? Or perhaps attach the modulemap after the fact?
Topic:
Developer Tools & Services
SubTopic:
Xcode
Hi I developed an iPhone app but now I want to release the same app for iPad and Mac (Design for iPad). I made the changes below but I still not been able to install the app on my Mac. It says the app is incompatible but my Mac is MacBook Pro M2 which fills the requirements to install it.
Things I did so my iPhone app could have support for iPad and Mac
Added iPad and Mac (Designed for iPad) for the supported destinations
Change the Status Bar Style to Require full screen
Changed iOS minimum Deployments iOS to 17.6
Updated the launch screen logo so stays in the middle
Xcode version 16.2
See the sccreenshots of the Xcode configuration and of the TestFlight on my MacBook Pro M2
Is there anything else I need to do?
Thanks.
Topic:
Developer Tools & Services
SubTopic:
Xcode
Hello. For the last few months I have been facing a situation for which I do not understand either the reason or the solution. Here is an example for the last few weeks:
In App Store Connect it shows 214 crashes for the last week
In Xcode it shows 56 crashes for the last 2 weeks without stack traces (NO_CRASH_STACK)
In Firebase Crashlytics there is not a single crash.
When I click "Show in Finder" it opens a folder with .xccrashpoint files. As far as I understood from the instructions on posting crash reports - this is not what is needed.
Interesting point: it looks like the errors occur on iOS 15-16 devices.
I have several questions:
Why is the number of crashes in Xcode different from the number in App Store Connect? Where are the other crashes?
How can I understand what the problem is if there are no stack traces in Xcode?
Hi,
I'm working in unity and I've implemented Firebase Phone Number Authentication in it. Everything works fine when I directly install build from xCode. App Attest screen shows up, user receives OTP on their phone and login works. But when I download the same build from TestFlight, it gets stuck after the user sends OTP request.
I've added Push Notifications and App Attest in capabilities. I've also additionally added Remote Notifications.
In device log I see an error about mobile provisioning file but I've added that to my account also. Is this expected behavior that phone number authentication does not work on TestFlight? If yes, how can I get this approved from apple since they need to test it before approving it.
Thanks!
I am encountering an issue while running my CarPlay app in the simulator using CPListTemplate. On app launch, when I tap on the first item in the list and then tap on the second item, both items remain selected instead of only the latest tapped item.
This behavior does not align with the expected single-item selection functionality. Has anyone else faced this issue? Is there a workaround or a known resolution for this behavior?
I am currently using Xcode 16 (16A242d) and testing on an iPhone 7 running iOS 12.1.3. However, when I try to launch the app on the device, it crashes immediately. Below are the crash logs from the iPhone 7:
错误 11:54:55.731858+0800 kernel Sandbox: assertiond(62) System Policy: deny(1) file-read-metadata /private/var/mobile/Library/DuetExpertCenter/caches/ATXCacheFile-_ATXAppPredictor-TotalScore
错误 11:54:55.731897+0800 kernel Sandbox: assertiond(62) System Policy: deny(1) file-read-metadata /private/var/mobile/Library/DuetExpertCenter/caches
错误 11:54:55.754498+0800 kernel Sandbox: duetexpertd(132) deny(1) mach-lookup com.apple.proactive.ActionPrediction.predictions
错误 11:54:55.756102+0800 duetexpertd Unable to remove recent engagement cache file. Error: Error Domain=NSCocoaErrorDomain Code=4 UserInfo={NSFilePath=, NSUserStringVariant=, NSUnderlyingError=0x100db60a0 {Error Domain=NSPOSIXErrorDomain Code=2}}
错误 11:54:56.571640+0800 symptomsd Attempt to add an app with insufficient id, info {
BKSApplicationStateAppIsFrontmost = 1;
BKSApplicationStateExtensionKey = 0;
SBApplicationStateDisplayIDKey = "com.igetcool.app";
SBApplicationStateKey = 8;
SBApplicationStateProcessIDKey = 696;
SBApplicationStateRunningReasonsKey = (
{
SBApplicationStateRunningReasonAssertionIdentifierKey = UIApplicationLaunch;
SBApplicationStateRunningReasonAssertionReasonKey = 10000;
}
);
SBMostElevatedStateForProcessID = 8;
}
错误 11:54:56.829372+0800 assertiond [IGCProject:696] SyscallError: setpriority(PRIO_DARWIN_ROLE, 696, 3): No such process
错误 11:54:56.944833+0800 dasd Activity not tracked as being started, ignoring it
错误 11:55:06.153790+0800 symptomsd Attempt to add an app with insufficient id, info {
BKSApplicationStateAppIsFrontmost = 1;
BKSApplicationStateExtensionKey = 0;
SBApplicationStateDisplayIDKey = "com.igetcool.app";
SBApplicationStateKey = 8;
SBApplicationStateProcessIDKey = 697;
SBMostElevatedStateForProcessID = 8;
}
错误 11:55:06.430433+0800 assertiond [IGCProject:697] SyscallError: setpriority(PRIO_DARWIN_ROLE, 697, 3): No such process
错误 11:55:13.158889+0800 symptomsd Attempt to add an app with insufficient id, info {
BKSApplicationStateAppIsFrontmost = 1;
BKSApplicationStateExtensionKey = 0;
SBApplicationStateDisplayIDKey = "com.igetcool.app";
SBApplicationStateKey = 8;
SBApplicationStateProcessIDKey = 699;
SBMostElevatedStateForProcessID = 8;
}
错误 11:55:13.416290+0800 assertiond [IGCProject:699] SyscallError: setpriority(PRIO_DARWIN_ROLE, 699, 3): No such process
I am trying to understand what is causing this issue. Even after archiving and installing the app, it still crashes. According to the official documentation, Xcode 16 is supposed to support iOS 12, but this issue persists. I would like to know the possible reasons for this behavior.
Trying to use SwiftUI Preview in Xcode 16.2 on complex project, I have no access to Developer Apple team, instead I am using manually installed provision profiles to test on iPhone.
So, SwiftUI Preview does not work with diagnostic error "Failure: Framework Agent preparation failed: Could not find a team ID"
Hi!
When I run my project on a real device (iPhone 15 Pro), I encounter the following error:
Build input file cannot be found: '/Users/Interexy/Library/Developer/Xcode/DerivedData/SinglePhotoBook-geecnphrjebsisdmhcyzlsefvphm/Build/Products/Debug-iphoneos/SinglePhotoBook.app/SinglePhotoBook'. Did you forget to declare this file as an output of a script phase or custom build rule which produces it?
How can I solve this? I've already reinstalled Pods and cleaned DerivedData a million times, but the issue persists.
Xcode: Version 15.4
Topic:
Developer Tools & Services
SubTopic:
Xcode
I'm following the steps laid out in Creating a static framework which states:
When a client links and embeds the framework, Xcode 15 or later omits the main binary from the embedded framework bundle because it’s already statically linked into the client.
Specifically, I'm adding a new framework target to my project, and then changing the Mach-O type in its build settings to Static Library.
What I'm observing when I build (debug or release) is that that the resulting framework folder inside of the app bundle still contains a binary.
Furthermore, upon inspecting strings and symbols in both the main app executable and this library binary, it appears that my strings and symbols do end up in the main executable and not in the library binary.
Does this mean that this binary is just a stub left behind?
Is this intended?
Can I safely delete this binary with a build phase script?