Simulator

RSS for tag

Rapidly prototype and test builds of your app during the development process using Simulator.

Posts under Simulator tag

200 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

Unity App - VisionOS simulator - Simulator microphone crash when called
Hello, I am currently testing microphone features on VisionOS through Unity App.

I’m stuck with a bug, related to the calling of simulated microphone device. Would you please help me to find a solution to work through this bug ? Choses are the results of the Xcode console while debugging my simulated VisionOS app. Unity functions : StartRecording() InteractionControllerScript:Update() Microphone.Start(Microphone.devices[0], false, duration, 44000); (where the line of code crash). Simulated Xcode VisionOS side : MEMixerChannel.cpp:1006 MEMixerChannel::EnableProcessor: failed to open processor type 0x726f746d AURemoteIO.cpp:1162 failed: -10851 (enable 1, outf< 2 ch, 0 Hz, Float32, deinterleaved> inf< 1 ch, 44100 Hz, Int16>) Starting microphone failed: "An error occured trying to initialize the recording device. " (70) Unity version : 2022.3.24f1 Xcode version : 15.3 Mac Version : MacBook Air M3 2024 Mac Os : 14.3 (23D2057) Thx a lot.
0
0
314
Apr ’24
Program runs fine in Vision Pro simulator but not on the actual device
I'm trying to figure out how to debug this issue. I have a fairly simple program that I built using the Hello World sample code as reference. Here is my code: import SwiftUI @main struct Core_USDZ_ViewerApp: App { var body: some Scene { // Main Menu scene // WindowGroup (id: "main-menu"){ CoreUsdzMenu() } // Scene that takes data as an input // for volumetric viewing // WindowGroup (for: URL.self) { $content in CoreUsdzVolume(url: content) } defaultValue: { URL(string: "https://developer.apple.com/augmented-reality/quick-look/models/pancakes/pancakes.usdz")! } .windowStyle(.volumetric) .defaultSize(width: 0.2, height: 0.3, depth: 0.3, in: .meters) // Full surround scene /* ImmersiveSpace { // put our immersive view here } */ } } In the simulator, this launches the main menu scene, but when installed on the Vision Pro using TestFlight it skips the main menu and goes straight to the second WindowGroup. Since the data isn't populated, it uses the defaultValue and just shows pancakes. I'm having trouble logging and debugging this issue, as I don't have access to the hardware myself. I have to push the code to TestFlight and wait for a coworker to test it. Does anyone have ideas of why this could be happening? Any help is appreciated. Logging and debugging tips especially. I'm used to just putting log messages in my code to debug, but maybe there are some breakpoint techniques I should be using here or something. Oh, also, here is my CoreUsdzMenu script: import SwiftUI import RealityKit import UniformTypeIdentifiers struct CoreUsdzMenu: View { @Environment(\.openWindow) private var openWindow @Environment(\.dismissWindow) private var dismissWindow @State var entity: Entity? = nil @State var showFilePicker: Bool = false init() { NSLog("In CoreUsdzMenu") } var body: some View { VStack{ Text("Core USDZ Viewer v1.1") .font(.title) .frame(width: 500.0, height: 100.0) /* usdz list HStack(spacing: 100.0) { Spacer() // Load the UsdzList view into the window! UsdzList() Spacer() }*/ /* button test for window Button { openWindow(value: usdzData[1].url) } label: { Text("open test window") }*/ // A view for displaying the loaded asset. /* RealityView( make: { content in // Add a placeholder entity to parent the entity to. // let placeholderEntity = Entity() placeholderEntity.name = "$__placeholder" if let loadedEntity = self.entity { placeholderEntity.addChild(loadedEntity) } content.add(placeholderEntity) }, update: { content in guard let placeholderEntity = content.entities.first(where: { $0.name == "$__placeholder" }) else { preconditionFailure("Unable to find placeholder entity") } // If there is a loaded entity, remove the old child, // and add the new one. // if let loadedEntity = self.entity { placeholderEntity.children.removeAll() placeholderEntity.addChild(loadedEntity) } } )*/ // A button that displays a file picker for loading a USDZ. // Button( action: { showFilePicker = true }, label: { Text("Load USDZ") } ) .padding() } // can import usdz and realityFile UTT types .fileImporter(isPresented: $showFilePicker, allowedContentTypes: [.usdz, .realityFile]) { result in // Get the URL of the USDZ picked by the user. // Guarded for errors. // guard let url = try? result.get() else { print("Unable to get URL") return } NSLog("In CoreUsdzMenu") // add new .usdz to our data list // for later!~ // use Observables n stuff //usdzData.addUsdz(url) // This task is just an asynchronous block of code. Not linked // to the RealityView explicitly; the update parameter of the // RealityView function responds when this task updates the entity. // Task { // As the app is sandboxed, permission needs to be // requested to access the file, as it's outside of // the sandbox. // if url.startAccessingSecurityScopedResource() { defer { url.stopAccessingSecurityScopedResource() } // Load the USDZ asynchronously. // On load, triggers RealityView's update. // //self.entity = try await Entity(contentsOf: url) // Try using the Volumetric Window to display the // content: // openWindow(value: url) } } } } } Thank you for reading!
1
0
314
Apr ’24
Xcode 15.3 simulator error (The request was denied by service delegate (SBMainWorkspace))
Hi, I'm a total beginner in programmation. I'm learning Unreal Engine by developing an iPhone game with the engine. I do not own an Apple Developper Subscription, so for testing my game on a real iPhone and/or on a simulator, I use the "quick launch" option in Unreal. Then, I open the Xcode Project created by the engine while attempting to quick launch directly on the device, and run the app from Xcode. Running it on my personal iPhone failed, so while trying to figure out why I've decided to try running it on the iOS simulator, and it failed. I got this message : Details : Simulator device failed to launch com.***.***. Domain: FBSOpenApplicationServiceErrorDomain Code: 1 Failure Reason: The request was denied by service delegate (SBMainWorkspace). User Info: { BSErrorCodeDescription = RequestDenied; DVTErrorCreationDateKey = "2024-04-14 15:25:10 +0000"; FBSOpenApplicationRequestID = 0x8a2a; IDERunOperationFailingWorker = IDELaunchiPhoneSimulatorLauncher; SimCallingSelector = "launchApplicationWithID:options:pid:error:"; } -- Simulator device failed to launch com.***.XXXXX. Domain: FBSOpenApplicationServiceErrorDomain Code: 1 Failure Reason: The request was denied by service delegate (SBMainWorkspace). User Info: { BSErrorCodeDescription = RequestDenied; FBSOpenApplicationRequestID = 0x8a2a; IDERunOperationFailingWorker = IDELaunchiPhoneSimulatorLauncher; SimCallingSelector = "launchApplicationWithID:options:pid:error:"; } -- The request to open "com.***.***" failed. Domain: FBSOpenApplicationServiceErrorDomain Code: 1 Failure Reason: The request was denied by service delegate (SBMainWorkspace). User Info: { BSErrorCodeDescription = RequestDenied; FBSOpenApplicationRequestID = 0x8a2a; } -- The operation couldn’t be completed. The process failed to launch. Domain: FBProcessExit Code: 64 Failure Reason: The process failed to launch. User Info: { BSErrorCodeDescription = "launch-failed"; } -- The operation couldn’t be completed. Launch failed. Domain: RBSRequestErrorDomain Code: 5 Failure Reason: Launch failed. -- Launchd job spawn failed Domain: NSPOSIXErrorDomain Code: 153 -- Event Metadata: com.apple.dt.IDERunOperationWorkerFinished : { "device_model" = "iPhone16,2"; "device_osBuild" = "17.4 (21E213)"; "device_platform" = "com.apple.platform.iphonesimulator"; "dvt_coredevice_version" = "355.24"; "dvt_mobiledevice_version" = "1643.100.58"; "launchSession_schemeCommand" = Run; "launchSession_state" = 1; "launchSession_targetArch" = arm64; "operation_duration_ms" = 314; "operation_errorCode" = 1; "operation_errorDomain" = FBSOpenApplicationServiceErrorDomain; "operation_errorWorker" = IDELaunchiPhoneSimulatorLauncher; "operation_name" = IDERunOperationWorkerGroup; "param_debugger_attachToExtensions" = 0; "param_debugger_attachToXPC" = 1; "param_debugger_type" = 3; "param_destination_isProxy" = 0; "param_destination_platform" = "com.apple.platform.iphonesimulator"; "param_diag_MainThreadChecker_stopOnIssue" = 0; "param_diag_MallocStackLogging_enableDuringAttach" = 0; "param_diag_MallocStackLogging_enableForXPC" = 1; "param_diag_allowLocationSimulation" = 1; "param_diag_checker_tpc_enable" = 1; "param_diag_gpu_frameCapture_enable" = 0; "param_diag_gpu_shaderValidation_enable" = 0; "param_diag_gpu_validation_enable" = 0; "param_diag_memoryGraphOnResourceException" = 0; "param_diag_queueDebugging_enable" = 1; "param_diag_runtimeProfile_generate" = 0; "param_diag_sanitizer_asan_enable" = 0; "param_diag_sanitizer_tsan_enable" = 0; "param_diag_sanitizer_tsan_stopOnIssue" = 0; "param_diag_sanitizer_ubsan_stopOnIssue" = 0; "param_diag_showNonLocalizedStrings" = 0; "param_diag_viewDebugging_enabled" = 1; "param_diag_viewDebugging_insertDylibOnLaunch" = 1; "param_install_style" = 0; "param_launcher_UID" = 2; "param_launcher_allowDeviceSensorReplayData" = 0; "param_launcher_kind" = 0; "param_launcher_style" = 0; "param_launcher_substyle" = 0; "param_runnable_appExtensionHostRunMode" = 0; "param_runnable_productType" = "com.apple.product-type.application"; "param_structuredConsoleMode" = 1; "param_testing_launchedForTesting" = 0; "param_testing_suppressSimulatorApp" = 0; "param_testing_usingCLI" = 0; "sdk_canonicalName" = "iphonesimulator17.4"; "sdk_osVersion" = "17.4"; "sdk_variant" = iphonesimulator; } -- System Information macOS Version 14.2.1 (Build 23C71) Xcode 15.3 (22618) (Build 15E204a) Timestamp: 2024-04-14T17:25:10+02:00 I searched online and found out that installing Rosetta could fix my issue. I'm pretty sure that Rosetta is already installed on my system but I still tried to re-install it unsuccessfully. Here's what I get : softwareupdate --install-rosetta I have read and agree to the terms of the software license agreement. A list of Apple SLAs may be found here: https://www.apple.com/legal/sla/ Type A and press return to agree: A 2024-04-14 17:17:41.826 softwareupdate[15660:1012009] Package Authoring Error: 052-22577: Package reference com.apple.pkg.RosettaUpdateAuto is missing installKBytes attribute Install of Rosetta 2 finished successfully I tried other command lines to install Rosetta, using sudo, only to get that same result. I didn't find any way to perform a clean install of Rosetta online, only people saying that I shouldn't try to do anything with rosetta as it is supposed to be an automatic process or something. Maybe Rosetta wasn't the problem after all ? Or it is and I've just messed up the installation when I got it installed before ? (I installed GamePortToolkit previously, and I remember updating Rosetta while doing so). I tried to explain clearly the whole situation, don't hesitate to ask me any information if you need so. Thanks for your attention 🙏
1
0
863
Apr ’24
Can't download iOS runtime in Xcode 15.3
I just upgraded my Macbook &amp; Xcode installation, as we are required to target the latest iOS SDK later this month. I am now unable to compile our app as the iOS runtime is not installed by default. I have tried to download the missing runtime by clicking on "iOS 17.4 Not Installed - Get" in the top title bar. I think that the initial download may have been interrupted. Now, when I click "Get", I get a popup that suggests that I can't download the Runtime because the iOS Simulator is already installed. I'm guessing that Xcode is holding a reference to a non-existent installation somewhere, but I can't figure out how to get rid of it. I have tried completely uninstalling Xcode, and deleting /Library/Developer from both my personal directory and the system directory. I can't delete the iOS Simulator installation reference from Xcode directly either. When I try to, I get this error message: Unable to remove SimulatorRuntime Domain: com.apple.DVTFoundation Code: -1 User Info: { DVTErrorCreationDateKey = "2024-04-13 14:18:22 +0000"; } -- Unable to remove SimulatorRuntime Domain: com.apple.DVTFoundation Code: -1 -- Cannot stage disk image or bundle for delete: 87947E69-C049-4950-B663-C40C3BCAAFB2 Domain: com.apple.CoreSimulator.simdiskimaged.SimDiskImageError Code: 18 -- The file “87947E69-C049-4950-B663-C40C3BCAAFB2.dmg” doesn’t exist. Domain: NSCocoaErrorDomain Code: 4 Failure Reason: The file doesn’t exist. -- The operation couldn’t be completed. No such file or directory Domain: NSPOSIXErrorDomain Code: 2 Failure Reason: No such file or directory -- System Information macOS Version 14.4.1 (Build 23E224) Xcode 15.3 (22618) (Build 15E204a) Timestamp: 2024-04-13T16:18:22+02:00
3
2
1.1k
Apr ’24
After initiating a call in the simulator, the CXEndCallAction of CallKit is called and the call is terminated.
Hello, I'm trying to test a call in the Simulator using CallKit. However, after the CXStartCallAction of CallKit is called, the CXEndCallAction is immediately invoked. I conducted the test using Xcode 15.2 and iOS 17.2 Simulator. When I searched because I couldn't test it on the Simulator, I found a similar issue on the following link. https://stackoverflow.com/questions/78291725/callkit-invokes-cxendcallaction-after-starting-the-call-resulting-in-hangup-on The person who asked the question in the link tested it with the previous version iOS 15.5 Simulator and it worked fine. Why isn't it working in the latest version? Is it a bug? Or has the policy been updated? If there are any documents available to check regarding this matter, please share them.
0
0
312
Apr ’24
CallKit invokes CXEndCallAction after starting the call, resulting in hangup on Simulator
I am using Xcode Version 15.3 (15E204a) and different versions of Simulator runtimes (17.x, 16.x, 15.0) The app makes outgoing calls and can respond to incoming calls. After starting the call, ~2s pass before a hangup occurs. In the Console logs I see that CXEndCallAction was invoked by CallKit and the last suspicious log before invoking the CXEndCallAction is callservicesd Disconnecting call because there wont be a UI to host the call: &lt;CSDProviderCall 0x107054300 type=PhoneNumber, value=sdsddsdds, stat=Sending tStat=0, model=&lt;TUCallModel 0x103f661e0 hold=1 grp=1 ungrp=1&gt; ... This used to work before, but since upgrading to Xcode 15 and iOS 17.x it happens constantly on simulator versions 17.x, and sometimes on 16.x, whereas I wasn't able to reproduce it on 15.0 version. Can someone help me understand why this happens and how to fix it? I provided some logs down below, and I don't see similar logs in the cases when the call is okay and CallKit doesn't hangup it. Also, this does not happen on real devices From the time CXStartCallAction is invoked until the CallKit invokes CXEndCallAction, these are some of the error or warn logs that appear: callservicesd -AVSystemController- +[AVSystemController sharedInstance]: Failed to allocate AVSystemController, numberOfAttempts=3 callservicesd [WARN] +[AVSystemController sharedAVSystemController] returned nil value callservicesd [WARN] Not allowing requested start call action because a call with same UUID already exists callWithUUID: (omitted) callservicesd Error while determining process action for callSource: (omitted) callservicesd Determined that callSource: &lt;CXXPCCallSource 0x103d060a0, ...&gt;, should process action: &lt;CXStartCallAction 0x107232760 UUID=8D34853F-55DD-4DEC-97A7-551BFD27C924, error: Error Domain=com.apple.CallKit.error.requesttransaction Code=5 "(null)" callservicesd [0x103e417a0] invalidated after the last release of the connection object callservicesd [WARN] No paired device, so unable to send message UpdateCallContext callservicesd FaceTime caller ID (null) is not a valid outgoing relay caller ID callservicesd Attempting to find a valid outgoing caller ID in set of available outgoing caller IDs {( )} callservicesd Could not automatically select an outgoing caller ID; multiple telephone numbers are listed in the set of available outgoing caller IDs {( )} callservicesd Adding call &lt;CSDProviderCall 0x107054300 ...&gt; to dirty calls pool callservicesd Entitlement check: ... entitlementCapabilities={( "access-call-providers", "modify-calls", "access-call-capabilities", "access-calls" )}&gt; lacks capability 'access-screen-calls' callservicesd [WARN] ... but no dynamic identifier could be found (1) or no handoff user info exists (1). Not broadcasting frontmost call error com.apple.CallKit.CallDirectoryUnable to initialize CXCallDirectoryStore for reading: Error Domain=NSCocoaErrorDomain Code=513 "You don’t have permission to save the file “CallDirectory” in the folder “Library”." ... {Error Domain=NSPOSIXErrorDomain Code=13 "Permission denied"}} The logs provided are in order in which they are logged, but some of them are recurring After these logs there is still a message that CXStartCallAction is fullfilled: callservicesd Start call action fulfilled: &lt;CXStartCallAction 0x107231fe0 UUID=8D34853F-55DD-4DEC-97A7-551BFD27C924 ...&gt; After which the last suspicious log is logged before CXEndCallAction is invoked by CallKit: Disconnecting call because there wont be a UI to host the call: &lt;CSDProviderCall 0x107054300 ...&gt;
0
0
447
Apr ’24
Broken Xcode
Hey. I'm a newbie in Xcode developing. I have just installed Xcode 10.2.1 on macOS 11.7.10 (20G1427) (my project cannot built on newer Xcode versions), and I guess that my copy of Xcode (or something related) is broken. Firstly, when Xcode running from Terminal, logs showing this: 2024-04-04 17:31:30.772 Xcode[1062:25499] Failed to load CoreSimulatorService. Access to simulator services will not be available. Error=Error Domain=NSPOSIXErrorDomain Code=61 "Connection refused" UserInfo={NSLocalizedDescription=CoreSimulator.framework was changed while the process was running. This is not a supported configuration and can occur if Xcode.app was updated while the process was running. Service name ((null)) does not match expected service name (com.apple.CoreSimulator.CoreSimulatorService).} 2024-04-04 17:31:30.773 Xcode[1062:36010] CoreSimulatorService connection became invalid. Simulator services will no longer be available. I tried to reinstall Xcode in /Applications, remove all Xcode-related folders, but nothing fixes. Secondly, I can't open Device Manager from Simulator. It says Not yet available. Please use simctl to manage devices. See rdar://problem/16642259. Screenshot: Please, who can help with this? (plz, sorry for my bad english :p)
2
0
489
Apr ’24
NWPathMonitor mocking for Simulator using Network Extension
Is it possible to mock the behavior of NWPathMonitor for a specific app? The scenario I want to support I've created an app called RocketSim, a developer tool for Xcode's Simulator. I've already created Airplane mode, which disables networking calls from URLSession from a specific bundle identifier app installed on the Simulator. Now, I want to support blocking NWPathMonitor as well. I believe the Simulator uses macOS's NWPathMonitor and does not use any specific HTTP request or similar to determine the reachability state. Is there a way I can make NWPathMonitor return unsatisfied when my 'airplane mode' is turned on? Potentially using a Network Extension?
1
0
328
Apr ’24
Termination Reason: DYLD 4 Symbol missing
When building with Xcode 15 or greater to a simulator that is IOS 16 or lower I get a crash. Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Termination Reason: DYLD 4 Symbol missing Im not 100% sure it is an Xcode issue to be honest. It could be a react native issue. Everything works fine with Xcode 14.3.1 proven by my release builds through the pipeline working. Im really struggling to narrow down the issue. Any suggestions would be appreciated.
3
1
897
Mar ’24
Watch and iPhone simulator connectivity is broken.
I am trying to get iPhone and watch simulator to send message to each other. I am getting this error(s) all the time: Error Domain=WCErrorDomain Code=7012 "Message reply took too long." UserInfo={NSLocalizedDescription=Message reply took too long., NSLocalizedFailureReason=Reply timeout occurred.} -[WCSession _onqueue_notifyOfMessageError:messageID:withErrorHandler:] 0F2558A6-6E42-4EF1-9223-FBC5336EE490 errorHandler: YES with WCErrorCodeMessageReplyTimedOut Is there are some guideline on how to connect them together? Maybe I a missing some step. For clarification, sometimes they do connect but it feels like pure luck. Please help.
1
0
393
Mar ’24
Simulating cross-device passkey sign in?
It seems cross-device passkey authentication isn't supported by the Simulator, is that right? I can't tell if it's the simulator not supporting it, or my app/server failing. My app, running in the Simulator, presents a QR code during sign-in flow. I scan that with my phone, and it just spins "connecting…". Can anyone confirm that the Simulator just doesn't support this? What are my options for testing this flow? I guess I need another device not sign in to my AppleID.
1
0
533
Mar ’24
Launching iMessage App
Hello, I am new to app development. I am trying to make an iMessage app. I created it and then added a SwiftUI view. It builds just fine and the view is visible on the storyboard, but the app is not present in iMessage on Simulator or on an actual device. What's wrong? Thanks for any help. import UIKit import Messages import SwiftUI class MessagesViewController: MSMessagesAppViewController { var hostingController: UIHostingController<CalendarView>? override func viewDidLoad() { super.viewDidLoad() } override func willBecomeActive(with conversation: MSConversation) { super.willBecomeActive(with: conversation) let swiftUIView = CalendarView() let hostingController = UIHostingController(rootView: swiftUIView) addChild(hostingController) view.addSubview(hostingController.view) hostingController.view.translatesAutoresizingMaskIntoConstraints = false NSLayoutConstraint.activate([hostingController.view.leadingAnchor.constraint(equalTo: view.leadingAnchor), hostingController.view.trailingAnchor.constraint(equalTo: view.trailingAnchor), hostingController.view.topAnchor.constraint(equalTo: view.topAnchor), hostingController.view.bottomAnchor.constraint(equalTo: view.bottomAnchor)]) hostingController.didMove(toParent: self) self.hostingController = hostingController } override func didResignActive(with conversation: MSConversation) {} override func didReceive(_ message: MSMessage, conversation: MSConversation) {} override func didStartSending(_ message: MSMessage, conversation: MSConversation) {} override func didCancelSending(_ message: MSMessage, conversation: MSConversation) {} override func willTransition(to presentationStyle: MSMessagesAppPresentationStyle) {} override func didTransition(to presentationStyle: MSMessagesAppPresentationStyle) {} }
0
0
346
Mar ’24
The Simulator disk cannot be erased.
I installed VisionPro's Simulator with Xcode last year, and now I want to uninstall it, but there is an xrOS1.0 disk in the disk image that cannot be erased. Later, I tried to erase the disk in MacOS recovery, but the display failed. I also tried to uninstall the xrOS1.0 disk, but I can't erase the xrOS1.0 disk. Every time I start up, a pop-up window is verifying xrOS1.0, which affects my normal use. I hope you can give me a solution. Thank you!
0
0
247
Mar ’24