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

#available issue on visionOS
Hi, do you guys have any idea why this code block doesn't run properly on a designed iPad app running on a vision pro simulator? I'm trying to add a hovering effect to a view in UIKit but it just doesn't enter this if statement. if #available(iOS 17.0, visionOS 1.0, *) { someView.hoverStyle = .init(effect: .automatic) }
3
0
248
May ’24
XCode 15.4 Simulators wont install.
Simulators will not install. Run destinations all empty. Can't even run on device. XCode 15.4 beta Sonoma 14.4.1 Intel Mac 16" MBP Attached screenshot of error. iOS 17.5 beta 2 (21F5058d) "Not compatible with XCode 15.4 beta" No run destinations appear. Not even 17.4 device that is plugged in. This all worked yesterday after initial XCode upgrade to 15.4 beta. Now all destinations are missing, even though they appear as installed in the 'Platforms' window. (yes I have rebooted and restarted XCode).
1
0
488
May ’24
WatchOS simulator - Cannot play sounds while iPhone simulator works
Hello, everyone, I have a problem I'm stuck with and have been trying to solve without success for the past 2 weeks. I am developing a SwiftUI application for Apple Watch which for now I am only running on the simulator. This application has to play sounds but unfortunately so far without success for Apple Watch simulator. When I tap the button on the application running on the Series 9 (45mm) simulator with watchOS 10.2. I cannot hear any sounds on my MacBook Pro. This happens for all Apple Watch simulators I have in my MacBook. The same exact code works on the iPhone 15 simulator with iOS 17.2 and I hear the file 1.mp3 from MacBook Pro speakers and also from bluetooth hearphones, if I connect them. The code is this import SwiftUI import AVFoundation struct ContentView: View { @State var audioPlayer:AVPlayer? @State var isPlaying : Bool = false var body: some View { VStack { Image(systemName: "globe") .imageScale(.large) .foregroundStyle(.tint) Text("Hello, world!") Button("Play"){ if let path = Bundle.main.path(forResource: "1", ofType: "mp3") { let fileUrl = URL(fileURLWithPath: path) do{ try AVAudioSession.sharedInstance().setCategory(AVAudioSession.Category.playback) try AVAudioSession.sharedInstance().setActive(true) audioPlayer = AVPlayer(url: fileUrl) guard let audioPlayer = audioPlayer else { return } audioPlayer.play() } catch { } } } } .padding() } } Thanks for your support!
1
1
166
Apr ’24
Testing remote notifications with simulator
Greetings everyone, we have a problem testing remote notifications to our app runing in an iOS simulator, which should be possible for quite a while now. (https://nilcoalescing.com/blog/TestingRemotePushOniOSSimulator/) We made sure of the following prerequisites The system requirements (recent XCode, recent MacOS, Silicone Processor) are met The app build is set to testing The app is in fact generating a devicetoken and sendig it to our backend We are sending our requests to the api.sandbox.push.app.com environment Nonetheless, we always receive a status 400, error "BadDeviceToken" response from the APNS service. Doing the same with a physical device works like a charm, ie the message is received without any problems. We also tried sending the same device token to a production environment, but got the same 400/BadDeviceToken error. Also the simulator-generated token does not look distorted, ie it's also just a HEX string with the same length as the working token of the physical device. Is there anything else we need to check for this to work?
1
0
281
Apr ’24
Stuck on launch with Debug
Attempting to run my app on the simulator or device seemingly leaves it stuck on the launch screen for a long time. Slowly, the terminal will start to relay info suggesting it's past that but still displays the launch screen until eventually it goes to a black screen. No changes I am aware of were made to cause these behavior to start. And it was a sudden issue. My last OS update was a few days ago and my last Xcode update was after this started to occur in hopes it would fix the problem. Recent code changes would have nothing to do with startup. I did try to delete derived data and ~/Library/Developer/Xcode/iOS DeviceSupport/ based on solutions given to other users with similar problems. I've restarted the computer and cold restarted. When I stop the application from Xcode, I can then run the app. It's just when it's attached. It will also work if "Debug executable" is off. Other apps on this computer do not seem to have this problem. Would appreciate any help. Thanks.
2
0
294
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
259
Apr ’24
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
250
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
883
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 🙏
0
0
638
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
247
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
358
Apr ’24
iOS simulator triggers lots of "*** quit unexpectedly" alerts
Everytime when iOS simulator is launched I het a lot of repeated "*** quit unexpectedly" alerts. Where "***" is a mix of "managedappdistributiond","healthappd", and "findmylocated" Even after the simulator is launched I still het random "*** quit unexpectedly" alerts. Very annoying because the alerts deactivates the active window This is on an MacBook Pro M3 Max,, Xcode 15.2, Sonoma 14.2.1, it also happens with Xcode 15.1 A co developer (MacBook Pro M1 Max,Xcode 15.2, Sonoma 14.2.1) does not have the issue Any idea how I can prevent this from happening? Update Every mentioned service crash happens in libswiftCore.dylib at 0x1929f3938 assertionFailure(:_:file:line:flags:) + 248
4
4
745
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
366
Apr ’24