Simulator

RSS for tag

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

Simulator Documentation

Posts under Simulator tag

344 results found
Sort by:
Post marked as solved
92 Views

iOS 15 Simulator - Files App not showing contents of Documents Folder anymore

Updated my environment recently to Big Sur and Xcode 12.5.1. I have an app that downloads pdf files and saves it externally to be viewed in the Files App. Everything works fine on real device but not in the simulator. I observed that files in Documents folder of the iOS simulator(iOS 15.0) do not show up in the Files app anymore. Is there any permission/hiccup here that I should be aware of?
Asked Last updated
.
Post not yet marked as solved
62 Views

iOS15 simulator does not start

Just installed XCode 13 via xip file. I opened the iPhone13 simulator with iOS15, but the screen is black and nothing happens. It doesn't even let me take a screenshot. When Ic lose it, this get shown: Details Invalid device state Domain: com.apple.CoreSimulator.SimError Code: 405 User Info: {   IDERunOperationFailingWorker = IDELaunchiPhoneSimulatorLauncher;   SimCallingSelector = "installApplication:withOptions:error:"; } The operation couldn’t be completed. (Mach error -308 - (ipc/mig) server died) Domain: NSMachErrorDomain Code: -308 Analytics Event: com.apple.dt.IDERunOperationWorkerFinished : {   "device_model" = "iPhone14,5";   "device_osBuild" = "15.0 (19A339)";   "device_platform" = "com.apple.platform.iphonesimulator";   "launchSession_schemeCommand" = Run;   "launchSession_state" = 1;   "launchSession_targetArch" = "x86_64";   "operation_duration_ms" = 325230;   "operation_errorCode" = 405;   "operation_errorDomain" = "com.apple.CoreSimulator.SimError";   "operation_errorWorker" = IDELaunchiPhoneSimulatorLauncher;   "operation_name" = IDERunOperationWorkerGroup;   "param_consoleMode" = 0;   "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_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_runnable_swiftVersion" = "5.5";   "param_runnable_type" = 2;   "param_testing_launchedForTesting" = 0;   "param_testing_suppressSimulatorApp" = 0;   "param_testing_usingCLI" = 0;   "sdk_canonicalName" = "iphonesimulator15.0";   "sdk_osVersion" = "15.0";   "sdk_variant" = iphonesimulator; } System Information macOS Version 11.6 (Build 20G165) Xcode 13.0 (19234) (Build 13A233) Timestamp: 2021-10-13T00:08:49+02:00 big sour 11.6 Model Name: Mac mini  Model Identifier: Macmini8,1  Processor Name: Quad-Core Intel Core i3  Processor Speed: 3,6 GHz  Number of Processors: 1  Total Number of Cores: 4  L2 Cache (per Core): 256 KB  L3 Cache: 6 MB  Memory: 16 GB
Asked
by TheNemus.
Last updated
.
Post not yet marked as solved
39k 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 marked as solved
58 Views

iOS Simulator Cannot Read the Health Data I Saved

Hi everyone! I have created an app to save & read some running & walking workout data to HealthKit. I managed to save the data, and view it on the simulator's Health app, but when I try to read the data, sample count is 0. I'd appreciate if someone help me out with this. Thanks in advance! Xcode 12.5.1 / iOS 14.5 func AuthenticateHealthKit() { print("AuthenticateHealthKit") let typesToShare: Set = [ HKQuantityType.workoutType() ] let typesToRead: Set = [ HKQuantityType.workoutType(), HKQuantityType.quantityType(forIdentifier: .distanceWalkingRunning)!, HKQuantityType.quantityType(forIdentifier: .height)!, ] healthStore.requestAuthorization(toShare: typesToShare, read: typesToRead) { (success, error) in if !success { fatalError("Error requesting authorization from health store: \(String(describing: error)))") } else { print("Authenticated!") } } } func SaveData() { let configuration = HKWorkoutConfiguration() configuration.activityType = .running configuration.locationType = Int.random(in: 0..<2) == 0 ? .indoor : .outdoor let startDate = now - (86400 * 60.0) let duration = 120.0 let endDate = startDate + duration let quantity = HKQuantity(unit: HKUnit.kilocalorie(), doubleValue: 20.0) let distance = HKQuantity(unit: HKUnit.meter(), doubleValue: 1200) let workout = HKWorkout( activityType: configuration.activityType, start: startDate, end: endDate, duration: duration, totalEnergyBurned: quantity, totalDistance: distance, metadata: [HKMetadataKeyIndoorWorkout: true]) healthStore.save(workout) { success, _ in if success { print("SAVED WORKOUT!!!") } else { print("COULD NOT SAVE WORKOUT!!!") } } } func ReadData() { let start = now - (86400 * 60.0) let end = now let predicate = HKQuery.predicateForSamples(withStart: start, end: end, options: []) print("start : \(start)") guard HKHealthStore.isHealthDataAvailable() else { print("No data available!") return } guard let sampleType = HKSampleType.quantityType( forIdentifier: HKQuantityTypeIdentifier.distanceWalkingRunning) else { fatalError("*** This method should never fail ***") } let query = HKSampleQuery( sampleType: sampleType, predicate: predicate, limit: Int(HKObjectQueryNoLimit), sortDescriptors: nil ) { query, results, error in guard let samples = results as? [HKQuantitySample] else { print("Error") return } for sample in samples { print("sample : \(sample.quantity) \(sample.quantityType)") } DispatchQueue.main.async { print("Update UI : \(samples.count)") } } healthStore.execute(query) } Output of ReadData method start : 2021-08-14 21:38:35 +0000 Authenticated! Update UI : 0 Following are the Health App data & permissions (all on simulator)
Asked
by alpsoy.
Last updated
.
Post not yet marked as solved
2.6k 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
14k Views

Failed to start remote service on device

I am unable to get applications to run on a physical iPhone 11 device from xcode. They work fine when the target is a simulator.I am using the inital myapp to test this for simplicity. The apps are successfully loaded on the physical iPhone and can be manually run with no problem. The following error is given when xCode tries to run them (perhaps a firewall issue?):Failed to start remote service on device.Domain: com.apple.dtdevicekitCode: 811Recovery Suggestion: Please check your connection to your device.User Info: { DVTRadarComponentKey = 261622;}--The service is invalid.Domain: com.apple.dt.MobileDeviceErrorDomainCode: -402653150User Info: { DVTRadarComponentKey = 261622; MobileDeviceErrorCode = "(0xE8000022)"; "com.apple.dtdevicekit.stacktrace" = ( 0 DTDeviceKitBase 0x000000011d7c983d DTDKCreateNSErrorFromAMDErrorCode + 204 1 DTDeviceKitBase 0x000000011d7db171 __63-[DTDKRemoteDeviceConnection startFirstServiceOf:unlockKeybag:]_block_invoke + 564 2 DTDeviceKitBase 0x000000011d7da839 __48-[DTDKRemoteDeviceConnection futureWithSession:]_block_invoke_3 + 22 3 DTDeviceKitBase 0x000000011d7cbe04 __DTDKExecuteInSession_block_invoke_2 + 35 4 DTDeviceKitBase 0x000000011d7cb214 __DTDKExecuteWithConnection_block_invoke_2 + 473 5 DTDeviceKitBase 0x000000011d7cb012 __DTDKExecuteWithConnection_block_invoke + 106 6 libdispatch.dylib 0x00007fff6a85150e _dispatch_client_callout + 8 7 libdispatch.dylib 0x00007fff6a85d567 _dispatch_lane_barrier_sync_invoke_and_complete + 60 8 DVTFoundation 0x0000000103280584 DVTDispatchBarrierSync + 208 9 DVTFoundation 0x0000000103256edf -[DVTDispatchLock performLockedBlock:] + 64 10 DTDeviceKitBase 0x000000011d7caf13 DTDKExecuteWithConnection + 226 11 DTDeviceKitBase 0x000000011d7cbc6e DTDKExecuteInSession + 376 12 DTDeviceKitBase 0x000000011d7da67a __48-[DTDKRemoteDeviceConnection futureWithSession:]_block_invoke_2 + 131 13 DVTFoundation 0x000000010327da10 __DVT_CALLING_CLIENT_BLOCK__ + 7 14 DVTFoundation 0x000000010327f652 __DVTDispatchAsync_block_invoke + 1194 15 libdispatch.dylib 0x00007fff6a850583 _dispatch_call_block_and_release + 12 16 libdispatch.dylib 0x00007fff6a85150e _dispatch_client_callout + 8 17 libdispatch.dylib 0x00007fff6a856ace _dispatch_lane_serial_drain + 597 18 libdispatch.dylib 0x00007fff6a857485 _dispatch_lane_invoke + 414 19 libdispatch.dylib 0x00007fff6a860a9e _dispatch_workloop_worker_thread + 598 20 libsystem_pthread.dylib 0x00007fff6aaab6fc _pthread_wqthread + 290 21 libsystem_pthread.dylib 0x00007fff6aaaa827 start_wqthread + 15);}--System InformationmacOS Version 10.15.3 (Build 19D76)Xcode 11.4 (16132.1)
Asked
by wlawver.
Last updated
.
Post not yet marked as solved
56 Views

Xcode 13 simulator kills internet

I recently upgraded both MacOS (to 11.6) and Xcode (to 13.0). Now, when I run my NativeScript app within an Xcode simulator, whether iOS 13.2 or 15.0, internet requests time out, both within the simulator and on the Mac itself. I can test on devices OK, and I've enabled "Allow HTTP Services" within the emulators. My only recourse is to restart the Mac.
Asked
by dlcole33.
Last updated
.
Post not yet marked as solved
616 Views

SecItemAdd returns errSecAuthFailed

Hello, I'm experiencing a weird issue on the iOS 15 simulator (unfortunately I don't have a device with 15 installed yet). The issue I see is that the call to SecItemAdd returns OSStatus -25293 (errSecAuthFailed). The attributes dictionary passed looks like this: var query: [String : Any] = [ kSecClass as String: kSecClassGenericPassword, kSecAttrAccount as String: key, kSecAttrService as String: service, kSecAttrAccessControl as String: getSecAccessControl(), kSecUseAuthenticationContext as String: context, kSecValueData as String: data         ] the getSecAccessControl returns a SecAccessControl created like this:         access = SecAccessControlCreateWithFlags(nil,   kSecAttrAccessibleWhenUnlockedThisDeviceOnly,   .userPresence,   &amp;error) if I do not add the kSecAttrAccessControl item I don't see any error. The same code works as expected on the simulator with iOS 14. Looking at the documentation didn't help, anybody has hints about this? Maybe it's bug I'm not aware of? Thank you in advance
Asked
by AlessioP.
Last updated
.
Post not yet marked as solved
74 Views

Function on TestFlight not during review App issue

Hi Apple Developers I need advice on how to fix this. Our new app was coded in React Native and build in Expo SDK 41. It is listed on Play Store since April 2021. Our iOS version is working perfectly on TestFlight. Installed on: iPad Air 2 iPhone SE iPhone 8 iPhone 11, all devices in Namibia Registration goes smooth and response from API server feels immediately on 3G as well as Wi-Fi and the app works 100%, yet it seems like the app can't read the JSON response from our API while on Simulator (used a iPhone8 iOS 15) as well as while it is being reviewed during the sign-up process. I added alert messages to test if the app goes into the response => response.json() block and it doesn't, however, the POST of information does reach the API as the user options is reset once Apple App Review team review and register with the test account. I have xCode13 , but code on Visual Studio Core in React Native with the Expo SDK 41 to code once and deploy 2x. Any help or advice would be highly appreciated. Thank you
Asked
by ZeldaE.
Last updated
.
Post not yet marked as solved
934 Views

How to solve the "Service exited due to SIGABRT" error

Hello World. I have an application that I am trying to push to the App Store. The app works efficiently as expected when I run it on expo using “expo start”, and through the expo app when I run it live. However, when I go to build the app in my expo-CLI using the command ‘expo build:ios’ I get the build artifact in the form of an IPA file. On my first usage to push it to the app store, the app crashed on first opening. After some more attempts to open, I was unfortunately met with the utterly same result. I then proceed to retry my attempts using the simulator-based build for my ios simulator on my 2017 Macbook Pro. And I was met with this crash log: Feb 26 15:25:56 Tys-MacBook-Pro ComHelveticoAllergynclub[3706]: assertion failed: 19F101 17E255: libxpc.dylib + 83746 [4C712F12-2C58-3CCE-BA41-4D361D578D13]: 0x7d Feb 26 15:25:57 Tys-MacBook-Pro com.apple.CoreSimulator.SimDevice.E7E6E08C-AEEA-4390-8DE8-BE48F676F473[3579] (UIKitApplication:com.helvetico.allergynclub[d42b][rb-legacy][3706]): Service exited due to SIGABRT expo diagnostics Expo CLI 3.20.1 environment info: System: OS: macOS 10.15.5 Shell: 5.7.1 - /bin/zsh Binaries: Node: 12.16.1 - /usr/local/bin/node Yarn: 1.9.4 - /usr/local/bin/yarn npm: 6.13.4 - /usr/local/bin/npm IDEs: Android Studio: 3.5 AI-191.8026.42.35.6010548 Xcode: 11.4/11E146 - /usr/bin/xcodebuild npmPackages: expo: ^37.0.12 = 37.0.12 react: ~16.9.0 = 16.9.0 react-dom: ~16.9.0 = 16.9.0 react-native: ~0.61.5 = 0.61.5 react-native-web: ~0.11.7 = 0.11.7 react-navigation: ^4.3.9 = 4.3.9 npmGlobalPackages: expo-cli: 3.20.1 Expo CLI 3.20.1 environment info: System: OS: macOS 10.15.5 Shell: 5.7.1 - /bin/zsh Binaries: Node: 12.16.1 - /usr/local/bin/node Yarn: 1.9.4 - /usr/local/bin/yarn npm: 6.13.4 - /usr/local/bin/npm IDEs: Android Studio: 3.5 AI-191.8026.42.35.6010548 Xcode: 11.4/11E146 - /usr/bin/xcodebuild npmPackages: expo: ^37.0.12 = 37.0.12 react: ~16.9.0 = 16.9.0 react-dom: ~16.9.0 = 16.9.0 react-native: ~0.61.5 = 0.61.5 react-native-web: ~0.11.7 = 0.11.7 react-navigation: ^4.3.9 = 4.3.9 npmGlobalPackages: expo-cli: 3.20.1 If anyone could tell me what the issue is and assist my endeavor in unraveling this issue I will be eternally grateful! Thank you!
Asked
by helvetico.
Last updated
.
Post not yet marked as solved
84 Views

Apple Silicon, iOS simulator, and External Build System target

I have run into the issue of trying to use a static library in an iOS app running in the simulator on an M1 (Apple Silicon) mac. However I'm having a difficult time adapting existing recommended solutions to my use-case. As I understand it, the root cause is that previously iOS simulator targets were always Intel but now on Apple Silicon the simulator targets can also be arm64. The recommended solution is to use XCFramework to better handle the combinations of platform and arch (e.g. iOS simulator + arm64). I have a cross-platform C library with a Makefile that I have in Xcode as an "External Build System" target. In the Xcode target it calls /usr/bin/make with the following arguments, where it passes relevant build settings from the iOS Framework to this external make task. On Intel-based Macs this has worked to automatically change the arch and SDK depending on the build target chosen in Xcode, e.g. building for simulator or making an archive. build CONF=$CONFIGURATION CND_PLATFORM=$PLATFORM_NAME IPHONEOS_DEPLOYMENT_TARGET=$IPHONEOS_DEPLOYMENT_TARGET CFLAGS="-arch $PLATFORM_PREFERRED_ARCH -isysroot $SDKROOT -fembed-bitcode" Where I believe I'm stuck is that, when building for iOS simulator on my M1 MacBook, the $PLATFORM_NAME is correctly set for the simulator but the $PLATFORM_PREFERRED_ARCH still shows x86_64. When the iOS Framework goes to link with the static library produced by this makefile it complains about missing symbols (presumably because it's looking for arm64 symbols). How can I pass the correct contextual build information to this External Build System (makefile) target for the iOS Simulator on Apple Silicon?
Asked
by cconway.
Last updated
.
Post not yet marked as solved
87 Views

Flutter causes Mac OS Crash

Hi, I'm using flutter now for the last 2years on my machine. A few months ago I had the same problem like i have it now - but i do not have any clue why and how to resolve it. I'm using the flutter framework to develop some apps. When I run the "flutter run" command, the XCode Build is working and for some seconds i can see the next task "compiling, signing and...." and then sudden it causes my Mac OS reboot. In parallel i have a device opened in the simulator which should run the app. It happens now every time which makes me impossible to work on flutter. I've created already an issue on github/flutter for that. they say that the issue is coming from the iOS simulator runtime so it's not something Flutter has any control over. Specs from my machine: MacBook Pro (13-inch, 2020, Four Thunderbolt 3 ports) - System Version: macOS 11.6 (20G165) - Kernel Version: Darwin 20.6.0 [✓] Flutter (Channel stable, 2.5.2, on macOS 11.6 20G165 darwin-x64, locale en) I have added some text files from the crash report - i hope this helps. if you see some sensitive data please be so kind and delete it. Hopefully you can help me to figure out the problem and we can fix this quickly. Thank you! crash_01.txt crash_02.txt crash_03.txt
Asked
by buyildir.
Last updated
.
Post not yet marked as solved
123 Views

Objective c with iOS 15

Hey Team, I was doing testing after updated Xcode 13. While running the application it got crashed, I saw the logs in the terminal. please refer to it below. "Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Passing argument that is not a CGColor to +[UIColor colorWithCGColor:]' terminating with uncaught exception of type NSException" NOTE: I have not applied any code color in the code.
Asked
by Nomankhan.
Last updated
.
Post not yet marked as solved
10k Views

Xcode does not recognize iphone

Xcode 9.4.1 on MacOS 10.13.6 does not recognize iphone (iOS 11.4.1), hence "No devices connected to 'My Mac'".Even Window -&gt; Devices and Simulators, there are no devices.But the iphone device is recognized on USB device list.Could you suggest how I can fix this problem or what I did wrong?Also, I have noticed that the system report of MacOS says the version of the iOS on the USB is 7.0.2.But the iOS version is iOS 11.4.1. Is this normal?Thanks.
Asked
by KatoBrain.
Last updated
.