Simulator

RSS for tag

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

Posts under Simulator tag

201 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

Resolving a "Simulator runtime is not available" error
Some Macs recently received a macOS system update which disabled the simulator runtimes used by Xcode 15, including the simulators for iOS, tvOS, watchOS, and visionOS. If your Mac received this update, you will receive the following error message and will be unable to use the simulator: The com.apple.CoreSimulator.SimRuntime.iOS-17-2 simulator runtime is not available. Domain: com.apple.CoreSimulator.SimError Code: 401 Failure Reason: runtime profile not found using "System" match policy Recovery Suggestion: Download the com.apple.CoreSimulator.SimRuntime.iOS-17-2 simulator runtime from the Xcode To resume using the simulator, please reboot your Mac. After rebooting, check Xcode Preferences → Platforms to ensure that the simulator runtime you would like to use is still installed. If it is missing, use the Get button to download it again. The Xcode 15.3 Release Notes are also updated with this information.
0
0
6.0k
May ’24
Simulator 18.4 Webview CORS issues
I have a very specific issue that happens only on iOS Simulator version 18.4. It does NOT happen when I run my app on a real iOS 18.4 device through Testflight. My app displays a WebView (courtesy of Capacitor, url scheme capacitor://). Inside that Webview I'm using Firebase JS API (11.2.0) and calling signInWithEmailAndPassword, which works well in all other contexts, i.e. browser, Android webview, iOS webview in all other Simulator versions, and on real devices. Only when running in Simulator 18.4, I get a failed network request: cannot parse response Fetch API cannot load https://identitytoolkit.googleapis.com/v1/accounts:signInWithPassword?... due to access control checks. Failed to load resource: cannot parse reponse error: FirebaseError: (auth/network-request-failed) Everything is working correctly for both: Capacitor app webview installed on a real 18.4 device with Testflight Safari (non-webview) in the 18.4 Simulator The issue is severe for us, because we are unable to develop our app and test it in the simulator on 18.4 Simulator before pushing it through Testflight internal release. Request headers on the failed request (no response status or headers available). Request Accept: / Content-Type: application/json Origin: capacitor://localhost Sec-Fetch-Dest: empty Sec-Fetch-Mode: cors Sec-Fetch-Site: cross-site User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 18_4 like Mac OS X) - AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/15E148 X-Client-Version: Mobile/JsCore/11.2.0/FirebaseCore-web X-Firebase-Client: (...)
0
0
40
5d
Facing "Failed to create promise" issue on ios 18 simulators
Hi, We are facing issues on ios simulators os version 18, "Simulator device failed to install the application. Failed to create promise. Underlying error (domain=IXErrorDomain, code=2):" Due to this error simulator is unable to install the application. we are facing this intermittently. xcode version : Xcode.16.0.0.16A242d.app ios simulator runtime : com.apple.CoreSimulator.SimRuntime.iOS-18-0 ios simulator : com.apple.CoreSimulator.SimDeviceType.iPhone-16 mac os version : macOS 15.4 we have tried upgrading to xcode Xcode.16.1.0.16B40.app and ios simulator runtime to 18.1 but its not working. Also we have rebooted xcode, not helping. *Exact error message : ** org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: An unknown server-side error occurred while processing the command. Original error: Error running 'install': An error was encountered processing the command (domain=IXErrorDomain, code=2): Simulator device failed to install the application. Failed to create promise. Underlying error (domain=IXErrorDomain, code=2): Failed to set icon resources promise for com.yyyy.xxxx Failed to create promise. Host info: host: 'uci-macmini-019lab3b.local', ip: 'fe80:0:0:0:1caf:6627:141d:f464%en0' Build info: version: '4.30.0', revision: '509c7f17cc' System info: os.name: 'Mac OS X', os.arch: 'aarch64', os.version: '15.3.1', java.version: '11.0.25' Driver info: com.mypackage.common.drivers.CustomIosDriver$ByteBuddy$g865VfU3 Command: [null, newSession {capabilities=[{appium:webviewConnectTimeout=120000, appium:autoAcceptAlerts=true, appium:app=/Users/mobileci/.buildkite-agent/builds/uci-macmini-019lab3b/mypackage/e2e-test-ios-simulator/8155f349-18b9-413c-9d17-dcb064986154/test_artifacts/target.app, appium:includeSafariInWebviews=true, appium:locale=US, appium:mjpegServerPort=52715, appium:newCommandTimeout=600000, appium:waitForIdleTimeout=3, appium:derivedDataPath=/Users/mobileci/.buildkite-agent/builds/uci-macmini-019lab3b/mypackage/e2e-test-ios-simulator/8155f349-18b9-413c-9d17-dcb064986154/appium_wda_ios/, appium:wdaConnectionTimeout=300000, appium:wdaLaunchTimeout=300000, appium:processArguments={env={E2E_TESTING=YES, RUN_UUID=8155f349-18b9-413c-9d17-dcb064986154}}, appium:automationName=XCUITest, appium:fullReset=true, appium:udid=F266ECC3-FD23-464D-B0C3-576EB48B2FF5, appium:deviceName=E2ESimulator, appium:wdaLocalPort=52714, appium:showXcodeLog=true, appium:webkitDebugProxyPort=52716, appium:noReset=false, appium:language=en, platformName=IOS, appium:simpleIsVisibleCheck=true}], desiredCapabilities=Capabilities {app: /Users/mobileci/.buildkite-..., autoAcceptAlerts: true, automationName: XCUITest, derivedDataPath: /Users/mobileci/.buildkite-..., deviceName: E2ESimulator, fullReset: true, includeSafariInWebviews: true, language: en, locale: US, mjpegServerPort: 52715, newCommandTimeout: 600000, noReset: false, platformName: IOS, processArguments: {env: {E2E_TESTING: YES, RUN_UUID: 8155f349-18b9-413c-9d17-dcb...}}, showXcodeLog: true, simpleIsVisibleCheck: true, udid: F266ECC3-FD23-464D-B0C3-576..., waitForIdleTimeout: 3, wdaConnectionTimeout: 300000, wdaLaunchTimeout: 300000, wdaLocalPort: 52714, webkitDebugProxyPort: 52716, webviewConnectTimeout: 120000}}] Capabilities {app: /Users/mobileci/.buildkite-..., autoAcceptAlerts: true, automationName: XCUITest, derivedDataPath: /Users/mobileci/.buildkite-..., deviceName: E2ESimulator, fullReset: true, includeSafariInWebviews: true, language: en, locale: US, mjpegServerPort: 52715, newCommandTimeout: 600000, noReset: false, platformName: IOS, processArguments: {env: {E2E_TESTING: YES, RUN_UUID: 8155f349-18b9-413c-9d17-dcb...}}, showXcodeLog: true, simpleIsVisibleCheck: true, udid: F266ECC3-FD23-464D-B0C3-576..., waitForIdleTimeout: 3, wdaConnectionTimeout: 300000, wdaLaunchTimeout: 300000, wdaLocalPort: 52714, webkitDebugProxyPort: 52716, webviewConnectTimeout: 120000} at
0
0
31
6d
Does Xcode force to download latest iOS simulator after update?
I have Xcode on my mac. I am iOS Dev. I do not know what version of Xcode was before I did next steps, but I could say that I had iOS Simulator 18.3.1. So I update my Xcode to Version 16.3 (16E140). At this version is available iOS Simulator 18.4. But from some time before Xcode separate downloading components and actual Xcode itself. So i make update and do not download latest iOS simulator. What i have: in Xcode -> Settings -> Components under " Other Installed Platforms" i have iOS 18.3.1 and 17.5 in Choose Destination dropdown menu i have nothing. And Xcode say me that i need install iOS Simulator. After some time with ChatGPT I could not do nothing from this. I try go to : Window -> Device and Simulators and here create new simulator with 18.3.1 and make it appear Always. But it didn't help. Solution I did: I download latest version 18.4 because i could not wait because i need fix bug only 1 hour shift and it was this hour so i fast download the simulator. After downloading 18.4 in Choose Destination dropdown it appears all versions of simulaors and 18.3.1 and that i created and 17.5 Question: Does Xcode force to install latest version of iOS simulator? What is the sense of this upgrade that now Xcode is updating faster because it download 8 GB not 16 if eventually I need download 8 GB again ? The new what i could do download Xcode in the evening and Simulator in the morning?
0
0
29
6d
Remove old iOS Simulator Runtimes that are not listed in Xcode
Inside /Library/Developer/CoreSimulator I have 26GB (according to du -h) of old data that Xcode won't list under Window -> Devices & Simulators. Because of Apples decision to not let even the root user write in this directory I am unable to delete them with rm -r * or put them in the trash etc. The old runtimes are even listed in disk utility and can't be unmounted or delete from there - also due to missing permissions. How can I get rid of this if even Xcode won't list them? Also tried xcrun simctl delete all without success.
1
0
54
1w
Xcode 16.3 - very slow to run on simulator
Build and run on simulator is suddenly very slow since Xcode 16.3. The build is normal, but the run part launches the simulator and sits and waits 5, 10, 15, sometimes 20 seconds before anything happens. During that time, the screen is blank on the simulator and the console output is blank in Xcode. What's going on here? Is there a fix or work-around? EDIT: If I turn off the debugger, so it just runs without attaching it, the launch happens instantly.
0
1
45
1w
FileAttributeKey.protectionKey's value is always nil in Simulator
It seems like this is not supported in the Simulator because when I run my Unit tests and I try to read protection key-value the value is always nil, even if I set the data protection level when I write the file. On device this key returns the expected value. Is it possible to have the simulator support the data protection classes to run my unit tests? FYI Im testing on iOS
2
0
34
1w
Unexpected behaviour of hardware keyboard focus in UITests
Hello! I was faced with unexpected behavior of hardware keyboard focus in UITests. A clear description of the problem When running UITests on the iOS Simulator with both "Full Keyboard Access" and "Connect Hardware Keyboard" options enabled, there is a noticeable delay between keyboard actions for focus managing (like pressing Tab or arrow keys). The delay seems to increase with repeated input and suggests that events are being queued instead of processed immediately. I will describe why I have such an assumption later. A step-by-step set of instructions to reproduce the problem Launch the iOS Simulator. Enable both "Full Keyboard Access" and "Connect Hardware Keyboard" in the Simulator settings. Run a UITest on a target application (ideally an endless or long-running test). Once the app is launched, press the Tab key several times. Observe the delay in focus movement. Optionally, press the Tab or arrow keys rapidly, then stop the UITest. After stopping, you’ll see a burst of rapid focus changes. What results you expected We expected keyboard actions (like Tab) to be handled immediately and the UI focus to update smoothly during UITests. What results you saw There was a 4–10 (end more) second delay between pressing keys and seeing a response. All stacked keyboard events (used for managing focus) are performed all at once after stopping the UITest. The version of Xcode you are using Xcode: Version 16.3 (16E140) Simulator: iPhone 16 Pro (iOS 18.4 and 18.1) Simulator: iPad Pro 11-inch (M4) (iPadOS 17.5)
1
2
80
1w
Cannot load a Safari Extension onto my iPhone 15 running iOS 18.4
I'm trying to load a Safari Extension onto my physical iPhone 15 running iOS 18.4 but am seeing the following message: "iOS 18.4 is not installed." When I click the Get button I see that the download has failed with the following error message. I tried updating my laptop to Sequoia and I also deleted and re-installed Xcode but that didn't fix it. Any thoughts? Download failed. Domain: DVTDownloadableErrorDomain Code: 41 User Info: { DVTErrorCreationDateKey = "2025-04-08 06:00:22 +0000"; } -- Download failed. Domain: DVTDownloadableErrorDomain Code: 41 -- Failed fetching catalog for assetType (com.apple.MobileAsset.iOSSimulatorRuntime), serverParameters ({ RequestedBuild = 22E238; }) Domain: DVTDownloadsUtilitiesErrorDomain Code: -1 -- Download failed due to a bad URL. (Catalog download for com.apple.MobileAsset.iOSSimulatorRuntime) Domain: com.apple.MobileAssetError.Download Code: 49 User Info: { checkConfiguration = 1; } -- System Information macOS Version 15.4 (Build 24E248) Xcode 16.3 (23785) (Build 16E140) Timestamp: 2025-04-07T23:00:22-07:00
1
0
47
2w
WKWebView Fails with NSURLErrorDomain Code=-1005 on iOS 18.4 Simulator
Hello, I'm experiencing an issue where WKWebView consistently fails to load a specific URL on the iOS 18.4 simulator (Xcode 16.3). The error is as follows: Error Domain=NSURLErrorDomain Code=-1005 "The network connection was lost." UserInfo={ _kCFStreamErrorCodeKey=-4, _kCFStreamErrorDomainKey=4, NSUnderlyingError=Error Domain=kCFErrorDomainCFNetwork Code=-1005, NSErrorFailingURLKey=[REDACTED] } Key Observations: This URL fails consistently only on the iOS 18.4 simulator. The same URL loads without issue in iOS 18.3 and 18.2 simulators. The backend is serving a valid HTTPS certificate chain, and the server appears to be presenting it properly. The same application appears to work on a real iPhone running 18.4. Certificate Chain for the Failing URL Leaf: WR3 (Valid: Mar 17, 2025 – Jun 15, 2025) Intermediate 1: GTS Root R1 (Valid: Dec 13, 2023 – Feb 20, 2029) Intermediate 2: GlobalSign Root CA (Valid: Jun 19, 2020 – Jan 28, 2028) Other URLs Work Fine in iOS 18.4 Simulator WKWebView successfully loads the following URLs with similar or more complex certificate chains: https://google.com → WR2, GTS Root R1, GlobalSign Root CA https://amazon.com → DigiCert Global CA G2, DigiCert Global Root G2, VeriSign G5 https://stackoverflow.com → E5, ISRG Root X1 https://shopify.com → GlobalSign Root CA, GTS Root R4, WE1 This suggests the issue may not be with general network or certificate trust but instead something specific about how iOS 18.4 handles this domain or certificate configuration in the simulator. Any insights on how to solve this would be greatly appreciated.
1
0
106
2w
MusicKit failed retrieving tokens on Simulator.
Is anyone else receiving this warning from Xcode when running on the Simulator? "Failed retrieving MusicKit tokens: fetching the developer token is not supported in the simulator when running on this version of macOS; please upgrade your Mac to macOS Ventura." My Mac is already updated to macOS Sequoia, and I'm also running the latest version of Xcode. Feedback: FB17150538
1
1
39
2w
xcode install iOS 18.2 (22C146) SDK + iOS 18.3.1 (22D8075) Simulator (Components absent) fail
I tried installing the emulator directly from xcode,invalid signature talking about my Mac or the simulator package? Error detial: (-67061 invalid signature (code or signature have been modified) Domain: SimDiskImageErrorDomain Code: 5 User Info: { DVTErrorCreationDateKey = "2025-04-07 08:21:21 +0000"; unusableErrorDetail = ""; } (-67061 invalid signature (code or signature have been modified) Domain: SimDiskImageErrorDomain Code: 5 User Info: { unusableErrorDetail = ""; } System Information macOS Version 14.6.1 (Build 23G93) Xcode 16.2 (23507) (Build 16C5032a) Timestamp: 2025-04-07T16:21:21+08:00
0
0
110
2w
Xcode 16.3 missing the CoreSimulator DeviceTypes?
Hi folks, was there an unannounced breaking change in Xcode 16.3 regarding the device types, e.g. "iPhone 16 Pro.simdevicetype"? We consume Xcode simulators viaa CLI that uses it and the absence of it broke the complete setup. We are filing a bug report in parallel, but maybe someone is experiencing something related and may see a workaround. Thanks to everyone!
1
0
87
2w
Memory Leak in AVAudioPlayer in Simulator only
I have a memory leak, when using AVAudioPlayer. I managed to narrow down the issue into a very simple app, which code I paste in at the end. The memory leak start immediately when I start playing sound, but only in the emylator. On the real iPhone there is no memory leak. The memory leak on the Simulator looks like this: import SwiftUI import AVFoundation struct ContentView_Audio: View { var sound: AVAudioPlayer? init() { guard let path = Bundle.main.path(forResource: "cd201", ofType: "mp3") else { return } let url = URL(fileURLWithPath: path) do { try AVAudioSession.sharedInstance().setCategory(.playback, mode: .default, options: [.mixWithOthers]) } catch { return } do { try AVAudioSession.sharedInstance().setActive(true) } catch { return } do { sound = try AVAudioPlayer(contentsOf: url) } catch { return } } var body: some View { HStack { Button { playSound() } label: { ZStack { Circle() .fill(.mint.opacity(0.3)) .frame(width: 44, height: 44) .shadow(radius: 8) Image(systemName: "play.fill") .resizable() .frame(width: 20, height: 20) } } .padding() Button { stopSound() } label: { ZStack { Circle() .fill(.mint.opacity(0.3)) .frame(width: 44, height: 44) .shadow(radius: 8) Image(systemName: "stop.fill") .resizable() .frame(width: 20, height: 20) } } .padding() } } private func playSound() { guard sound != nil else { return } sound?.volume = 1 // sound?.numberOfLoops = -1 sound?.play() } func stopSound() { sound?.stop() } }
2
0
38
3w
Xcode fails to attach to process when building to the Simulator
When trying to build and run our iOS app on the simulator we're hitting the following error: Could not attach to pid: "XXXXX" failed to get reply to handshake packet within timeout of 6.0 seconds I've included some more details on our project/setup below: We're working on a large project with multiple schemes / app targets. The error only affects one of our targets - however the dependencies between the problematic target and the others are very similar. The issue only affects building to the simulator; building to a physical device works fine. Scheme configuration is the same across all targets. We've faced this issue on multiple versions of Xcode, from 15.x through to the latest 16.3 RC. We've tried a number of workarounds, some of which work intermittently for some colleagues - but none of which have provided a durable solution. These include varying combinations of: Setting the IDEPreferLogStreaming=YES environment variable Unchecking Debug Executable under Edit Scheme -> Run Manually launching the app on the Simulator and then attaching the debugger using Debug -> Attach in Xcode Erasing all contents and settings on the simulator (this sometimes fixes things for a single build, but we run into the same issue again for all subsequent builds, and it doesn't work for all developers). Clearing out Derived Data and running a clean build (this doesn't seem to help). We'd really appreciate any input on how we can diagnose what's causing this issue or any suggested steps to help resolve it.
4
1
128
2w
URLSession is broken in iOS 18.4 RC Simulator
I'm seeing fully reproducible issues with URLSession on iOS 18.4 RC Simulator running from Xcode 16.3 RC. URLSession seems to get into a broken state after a second app run. The following sample succeeds in fetching the JSON on first app run but when the app is closed and ran again it fails with one of these errors: Error: Error Domain=NSURLErrorDomain Code=-1005 "The network connection was lost." Error: Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." I'm wondering if this something related to my OS setup or is this due to internal URLSession changes in iOS 18.4. Already submitted as FB17006003. Sample code attached below: import SwiftUI @main struct NetworkIssue18_4App: App { var body: some Scene { WindowGroup { ContentView() } } } struct ContentView: View { @State private var message: String = "" var body: some View { VStack { Text(message) Button("Try Again") { Task { await fetch() } } } .task { await fetch() } } private func fetch() async { message = "Loading..." let url = URL(string: "https://poetrydb.org/title/Ozymandias/lines.json")! let session = URLSession.shared do { let response = try await session.data(from: url) print("Response: \(response)") message = "Success, data length: \(response.0.count)" } catch { print("Error: \(error)") message = "Error: \(error.localizedDescription)" } } }
33
27
9.2k
5d