Simulator

RSS for tag

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

Simulator Documentation

Posts under Simulator tag

355 results found
Sort by:
Post not yet marked as solved
3.2k Views

Xcode Simulator m1 - can't pick images

Hi, can anybody confirm that there are a problem with the image picker on Xcode 12.4 / Sim 12.4 on the new apple silicon MacBook m1? Best, Dominik
Asked
by dominik1.
Last updated
.
Post not yet marked as solved
54 Views

Why are my xib file constraints not working on the simulator?

I was originally building my app and simulating it on an iPhone 11 and it looks fine. However, when I switched to a different model like the iPhone 8 or iPod, the text and the entire table cell extends beyond the borders of the phone. I don't think this is an issue with the constraints of my text and buttons since I centered these items and they are not centered on the simulator. It seems the width of the UITable cell is larger than the width of the phone screen size. Does anyone know how to fix this? Thanks! https://imgur.com/gallery/a8ZI85D
Asked
by wuhoo123.
Last updated
.
Post not yet marked as solved
20 Views

sudo DevToolsSecurity-enable not working

I am getting the error "Cold not attach to pid : #####" In this forum I saw that going to the Terminal and typing "sudo DevToolsSecurity-enable" fixed the problem for someone but when I go to do the same my Terminal is asking for a Password but it won't let me type one....help please!
Asked Last updated
.
Post not yet marked as solved
31k Views

Sign In With Apple not working with Xcode 12 beta on simulator ?

Running the sample "Juice" app, which demos the Sign In With Apple flow, doesn't seem to work with Xcode 12 beta and iOS 14 beta on the simulator (worked fine on the non-beta versions and on a real device with iOS 14 beta). Once the password for the device's Apple ID is entered, the wheel in the password field just keeps spinning. No error messages and nothing handed back over to the app from the ASAuthorizationController. Anyone else seeing this problem ? Are there any workarounds ?
Asked
by npvisual.
Last updated
.
Post not yet marked as solved
39 Views

Xcode Location Simulator

Hi! I am doing a project with location simulators, and I am trying to figure out how to simulate my location with latitude longitude coordinates via Xcode. I am able to do so with a GPX file, but my location returns to its actual one after a few hours. Is there a way to hardcode it into the system to stay intact until the phone is reset or for n amount of hours? I would like my location to only be accessed when I allow it, specifically through find my. Thank you for any help in advance.
Asked
by pjp.
Last updated
.
Post marked as solved
11k Views

Xcode 12.5 very slow launch time for app in simulator

Configuration Big Sur 11.3 Xcode 12.5 (recently updated from Catalina and Xcode 12.4) Problem When running app in iOS 14.5 simulator launch takes incredibly long time (more than 30 seconds). In comparison launching installed app in simulator - 2 seconds, launching app on the real device (iOS 14.4) - 6 seconds. Additional information When running against simulator Xcode says "launching app", "attaching to app", and then "running app", at the running app stage we get a ~30 second pause. debugserver at 100% activity at that time. Looking for solution Methods described here https://developer.apple.com/forums/thread/651012 (deleting the contents of ~/Library/Developer/Xcode/iOS DeviceSupport) didn't help. If I untick Debug Executable for the scheme app starts normally but then logically debugging isn't possible so it's not a solution.
Asked
by OlKir1143.
Last updated
.
Post not yet marked as solved
30 Views

Debugging watchOS and iOS connectivity on simulator

In previous versions of Xcode you were able to pick a simulator pair (iOS + watchOS) when running a watch app. In Xcode 12, I cannot find the option for this. In fact, the only way I seem to be able to test connectivity between my iOS and watchOS is to build and run the iOS app. Then on the simulator open the "Watch" app, navigate to my app name and enable the Show App on Apple Watch option. This is clearly not a sustainable debug cycle. How am I able to launch both apps from Xcode without jumping through the above hoops so that I can test the connectivity between the two apps?
Asked
by runloop.
Last updated
.
Post not yet marked as solved
31 Views

UTType always return nil when testing on M1 Mac simulator with x86 arch

(environment: macOS 11.4, Xcode 12.4, iOS simulator 14.4) The below test does not passed when a project's architectures for "Any iOS Simulator SDK" contains X86_64 only. (Open a new project with architectures arm64 passes) import UniformTypeIdentifiers class UTTypeTests: XCTestCase {     func testThatItConvertsFromMIMEType() {         if #available(iOS 14.0, *) {             guard let mp4Type = UTType(mimeType: "video/mp4") else {                 return XCTFail("Could not decode from MIME type.")             }                          XCTAssertEqual(mp4Type, UTType.mpeg4Movie)         } else {         }   } } similar issue happens on deprecated method UTTypeCopyPreferredTagWithClass
Asked
by yiu por.
Last updated
.
Post not yet marked as solved
139 Views

How to simulate Fall Detection events with WatchOS Simulator?

In the documentation for CMFallDetectionManager and CMFalDetectionDelegate in XCode, there is a comment that says, "Fall Detection events can be simulated with the watchOS simulator. Use it to test the background functionality of your app." I have not seen any instructions or guides about how to do this. Therefore, I am wondering how I can simulate Fall Detection events in the WatchOS Simulator? Thank you so much!
Asked
by dandahar.
Last updated
.
Post not yet marked as solved
61 Views

Duplicating 24-hour format issue in simulator

On a device, If I have a string, say "04:00 PM" and convert it to a date using a dateformatter: let dateFormatter = DateFormatter() dateFormatter.format = "h:mm a" let d = dateFormatter.date(from: "04:00 PM") If the device is set to a 24 hour time format, then d is nil. On a simulator, the result is a date. What I want to do is to somehow set up the simulator to return a nil under this circumstance. How do I do that? Things I have tried: setting 24-hour format on the Mac, setting the region on the Mac, setting the region on the simulator, setting the locale in the simulator (maybe there's a locale setting I missed). For the Mac update settings, I reset the simulator afterward for the change to take effect. So far nothing I've tried works. The purpose of this is to allow automated tests to be able to detect these nils that will happen on actual devices.
Asked Last updated
.
Post not yet marked as solved
475 Views

Unable to install app on simulator with xcode 12.3 on BigSur

Details This app could not be installed at this time. Domain: IXUserPresentableErrorDomain Code: 1 Failure Reason: Could not install at this time. Recovery Suggestion: Failed to stage file:///Users/xyz/Library/Developer/CoreSimulator/Devices/0C7C5CED-3829-4643-AE91-48E5B9DF44CF/data/Containers/Shared/SystemGroup/systemgroup.com.apple.installcoordinationd/Library/InstallCoordination/PromiseStaging/C292E32B-5E19-43FA-9365-A8F0885FBBE2/Acme.app/ to /Users/xyz/Library/Developer/CoreSimulator/Devices/0C7C5CED-3829-4643-AE91-48E5B9DF44CF/data/Library/Caches/com.apple.mobile.installd.staging/temp.iW3apf/Acme.app- Failed to stage file:///Users/xyz/Library/Developer/CoreSimulator/Devices/0C7C5CED-3829-4643-AE91-48E5B9DF44CF/data/Containers/Shared/SystemGroup/systemgroup.com.apple.installcoordinationd/Library/InstallCoordination/PromiseStaging/C292E32B-5E19-43FA-9365-A8F0885FBBE2/Acme.app/ to /Users/xyz/Library/Developer/CoreSimulator/Devices/0C7C5CED-3829-4643-AE91-48E5B9DF44CF/data/Library/Caches/com.apple.mobile.installd.staging/temp.iW3apf/Acme.app Domain: MIInstallerErrorDomain Code: 107 User Info: { FunctionName = "-[MobileInstallationHelperService stageItemAtURL:options:completion:]"; SourceFileLine = 440; }- rename of file:///Users/xyz/Library/Developer/CoreSimulator/Devices/0C7C5CED-3829-4643-AE91-48E5B9DF44CF/data/Containers/Shared/SystemGroup/systemgroup.com.apple.installcoordinationd/Library/InstallCoordination/PromiseStaging/C292E32B-5E19-43FA-9365-A8F0885FBBE2/Acme.app/ to file:///Users/xyz/Library/Developer/CoreSimulator/Devices/0C7C5CED-3829-4643-AE91-48E5B9DF44CF/data/Library/Caches/com.apple.mobile.installd.staging/temp.iW3apf/Acme.app failed: Operation not permitted Domain: NSPOSIXErrorDomain Code: 1 Failure Reason: Operation not permitted User Info: { FunctionName = "-[MIFileManager _moveItemAtURL:toURL:failIfSrcMissing:error:]"; SourceFileLine = 274; }- System Information macOS Version 11.1 (Build 20C69) Xcode 12.3 (17715) (Build 12C33) Timestamp: 2021-01-20T11:21:59-08:00 I have tried reinstalling everything still no luck
Asked
by ramakula.
Last updated
.
Post not yet marked as solved
659 Views

Xcode 13 simulator high CPU Spotlight

I'm on a MacBook Air M1 with Monterey and XCode 13 beta. On the first night my MBA ran out of battery within three hours. I check cpu usage, and it was Spotlight. Left it running for hours and hours, but Spotlight did not complete it's tasks. Then I noticed in an Activity Monitor sample output that it seemed to have a relation to the Xcode simulator. I quit that, and the cpu utilisation went down. I can reproduce it. Nothing special, an empty iOS App in an iPhone 12 Pro or mini simulator will cause busy cpu cores with Spotlight. I recommend not leaving the simulator running when on battery if you have the same issue ;) Anyone else seeing Spotlight taking up a lot of CPU resources when the Xcode simulator is running?
Asked
by Hanss.
Last updated
.
Post not yet marked as solved
2.4k Views

Xcode says "Running .. on .. Apple Watch" all the time but never runs. Frustrating

I've had this issue for more than a year now. Sometimes it works, most of the time it doesn't. I can't be the only one experiencing this? The status bar says "Running" but even after half an hour, nothing happens on the Watch. Installing to my iPhone works just fine but as soon as I target the Apple Watch, it gets stuck.
Asked
by BassApps.
Last updated
.
Post not yet marked as solved
53 Views

Watch Rejecting an app to install from iPhone watch app

I am using Mac visual studio Xamarin to develop my application. I have two application project (myapp-x and myapp-y) with me, both the application have watch application as well. I can install myapp-x in my watch from watch app in iPhone it get install and I can use it freely but I am trying to install myapp-y, it showing up installing from watch app but after the installing finish watch doesn't show up the application and watch app is showing to install the app again. I tried to install it again but it seems watch is rejecting the application to install for myapp-y where as myapp-x works completely fine.
Asked Last updated
.
Post not yet marked as solved
279 Views

WatchOS Fall Detection

I am trying to use the Fall Detection API to handle fall event, but I keep getting : [Fall] Error fetching most recent fall event: 111 I am using CMFallDetectionManager with delegate The call back like the one below is not happening, any idea why? How to simulate fall using the Watch Series 6 simulator? func fallDetectionManager(_ fallDetectionManager: CMFallDetectionManager, didDetect event: CMFallDetectionEvent, completionHandler handler: @escaping () - Void) {     logger.debug("Fall Event Detected") }
Asked
by dkam.
Last updated
.