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

Remove Rosetta support on Xcode simulators
I'm not sure if having once enabled Rosetta on the Xcode simulators for older builds is a performance issue or not, but it seems like installing apps on them is slower than it used to. I'm trying to completely remove Rosetta support on the simulators but can't figure it out. I've installed Xcode on top of the older version, removed Xcode, removed all the simulators and yet it still shows: iPhone 15 Pro (Rosetta) as a target. Can someone help me remove Rosetta support on the simulators please?
1
0
1.7k
Dec ’23
Can't hear CAF Audio in running app
I have an unusual situation. I'm working through some self study training and this particular project is a game similar to fruit ninja where things are flying around the screen and you slice through them by swiping your finger. Anyway the instructor provided a series of "*.caf" files for various sounds while playing the game. For some reason I can't hear any of the sounds on my personal Mac when running the app via Xcode to either an iOS iPad simulator or to a real iPad that I have attached to my mac and setup for developer use in Xcode. Yes sound is working on the mac (hear new email come in etc. and can play videos in the browser). In the iPad simulator I can play youtube videos in mobile safari. While adjusting the sound doesn't seem to raise or lower the volume I can hear the audio in the youtube videos. On the real iPad: yes the sound is on and I can hear audio while playing videos in the browser etc. Lastly, I pushed the code up to GitHub and pulled it to my work Mac. There the sound plays just find in the iOS iPad simulator on that Mac (not allowed to attach my personal iPad to my work mac so can't try the iPad there). So I fell like this confirms the code is correct for playing the sounds in the running app. Oh, and I can select the file in left nav and click the little play button icon to hear it played in Xcode. so, I feel like this is an issue on my personal Mac with Xcode etc., but I'm at a loss as to what the issue is. Can anyone suggest some things to look for on my Mac to get sound working in this app? if you want to see the code it's here and the free training i'm following is at https://www.hackingwithswift.com/100/77. TIA
3
0
615
Dec ’23
Xcode Simulator iOS 17.0 Not Working
Hi dear all, I have just started working with Xcode and I am trying to download the iOS simulator to run my code on. When downloading it shows the size being 7.21GB, but when installing it it says my Disk is too full when my disk has at least 20GB available space. Here is the error message I get: Registering simulator runtime with CoreSimulator failed. Domain: DVTDownloadableErrorDomain Code: 29 User Info: { DVTErrorCreationDateKey = "2023-12-05 09:08:19 +0000"; } Cannot copy the image because the disk is almost full Domain: com.apple.CoreSimulator.simdiskimaged.SimDiskImageError Code: 14 System Information macOS Version 13.6 (Build 22G120) Xcode 15.0.1 (22266) (Build 15A507) Timestamp: 2023-12-05T17:08:19+08:00 Any help or direction is very appreciated. Thank you, Misael
0
1
755
Dec ’23
Microphone not working in iOS simulators under macos Sonoma 14.1.2
Hello, I am trying to test a speech to text feature in several iPhone simulators, but microphones don't seem to work. The microphone and speech recognition permissions are correctly asked for the feature. My internal and external microphones are detected in I/O options in simulators. But nothing happens when I launch the recognition. The recognition doesn't work also for speech to text in native messages keyboard or Siri. This problem is the same for all the simulators so I believe the issue is about Xcode permissions not accessing microphone. In my settings > Privacy & Security > Microphone : can't see Xcode (Considering an other issue, I can't see Xcode Source Editor in Extensions as well) I've already tried to uninstall and reinstall Xcode. I use Xcode 15.0.1 under Sonoma 14.1.2. Any help is welcome.
4
3
1.2k
Dec ’23
iOS Simulator Performance Issues
I have noticed that, as of late, the iOS simulator has been incredibly slow. Even simple (and perhaps silly) actions like changing the wallpaper take an unreasonably long time, to the point where it is no longer clear whether the process has hanged. I tried to change the wallpaper to a photo of mine, but it simply would not appear. Even booting up takes several seconds, and home screen animations are laggy. I've given up on testing my build for now. I have tried with an iPhone Xr and an iPhone 15 Pro simulator - both running iOS 17.0. Both are extremely laggy. This is on an M1 MacBook Air running the stable version of macOS Sonoma 14.0. with Xcode version 15.0.1 and Simulator version 15.0.1. I have checked the Activity Monitor for CPU and RAM. There is nothing abnormal. I would appreciate any suggestions.
1
0
562
Nov ’23
App crash on launch using Xcode 15 and iOS 14 simulator
When use Xcode15 and iOS 14 simulator to run app, it will crash, and the crash stack is: Thread 1 Queue : com.apple.main-thread (serial) #0 0x0000000104b074a5 in __cxx_global_var_init.4 () #1 0x000000014fb6ec95 in ImageLoaderMachO::doModInitFunctions(ImageLoader::LinkContext const&) () #2 0x000000014fb6f08a in ImageLoaderMachO::doInitialization(ImageLoader::LinkContext const&) () #3 0x000000014fb69bb7 in ImageLoader::recursiveInitialization(ImageLoader::LinkContext const&, unsigned int, char const*, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) () #4 0x000000014fb67ec7 in ImageLoader::processInitializers(ImageLoader::LinkContext const&, unsigned int, ImageLoader::InitializerTimingList&, ImageLoader::UninitedUpwards&) () #5 0x000000014fb67f68 in ImageLoader::runInitializers(ImageLoader::LinkContext const&, ImageLoader::InitializerTimingList&) () #6 0x000000014fb5b26b in dyld::initializeMainExecutable() () #7 0x000000014fb5ff56 in dyld::_main(macho_header const*, unsigned long, int, char const**, char const**, char const**, unsigned long*) () #8 0x000000014fb5a1c2 in start_sim () #9 0x000000024760e424 in dyld4::prepareSim(dyld4::RuntimeState&, char const*) () #10 0x000000024760cabc in dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*) () #11 0x000000024760c3bd in start () And I found two same issues: 1.https://issuetracker.google.com/issues/301372178; 2.https://github.com/realm/realm-swift/issues/8369 From these two issue, I know Xcode15 use new linker(ld_prime), and not support iOS <15; So if we want to support iOS 14, we only have one solution that add the -Wl,-ld_classic options to the OTHER_LDFLAGS? And for now, the crash only happened in iOS 14 simulator, but will it affect the iPhone device if we don't add the -Wl,-ld_classic options to the OTHER_LDFLAGS?
0
0
614
Nov ’23
Auto Layout Constraint Conflict in SwiftUI When Tapping TextField
I am developing an iOS app using SwiftUI and have encountered an Auto Layout constraint conflict issue that appears when tapping on a TextField within a LoginView. I've tried several troubleshooting steps but haven't been able to resolve it. Error Message: Probably at least one of the constraints in the following list is one you don't want. Try this: (1) look at each constraint and try to figure out which you don't expect; (2) find the code that added the unwanted constraint or constraints and fix it. ( "<NSLayoutConstraint:0x6000021298b0 'accessoryView.bottom' _UIRemoteKeyboardPlaceholderView:0x10460dd10.bottom == _UIKBCompatInputView:0x1059220e0.top (active)>", "<NSLayoutConstraint:0x60000217a620 'assistantHeight' SystemInputAssistantView.height == 45 (active, names: SystemInputAssistantView:0x10591ce60 )>", "<NSLayoutConstraint:0x60000217d090 'assistantView.bottom' SystemInputAssistantView.bottom == _UIKBCompatInputView:0x1059220e0.top (active, names: SystemInputAssistantView:0x10591ce60 )>", "<NSLayoutConstraint:0x60000217d040 'assistantView.top' V:[_UIRemoteKeyboardPlaceholderView:0x10460dd10]-(0)-[SystemInputAssistantView] (active, names: SystemInputAssistantView:0x10591ce60 )>" ) Will attempt to recover by breaking constraint <NSLayoutConstraint:0x60000217d040 'assistantView.top' V:[_UIRemoteKeyboardPlaceholderView:0x10460dd10]-(0)-[SystemInputAssistantView] (active, names: SystemInputAssistantView:0x10591ce60 )> This error appears in the console when I click on the TextField in my LoginView while running the code on a simulation. The app doesn't crash, but the console indicates there is a constraint conflict related to the keyboard. Here's my LoginView: struct LoginView: View { @StateObject var viewModel = LoginViewModel() var body: some View { NavigationStack { VStack { Spacer() Image("logo") .resizable() .scaledToFit() .frame(width: 150, height: 100) VStack { TextField("Enter your email", text: $viewModel.email) .autocapitalization(/*@START_MENU_TOKEN@*/.none/*@END_MENU_TOKEN@*/) .modifier(TextFieldModifier()) SecureField("Enter your password", text: $viewModel.password) .modifier(TextFieldModifier()) } Button { print("Show forgot password") } label: { Text("Forgot Password") .font(.footnote) .fontWeight(.semibold) .padding(.top) .padding(.trailing, 20) } .frame(maxWidth: .infinity, alignment: .trailing) Button { Task { try await viewModel.signIn() } } label: { Text("Login") .font(.subheadline) .fontWeight(.semibold) .foregroundColor(.white) .frame(width: 360, height: 44) .background(Color(.black)) .cornerRadius(8) } .padding(.vertical) HStack { Rectangle() .frame(width: (UIScreen.main.bounds.width / 2) - 40, height: 0.5) Text("OR") .font(.footnote) .fontWeight(.semibold) .foregroundColor(.gray) Rectangle() .frame(width: (UIScreen.main.bounds.width / 2) - 40, height: 0.5) } .foregroundColor(.gray) HStack { Image("facebook_logo") .resizable() .frame(width: 20, height: 20) Text("Continue with Facebook") .font(.footnote) .fontWeight(.semibold) .foregroundColor(Color(.systemBlue)) } .padding(.top, 8) Spacer() Divider() NavigationLink { AddEmailView() .navigationBarBackButtonHidden(true) } label: { HStack (spacing: 3) { Text("Don't have an account?") Text("Sign Up") .fontWeight(.semibold) } .font(.footnote) } .padding(.vertical, 16) } } } } #Preview { LoginView() } And my TextFieldModifier: struct TextFieldModifier: ViewModifier { func body(content: Content) ->some View { content .font(.subheadline) .padding(12) .background(Color(.systemGray6)) .cornerRadius(10) .padding(.horizontal, 24) .padding(.top) } } Attempts to Resolve: I've checked the TextFieldModifier for any potential issues but it seems standard. I've tried simplifying the view by removing other elements, but the issue persists. The issue seems to occur regardless of the simulator device or iOS version I use. Questions: What could be causing this Auto Layout constraint conflict in a SwiftUI app? Are there any known issues with SwiftUI's TextField and keyboard interactions that might lead to such constraints issues? Any suggestions on how to debug or resolve this constraint conflict?
2
3
997
Nov ’23
I am unable to run my iPad app on the Vision Pro simulator
My device has an M2 Max chip, and I am using Xcode version 15.1 Beta 3. My app runs normally in iOS and iPad simulators, but when I attempt to run it in the Vision Pro simulator, even though the compilation is successful, a dialog box appears stating, 'AppName's architectures (Intel 64-bit) include none that Apple Vision Pro can execute (arm64).' Consequently, the app is not successfully installed in the Vision Pro simulator. Additionally, my project uses Cocoapods for dependency management. I would appreciate any help, thank you!
5
1
2.5k
Jan ’24
Add audio files to iOS 17.0.1 simulators not working
My Xcode just updated and now I can't add audio files to the simulators. Nothing happens when sharing .wav or .mp3 files to the 17.0.1 simulators. Txt files share no problem. When a .wav or .mp3 file is dragged onto a simulator it opens Messages. Does anyone else have this problem? Is there a workaround on how to get audio files onto a 17.0.1 simulator? Is there a way to get my old simulators back? Any help greatly appreciated!
2
1
575
Nov ’23
Is this a bug or a feature?
I recently encountered a "potential bug" with SwiftData. I save my model with modelContent.insert and after that I get following error when trying to delete it with modelContent.delete: Could not cast value of type 'Swift.Optional<Any>' (0x1f5b871f8) to 'Foundation.UUID' This I mentioning the let id: UUID field marked with @Attribute(.unique). This build doesn't crash running in an iOS Sim but if it's running thought TestFlight on my iPhone it just crashes. If I try to delete elements that aren't just created, I don't get this error.
4
0
917
Jan ’24
Cannot pair watch simulator with iPhone simulator, Xcode 15
Hello, When I open Watch application on any of my IPhone simulators it says "Simulator Not Paired"... you can pair in Xcode Devices window. The problem is that there is no "PAIRED WATCHES" section there like shown in the help. when I run the xcrun simctl list command I see a lot of devices listed and even some paired. See the command output below. The problem started when I installed Xcode 15. When I had Xcode 14 the watches were paired with the devices and everything worked. I can actually only see the IPhone 15s and watches with watchOS 9.4 and 10. May be that is a part of the problem. Do I have to somehow delete them all and reinstall the latest? Thanks
1
0
934
Nov ’23
No Vision Pro Simulator available for Xcode 15.1 beta 2
Hi, I downloaded Xcode 15.1 beta 3 but my Unity project gives a tons of errors. In Unity forum one person from Unity said that the current ver. of Unity is not ready for Xcode 15.1 beta 3. So I downloaded Xcode 15.1 beta 2 but seems like Apple already took down the VisionOS Simulator compatible with the ver. of Xcode. Would you be able to allow us to download VisionOS 1.0 beta 4 again? I tried to find dmg for it but no luck.
2
2
630
Nov ’23
Xcode New Simulator Not Showing Up
Hey, I'm using Xcode 15.0. I added a new iPhone simulator for the 5.5" screenshots necessary for App Store Connect. However, the new iPhone simulator I created will not show up as an option when running the app on Xcode. I can open the simulator from the Simulator app, but that still doesn't allow it to be chosen. I have attached a few screenshots showing that Xcode knows about the new simulator (called 5.5" iPhone), but not selectable.
1
1
267
Nov ’23
iOS 17 keeps disappearing from simulator device options
I havent been able to figure out a pattern/cause, but every week or so, my simulator loses most of its available iOS version options. I should have 16.4 and 17 available, but you see I do not. When I go into xcode, iOS 17.0 has 2 entries, one allegedly available, and one awaiting download. Clicking "GET" on the grey one just pops a download windows which says its already downloaded. The only thing that sorts this is a reboot and it's back to normal again - with all my iOS versions available in the simulator. I dont want to keep having to reboot my dev machine. What is going on with XCode and how do I fix it for good?
3
3
731
Jan ’24
Verifying "iOS 17.0.simruntime" developer cannot be verified
Hey guys Ive been having this awful error “iOS 17.0.simruntime” cannot be opened because the developer cannot be verified. I can only click eject disk image, cancel, none of them solve this. What can I do to fix this? how is this Apple package not detected as verified developer? Note that this happened when I opened the iphone simulator, not that I installed or download anything. My setup: Macbook pro M1 Sonoma 14.1.1 Version 15.1 beta (15C5042i) I used the simulator without an issue a couple days before this started happening, thank you in advance.
3
4
1.1k
Nov ’23
XCUITest: Reset authorization status for Biometrics?
Hello everybody. I have a pack of UI tests for the Biometrics authentication. And in the beginning of each test I need there to be no permissions for Biometrics (granted or denied). I found the resetAuthorizationStatus(for:) method that allows resetting everything except Biometrics :( Is there any way I can reset this permission without deleting the whole app in tearDown()?
0
0
661
Nov ’23
Build setting variant for Designed for iPad
We're building one of our iPad apps for "Apple Vision Pro (Designed for iPad)" simulator and need to have certain different build settings for that simulator variant, compared to the default iOS simulator variant. It seems both variants use the iphonesimulator SDK. And in the Xcode build settings, the "Any iOS Simulator SDK" variant of any setting is what is also used, even when building for "Apple Vision Pro (Designed for iPad)". We tried adding a variant to the "Any iOS Simulator SDK" variant for one of the settings by editing the project file directly, using some possible variants we could think of. The added variant does show in the Xcode UI but it shows as "Any iOS Simulator SDK" also. But when building for "Apple Vision Pro (Designed for iPad)" Xcode still uses the original variant, as if it doesn't see that the added variant is matching the build destination. Example, where we want to exclude arm64 for iOS simulator builds, but not for "Apple Vision Pro (Designed for iPad)" builds. Original "Any iOS Simulator SDK" variant: "EXCLUDED_ARCHS[sdk=iphonesimulator*]" = "arm64"; Added variant: "EXCLUDED_ARCHS[sdk=iphonesimulator*][variant=Apple Vision Pro]" = ""; We have tried using variant names such as 'xr', 'xors', 'vision', 'visionos' and of course 'Apple Vision Pro' to no avail. The variant shows in the UI but the build doesn't use it. Does anyone know if there is a variant (or other property or other way of distinguishing such variant) that we can use that Xcode will recognize and use when building for "Apple Vision Pro (Designed for iPad)"? Thanks.
1
5
636
Nov ’23