Simulator

RSS for tag

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

Simulator Documentation

Posts under Simulator tag

327 Posts
Sort by:
Post not yet marked as solved
2 Replies
429 Views
Hi, I am attempting to run my app in Xcode 14 beta 4. It requires me to download the watchOS 9 runtime in order to build it, with a prompt which states the following: Download Xcode support for watchOS 9.0? This scheme builds an embedded Apple Watch app. watchOS 9.0 must be installed in order to run the scheme. The first time I tried this, it downloaded but then showed an error which I can't remember. However, the main issue is that now I can no longer try it again. Every time I try to build my app, it shows the same prompt, but this time the download of the watchOS 9 runtime fails every time with the same message: Duplicate of 862D055C-0B48-4F10-BAF9-EB4B35F559FA Domain: SimDiskImageErrorDomain Code: 5 User Info: { DVTErrorCreationDateKey = "2022-07-31 14:12:11 +0000"; unusableErrorDetail = ""; } -- System Information macOS Version 12.4 (Build 21F79) Xcode 14.0 (21322) (Build 14A5284g) Timestamp: 2022-07-31T16:12:11+02:00 As a result, I am unable to build my app. If I run the command "xcrun simctl runtime list" then I can see the 862D055C-0B48-4F10-BAF9-EB4B35F559FA that it is referring to: == Disk Images == -- iOS -- iOS 12.4 (16G73) - 66A29B59-5BEF-496D-BFB0-F9C1F21A6F28 (Ready) iOS 13.7 (17H22) - 2A03BB12-25EB-40C8-9AAC-70B0169225A7 (Ready) iOS 14.5 (18E182) - 8C98D5B2-2130-40D4-B220-E6CDBD67F41C (Ready) iOS 16.0 (20A5328h) - 8F909927-98C9-4FAB-8B90-048BB9A45031 (Ready) -- watchOS -- watchOS 9.0 (20R5332f) - A8C24E46-2134-4373-8BFE-3DB9AE1F2A3D (Unusable - Other Failure: Duplicate of 862D055C-0B48-4F10-BAF9-EB4B35F559FA) watchOS 9.0 (20R5332f) - 862D055C-0B48-4F10-BAF9-EB4B35F559FA (Ready) watchOS 9.0 (20R5332f) - 2A633A9E-C9C8-4AB0-AF67-45A84AC94F09 (Unusable - Other Failure: Duplicate of A8C24E46-2134-4373-8BFE-3DB9AE1F2A3D) watchOS 9.0 (20R5332f) - 8067AFE2-75DE-460E-9E78-02CA664D0D1A (Unusable - Other Failure: Duplicate of 862D055C-0B48-4F10-BAF9-EB4B35F559FA) watchOS 9.0 (20R5332f) - E06DB92C-832A-429C-B8F8-376D62AA4BB9 (Unusable - Other Failure: Duplicate of 862D055C-0B48-4F10-BAF9-EB4B35F559FA) watchOS 9.0 (20R5332f) - ABCC542C-D2EC-472C-B82B-33E3D530D717 (Unusable - Other Failure: Duplicate of 862D055C-0B48-4F10-BAF9-EB4B35F559FA) watchOS 9.0 (20R5332f) - 47EACFB4-B1D2-4C9C-9276-A253F6370528 (Unusable - Other Failure: Duplicate of 862D055C-0B48-4F10-BAF9-EB4B35F559FA) watchOS 9.0 (20R5332f) - 6C85F221-7D10-4BE1-9573-66E8B8A805A2 (Unusable - Other Failure: Duplicate of 862D055C-0B48-4F10-BAF9-EB4B35F559FA) However, attempts to delete it have been unsuccessful. I have uninstalled Xcode, deleted various Xcode cache files, data in the ~/Library/Developer folder as well as in the /Library/Developer folder, but it still seems to persist. It doesn't seem to be easy to delete a runtime from this list. If I run the command "xcrun simctl runtime delete 862D055C-0B48-4F10-BAF9-EB4B35F559FA", then I get the following error: Cannot stage disk image or bundle for delete: 862D055C-0B48-4F10-BAF9-EB4B35F559FA Underlying error (domain=NSCocoaErrorDomain, code=4): “862D055C-0B48-4F10-BAF9-EB4B35F559FA.dmg” couldn’t be moved to “NSIRD_simdiskimaged_mn8bfc” because either the former doesn’t exist, or the folder containing the latter doesn’t exist. The file doesn’t exist. Does anyone have any ideas about how I can resolve this?
Posted Last updated
.
Post not yet marked as solved
0 Replies
24 Views
Hi, I am not able to set and retrieve cookies from WKWebsiteDataStore when running the following test. The getCookies in the below code always comes empty. I dont understand its failing because it is unable to set the cookie or the get is failing to retrieve cookies. Here is the code: let cookieStorage = WKWebsiteDataStore.nonPersistent().httpCookieStore let properties: [HTTPCookiePropertyKey: Any] = [       .domain: "abc.com",       .path: "/",       .name: "name",       .value: "value",       .secure: "TRUE"     ] let cookie = HTTPCookie(properties: properties)! let cookies = [cookie] let cookieExpectation = self.expectation(description: "cookieExpectation")       cookieStorage.setCookie(cookies[0]) {     cookieStorage.getAllCookies { getCookies in      let mappedCookies = Dictionary(uniqueKeysWithValues: cookies.map { ($0.name, $0.value ) })      let mappedGetCookies = Dictionary(uniqueKeysWithValues: getCookies.map { ($0.name, $0.value ) })      XCTAssertEqual(mappedCookies, mappedGetCookies) cookieExpectation.fulfill()   } } This is failing on iOS 16 simulator. For iOS 15 simulator and mac Catalyst the test case succeeds without any problem. Checked this on xcode 14 release and xcode 14.1 Beta 2
Posted Last updated
.
Post not yet marked as solved
49 Replies
18k Views
I can't paste anything into my simulator since switching to an M1 MacMini. I've tried ticking and unticking "automatically sync clipboard". I've also tried using the "send clipboard" option manually, but no success. I can seem to paste into safari on the simulator, but not any app I create in Xcode. I've tried multiple and even creating a new one fresh. I get the below snippet in the console complaining its unable to access some file. Looks like its an Xcode / M1 bug. I'm not running via rosetta. Does anyone know how to fix this, its become a real blocker for me testing my app 2021-06-11 12:00:28.656521+0100 camlKit-Example[3736:123707] [db] Failed to initialize client context with error Error Domain=NSOSStatusErrorDomain Code=-10817 "(null)" UserInfo={_LSFunction=_LSSchemaConfigureForStore, ExpectedSimulatorHash={length = 32, bytes = 0x15dde658 ed2a1267 ab2496d7 34f186ad ... ec431c65 02d68f35 }, _LSLine=409, WrongSimulatorHash={length = 32, bytes = 0xaf25dda9 e45baa35 610eaabd 5bc09901 ... 9cbe61f3 81d7b9d9 }} 2021-06-11 12:00:28.656878+0100 camlKit-Example[3736:123707] [db] _LSSchemaConfigureForStore failed with error Error Domain=NSOSStatusErrorDomain Code=-10817 "(null)" UserInfo={_LSFunction=_LSSchemaConfigureForStore, ExpectedSimulatorHash={length = 32, bytes = 0x15dde658 ed2a1267 ab2496d7 34f186ad ... ec431c65 02d68f35 }, _LSLine=409, WrongSimulatorHash={length = 32, bytes = 0xaf25dda9 e45baa35 610eaabd 5bc09901 ... 9cbe61f3 81d7b9d9 }} 2021-06-11 12:00:28.656957+0100 camlKit-Example[3736:123707] [db] Failed to initialize client context with error Error Domain=NSOSStatusErrorDomain Code=-10817 "(null)" UserInfo={_LSFunction=_LSSchemaConfigureForStore, ExpectedSimulatorHash={length = 32, bytes = 0x15dde658 ed2a1267 ab2496d7 34f186ad ... ec431c65 02d68f35 }, _LSLine=409, WrongSimulatorHash={length = 32, bytes = 0xaf25dda9 e45baa35 610eaabd 5bc09901 ... 9cbe61f3 81d7b9d9 }} 2021-06-11 12:00:28.657397+0100 camlKit-Example[3736:123707] [claims] Upload preparation for claim 1B09A1C9-1B93-4AB0-B91D-F8789C91AB3C completed with error: Error Domain=NSCocoaErrorDomain Code=256 "The file “fb19cda6511c09d17006da7aefa63f10ea73f68b” couldn’t be opened." UserInfo={NSURL=file:///Users/simonmcloughlin/Library/Developer/CoreSimulator/Devices/CD0E07DE-8C9C-4466-978B-1F6E635EE0E2/data/Library/Caches/com.apple.Pasteboard/eb77e5f8f043896faf63b5041f0fbd121db984dd/fb19cda6511c09d17006da7aefa63f10ea73f68b, NSFilePath=/Users/simonmcloughlin/Library/Developer/CoreSimulator/Devices/CD0E07DE-8C9C-4466-978B-1F6E635EE0E2/data/Library/Caches/com.apple.Pasteboard/eb77e5f8f043896faf63b5041f0fbd121db984dd/fb19cda6511c09d17006da7aefa63f10ea73f68b, NSUnderlyingError=0x600002813ae0 {Error Domain=NSOSStatusErrorDomain Code=-10817 "(null)"}}
Posted
by simonmcl.
Last updated
.
Post marked as solved
2 Replies
66 Views
I have a SwiftUI project, iOS16, it builds fine if I choose a simulator/device, but when I choose Any iOS Device (arm64) and hit Archive, it fails with error: error build: Entry point (_main) undefined. for architecture arm64 I'm using an M1 Mac Studio to build it. I have the following in my main: @main struct MyAppNameApp: App { @UIApplicationDelegateAdaptor(AppDelegate.self) var appDelegate ... } class AppDelegate: NSObject, UIApplicationDelegate { func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey : Any]? = nil) -> Bool { // Sets cache for Images downloader SDWebImageSwiftUI // ... return true } } Under Architectures I have the following: Should I select for release Yes as well? Why is it failing? What setting do I have to look into? Thanks
Posted
by afern247.
Last updated
.
Post not yet marked as solved
0 Replies
58 Views
I am getting the following error as i am trying to setup a new project using Swift UI Path. I am using the simulator no actual devices. When i run, the simulator opens the app just fine. Only the preview is not working. FailedToConnectToDTServiceHubError: Cannot connect to iPhone 14 Pro Try disconnecting and reconnecting the device. iPhone 14 Pro { }: connection attempt #7831
Posted
by awadesh.
Last updated
.
Post not yet marked as solved
0 Replies
52 Views
Recently, I messed around with the simulator from Xcode and logged in my Apple ID. After that, my iPhone (8, if that helps) had the "Developer" panel in the settings app. I activated the fast app termination, thinking it was useful, but after a day the panel dissapeared. I am now stuck with the option active with no way of turning it off and it's really annoying. Anyone got ideas?
Posted
by Chillguy.
Last updated
.
Post not yet marked as solved
25 Replies
55k Views
I have an iphone xs running public beta 13.5. I have tried running an app I've been working on on my phone and I keep getting a "Failed to prepare this device for deployment" error. I have tried with both the app store version of xcode as well as xcode beta 11.5 beta 2 (11N605f). I'm also using the free provisioning account. Any help getting the app to deploy would be appreciated.
Posted
by lothsun.
Last updated
.
Post not yet marked as solved
1 Replies
63 Views
It would be really useful if we could import a GPX file and simulate a custom route. Alternatively, add a sea route as one of the available trip simulations (under Features > Location), with the device starting from a port and ending at the same or different port. I am aware that a custom route can be manually added through Xcode, but I cannot run my application via VS Code and still use the custom route I created. Having the feature available directly through the iOS simulator, similar to how Android emulators can add a custom route, would be especially convenient.
Posted Last updated
.
Post marked as solved
3 Replies
1.2k Views
The release notes of Xcode 12 beta 1 states When simulating a push notification in Simulator with the content-available key set, the system now calls application(:performFetchWithCompletionHandler:) instead of application(:didReceiveRemoteNotification:fetchCompletionHandler:). (60426170) (FB7625283) The problem is, in Xcode 11 the system did already call performFetchWithCompletionHandler, which I think is a bug and was also filed in FB7625283. If I test this on a real device, the system calls didReceiveRemoteNotification, which is the right method, at least from my understanding. Now to my question, should the system really call performFetchWithCompletionHandler or are the release notes wrong and the issue isn't fixed?
Posted Last updated
.
Post not yet marked as solved
12 Replies
6.1k Views
Hi I have an larger app with scrollable elements (table views, textviews, collection views, map .. ). I purchased a Mac mini with M1 processor, and with the latest Xcode, I can't swipe with the simulator. It lags, so I can drag with the Magic Mouse, but the swipe gesture is not recognised properly. For the system apps (settings for example) it works. For any simple app, it does not. Has anyone faced this issue?
Posted
by MetaImi.
Last updated
.
Post not yet marked as solved
2 Replies
218 Views
Hey guys, I wrote a simple Swift code on Xcode (version 13.2.1) with just images and text on the screen (I'm just a beginner). I'm was following this video (https://www.youtube.com/watch?v=GqWgsWS4aL4&list=PLMRqhzcHGw1YqPh-ggQHJPAUxdHov_uNJ&index=5). My preview shows the perfect view (iphone 11) but when I run the simulator (iphone 11), I'm getting a smaller screen window. I have attached the screenshot. Some help would be appreciated. Thanks!
Posted Last updated
.
Post not yet marked as solved
17 Replies
10k Views
Is there way to hide new simulator's title bar? I use simulator for taking screenshots with device bezels for appstore. With this new title bar it is not possible anymore.
Posted Last updated
.
Post not yet marked as solved
6 Replies
9.3k Views
How to download iOS 14.8.1 and iOS 15.1 simulator in Xcode? Xcode 12.4 Components Simulators: 14.3, 14.2, 14.1, 14.0... Xcode 13.2 Beta 2 Components Simulators: 15.0, 14.5, 14.4, 14.3, 14.2, 14.1, 14.0...
Posted Last updated
.
Post not yet marked as solved
7 Replies
4.6k Views
When I run an app that uses location services on the Xcode 13.1 simulator for iOS 15 the location privacy settings are missing. If you go to the settings on the simulator under privacy the section for location services is missing. The exact same thing on a physical iPhone running iOS 15.0 does show the location settings under privacy in the settings app. Where did the settings for location privacy go? In order to test using the simulator a developer needs to be able to turn those settings on and off, like turning off precise location to see how an app responds.
Posted
by Bussa.
Last updated
.
Post not yet marked as solved
12 Replies
13k Views
I downloaded and installed the Xcode 12 beta and now want to test on an iOS 14 simulator, but the iOS 14 simulator is not installed and can't be found in Preferences/Components to download. What am I missing?
Posted
by diErbse2.
Last updated
.
Post not yet marked as solved
16 Replies
1.9k Views
MacBook Pro 2018 mid 13.3" Xcode 13.3 Mac OS Monterey 12.3 I had the kernelpanic bellow three time today. I had Xcode with simulator running all times. Have anyone this issue? kernel panic
Posted
by akikos.
Last updated
.
Post not yet marked as solved
0 Replies
191 Views
WeatherKit seems to work fine when I deploy a debug build on a real device, but whenever I try to deploy on a simulator, I get the following errors: 2022-09-13 17:51:56.118325-0400 Widget Wizard[63356:284415] [AuthService] Failed to generate jwt token for: com.apple.weatherkit.authservice with error: Error Domain=AMSErrorDomain Code=12 "Mescal Failed" UserInfo={NSLocalizedDescription=Mescal Failed, NSLocalizedFailureReason=SAPInit failed: -42049} 2022-09-13 17:51:56.119297-0400 Widget Wizard[63356:284415] [WeatherService] Encountered an error when fetching weather data subset; location=<+43.65320000,-79.38320000> +/- 5.00m (speed -1.00 mps / course -1.00) @ 9/13/22, 5:51:55 PM Eastern Daylight Time, error=Error Domain=AMSErrorDomain Code=12 "Mescal Failed" UserInfo={NSLocalizedDescription=Mescal Failed, NSLocalizedFailureReason=SAPInit failed: -42049} WeatherKitProvider.getWeather error Optional(<+43.65320000,-79.38320000> +/- 5.00m (speed -1.00 mps / course -1.00) @ 9/13/22, 5:51:55 PM Eastern Daylight Time) Mescal Failed I have confirmed that everything is configured correctly in terms of certificates and profiles. It just doesn't work on any simulator. It seems a number of people on Twitter are having the same issues.
Posted
by Khuffie.
Last updated
.
Post not yet marked as solved
0 Replies
109 Views
Just downloaded and installed the latest Xcode and simulator (Version 14.0 (14A309)). I have an in progress app that listens to keyboardWillShowNotification to move the screen up. As of iOS 16, keyboardWillShowNotification keeps firing every (or every few) key strokes. The additional events seem to all come in with animation duration of 0. Seems like a huge bug, maybe i'm missing something First correct event: keyboard will show: NSConcreteNotification 0x600002d67f20 {name = UIKeyboardWillShowNotification; userInfo = {   UIKeyboardAnimationCurveUserInfoKey = 7;   UIKeyboardAnimationDurationUserInfoKey = "0.25";   UIKeyboardBoundsUserInfoKey = "NSRect: {{0, 0}, {393, 119}}";   UIKeyboardCenterBeginUserInfoKey = "NSPoint: {196.5, 911.5}";   UIKeyboardCenterEndUserInfoKey = "NSPoint: {196.5, 867.5}";   UIKeyboardFrameBeginUserInfoKey = "NSRect: {{0, 852}, {393, 119}}";   UIKeyboardFrameEndUserInfoKey = "NSRect: {{0, 808}, {393, 119}}";   UIKeyboardIsLocalUserInfoKey = 1; }} Second event after typing a few characters: keyboard will show: NSConcreteNotification 0x600002d1c8e0 {name = UIKeyboardWillShowNotification; userInfo = {   UIKeyboardAnimationCurveUserInfoKey = 7;   UIKeyboardAnimationDurationUserInfoKey = 0;   UIKeyboardBoundsUserInfoKey = "NSRect: {{0, 0}, {393, 119}}";   UIKeyboardCenterBeginUserInfoKey = "NSPoint: {196.5, 867.5}";   UIKeyboardCenterEndUserInfoKey = "NSPoint: {196.5, 867.5}";   UIKeyboardFrameBeginUserInfoKey = "NSRect: {{0, 808}, {393, 119}}";   UIKeyboardFrameEndUserInfoKey = "NSRect: {{0, 808}, {393, 119}}";   UIKeyboardIsLocalUserInfoKey = 1; }} Was successfully able to return to previous experience by adding a check if duration exists and is not zero to my callback logic. Feels like that shouldn't be necessary if let keyboardSize = (notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? NSValue)?.cgRectValue, let duration = (notification.userInfo?[UIResponder.keyboardFrameEndUserInfoKey] as? String), duration != "0" {
Posted
by simonmcl.
Last updated
.
Post not yet marked as solved
0 Replies
106 Views
I have deleted the folder : rm -rf ~/Library/Developer/CoreSimulator/Devices/<sim udid>/data/Media/** It deleted the files and I am not able to see in Photos app. But when I try to add media file again with command, I got error: xcrun simctl addmedia <sim udid> abc.png Failed to import 'abc.png', error [PHPhotosErrorDomain] -1: The operation couldn’t be completed. (PHPhotosErrorDomain error -1.) An error was encountered processing the command (domain=com.apple.CoreSimulator.LaunchdSimError, code=133): Multiple errors were returned; see stderr Note: If I do not delete the media then addmedia command working as expected, But I have a scenario where I need to clean all photos then add one file. Simulator version: iOS 15.5 xcrun version: 61
Posted Last updated
.
Post not yet marked as solved
0 Replies
109 Views
Hello there, With iOS 16 and Xcode 14 (all RC), my UnitTest stop working. I'll appreciate some help! Citan The code that get the error: XCTAssertTrue(UIPasteboard.general.string == someString) Error: Thread 8: signal SIGABRT libsystem_kernel.dylib`:     0x106628e58 <+0>:  mov    x16, #0x148     0x106628e5c <+4>:  svc    #0x80 ->  0x106628e60 <+8>:  b.lo   0x106628e7c               ; <+36>     0x106628e64 <+12>: stp    x29, x30, [sp, #-0x10]!     0x106628e68 <+16>: mov    x29, sp     0x106628e6c <+20>: bl     0x106621b10               ; cerror_nocancel     0x106628e70 <+24>: mov    sp, x29     0x106628e74 <+28>: ldp    x29, x30, [sp], #0x10     0x106628e78 <+32>: ret         0x106628e7c <+36>: ret
Posted
by Citan.
Last updated
.