Build, test, and submit your app using Xcode, Apple's integrated development environment.

Posts under Xcode tag

200 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
906
May ’24
Waiting to reconnect to [DEVICE NAME]
Hi, the 'Waiting to reconnect to [DEVICE NAME]' error is repeatedly occurring. Previous preparation error: Developer Mode disabled. To use[DEVICE NAME] for development, enable Developer Mode in Settings → Privacy & Security. Of course, the developer mode is already turned on and I've used the connection between my devices via XCode until yesterday. But it suddenly happened. I have several devices(iOS/iPadOS) so I've tried them all, but they are all having the same situations. What I've tried: Re-install XCode Rebooting mac and iPhone Safe boot my mac Disable and enable developer mode
0
0
46
4h
Is ObservableObject implicitly a MainActor in iOS 16 and later?
This is a question regarding the specification of ObservalObject. The following code does not cause a compilation error when the deployment target is set to iOS 16, but it does cause the following error when set to iOS 15: class Model: ObservableObject { let player: AVPlayer @Published var isPlaying = false var playerObserver: NSKeyValueObservation? init() { self.player = AVPlayer() self.playerObserver = self.player.observe(\.rate, options: [.new, .old]) { player, change in NSLog("changed rate: \(String(describing: change.newValue))") } } func setup() { let name = "sample" let url = Bundle.main.url(forResource: name, withExtension: "m4a")! let playerItem = AVPlayerItem(url: url) self.player.replaceCurrentItem(with: playerItem) } func play() { self.player.play() self.isPlaying = true } } The following error occurs in iOS 15: Cannot form key path to main actor-isolated property 'rate' Call to main actor-isolated instance method 'play()' in a synchronous nonisolated context Additionally, if the code is modified as follows, the error does not occur even in iOS 15. Specifically, adding @MainActor to the Model resolves the issue. @MainActor class Model: ObservableObject { ... } From this behavior, I guessed that ObservableObject is implicitly a MainActor in iOS 16 and later. Is this understanding correct?
1
0
67
19h
SwiftUI Gestures prevent scrolling with iOS 18
I added gesture support to my app that supports iOS 16 and 17 and have never had issues with it. However, when I compiled my app with Xcode 16 I immediately noticed a problem with the app when I ran it in the simulator. I couldn't scroll up or down. I figured out it’s because of my gesture support. My gesture support is pretty simple. let myDragGesture = DragGesture() .onChanged { gesture in self.offset = gesture.translation } .onEnded { _ in if self.offset.width > threshold { ...some logic } else if self.offset.width < -threshold { ...some other logic } logitUI.debug("drag gesture width was \(self.offset.width)") self.offset = .zero } If I pass nil to .gesture instead of myDragGesture then scrolling starts working again. Here’s some example output when I’m trying to scroll down. These messages do NOT appear when I run my app on an iOS 16/17 simulator with Xcode 15. drag gesture width was 5.333328 drag gesture width was -15.333344 drag gesture width was -3.000000 drag gesture width was -24.333328 drag gesture width was -30.666656 I opened FB14205678 about this.
0
0
93
1d
Xcode 16 beta 3 can't load Teams in VM
I'm currently setting up a new build environment. Our old build server was a small M1 Mac Mini set up to build our, up-to-now, only app. Since we now have a second app (and probably more to come) and have some issues building all on the same mac (gem versions, flutter versions, etc.) I now set up a virtualized build environment. I'm currently running a MacOS 15 beta 3 VM on a M2 Mac Mini also on MacOS 15 beta 3. The VM has all basic tools inside, including Xcode 16 beta 3 and is logged in with our AppleID for our build server. The VM is spun up with a non-persistent storage before the build, installs the gem's/flutter in the correct version, checks out the code and builds it. Now I'm getting an error on the build, that I have to select a development team, but he team is already selected and the build is working fine on the old M1 Mac Mini. It is suggested to login to Xcode, so I logged in to Xcode in the VM, which itself was successful, but when loading the teams I'm getting the following error: Decoding Error There was a failure decoding response: (HTTP 401, 60 bytes) The data couldn't be read because it isn't in the correct format.. The account info is correct, it's the same account that is logged in to MacOS and it's the same account from the old build system. I guess this somehow has to do with the MacOS VM (before MacOS 15 it was not possible to signin to an apple id, this is also the reason why I use the beta). Is there any chance to fix this and get it working? We are not able to use Xcode cloud builds (or any other cloud services) due to corporate policies. We are also not able to buy a dedicated Mac Mini for every app (too expensive and too much time needed for maintenance).
2
0
104
3d
How to Set IDEPreferLogStreaming Globally in Xcode 15.4
How do you fix this Xcode error whenever I create a new project it comes back. The fix is to add IDEPreferLogStreaming=YES but it only fixes for the current project. If I create new project it come back which is annoying to every time add it as YES. version: Xcode 15.4 I did try out Set this in Product->Scheme->Edit Scheme->Run->Arguments->Environment Variable IDELogRedirectionPolicy oslogToStdio OS_ACTIVITY_MODE disable For reference : Logging Error: Failed to initialize logging system. Log messages may be missing.? I tried these solutions from here
2
1
184
4d
Xcode 16 Previews: Always crash when compilation mode is WMO
This can be easily reproduced in a vanilla Xcode 16 beta 3 project. Steps Create a new project. By default, previews work fine because default SWIFT_COMPILATION_MODE is Incremental. (aka Batch Mode) Now, change it to WMO, and notice the previews crash with the enclosed crash report. Feedback filed with reproducer + diagnostics + crash report: https://feedbackassistant.apple.com/feedback/14268698 We have observed that enabling Whole Module Optimization (WMO) improves build times in our project. Therefore, if Previews can be compatible with WMO, it would be highly beneficial. Otherwise, it would be helpful to provide a warning or feedback to developers, as many projects are likely utilizing WMO, and identifying issues solely from crash reports can be challenging. Note: This works all fine with the Legacy Previews Engine in Xcode 15/16.
1
0
122
4d
Xcode Instruments selects wrong application when started from Xcode
Hello, I see the Instruments app has gotten a nice upgrade for Xcode 16. There is one issue left that has been bothering me though. If my app is installed inside the "Application" folder, and I then try to launch Instruments for a new build of the same app from within XCode, Instruments will run the app installed in "Applications" instead of running the app I just built. The problem with this, is that it's very easy to accidentally profile an old version of your app, and come to the wrong conclusions. I've created a video showing this issue: https://youtu.be/IloFsQQFgSw
1
0
94
4d
Xcode says I am developing in ios-release mode, but I'd prefer ios-debug mode ...
Hi I have an error message from running an iOS emulator, and it seems there's a problem because Xcode wants to sign something. I have noticed that when running my code for testing, that it is being run in ios-release mode. I have thought that maybe Xcode would not want to sign if the code was being run in ios-debug mode - because Xcode didn't have this interest in signing problem before. Confirmed: "Building com.example.appName for device (ios-release)..." Error confirmation: "No valid code signing certificates were found. You can connect to your Apple Developer account by signing in with your Apple ID in Xcode and create an iOS Development Certificate ..." My preference is to test/develop at this point without Apple Developer. This was possible for a long time before. Advice: "Or run on an iOS simulator without code signing" It seems that if Xcode were not interested in code signing that I wouldn't have this error preventing me. How can I configure Xcode so that code signing is skipped and the code testing occurs without a reference to my Apple Developer account please? If you can assist to resolve with these queries, that would be cool and greatly appreciated. With thanks.
0
0
101
4d
Private key is not installed in your keychain error
App.xcodeproj: error: Revoke certificate: Your account already has an Apple Development signing certificate for this machine, but its private key is not installed in your keychain. App.xcodeproj: error: No signing certificate "iOS Development" found: No "iOS Development" signing certificate matching team ID "T....." with a private key was found. From the above error during build, I do not know what I am supposed to do to fix this issue. The build was working few days back and today it is giving this error.
1
0
118
4d
Xcode not recognizing GoogleMaps theme colors with Swift
I have an Xcode project written in Objc where Xcode recognizes GoogleMaps code (GMS SDK 9) and applies appropriate theme colors. I'm porting the app into Swift and Xcode does not seem recognize GMS code for theme colors. The theme otherwise works and the Swift/GMS code works (ie the app works). I've tried 'Clean All Targets', deleting the DerivedData folder, cleaning the Xcode cache, re-installing the GMS SDK (both CocoaPod & manual methods) etc. When the Swift project is re-opened, Xcode shows the project is being re-indexed. After indexing, the rest of the code is 'colorized' - but not the GMS code. Both StackOverflow & StackExchange rejected this question. And Apple Developer Support has not been able to help (Case ID: 102334926141). Any advice will be greatly appreciated. TIA
6
0
122
2d