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

Xcode Documentation

Pinned Posts

Posts under Xcode tag

3,052 Posts
Sort by:
Post not yet marked as solved
0 Replies
26 Views
When attempting to add a recent build to an External test group, I am receiving the error: This build is using a beta version of Xcode and can’t be submitted. Make sure you’re using the latest version of Xcode or the latest seed release found on the releases tab in News and Updates This build is a macOS app built with Unity, which is then codesigned, packaged with productbuild, and then uploaded with xcrun altool --upload-package. The version of Xcode being used was released about a week ago. Xcode Version 15.4 (15F31d), built of an Intel Mac Mini running macOS 14.4.1 (23E224). I have seen threads in the past about this, but nothing recent. (1,2)
Posted
by mcarriere.
Last updated
.
Post not yet marked as solved
0 Replies
30 Views
I'm having an issue where when my asset catalog have more than 2 images (all have @1x @2x and @3x and PNG format), my NSImage in my NSImageView cannot be clicked. Does anyone know why this happens? Thanks in advance! import SwiftUI struct ContentView: View { @State private var window: NSWindow? var body: some View { VStack { Button("Open Window") { // Create and show the NSWindow self.window = NSWindow( contentRect: NSScreen.main?.frame ?? NSRect.zero, styleMask: [.borderless], backing: .buffered, defer: false ) // Set up window properties self.window?.isOpaque = false self.window?.hasShadow = false self.window?.backgroundColor = .clear self.window?.level = .screenSaver self.window?.collectionBehavior = [.canJoinAllSpaces] self.window?.makeKeyAndOrderFront(nil) // Create an NSImageView let petView = PetView() // Add the NSImageView to the window's content view if let contentView = self.window?.contentView { contentView.addSubview(petView) // Center the petView petView.centerXAnchor.constraint(equalTo: contentView.centerXAnchor).isActive = true petView.centerYAnchor.constraint(equalTo: contentView.centerYAnchor).isActive = true } } } } } class PetView: NSImageView { override init(frame frameRect: NSRect = .zero) { super.init(frame: frameRect) self.image = NSImage(named: "dog_idle-1") self.translatesAutoresizingMaskIntoConstraints = false } required init?(coder: NSCoder) { super.init(coder: coder) } override func mouseDown(with event: NSEvent) { print("woof!") } } I've tried changing the amount of images in my asset catalog and found that 2 is the maximum amount for my NSImage to be clickable. It suppose to print "woof!" when i click on it.
Posted
by TessyJr.
Last updated
.
Post not yet marked as solved
0 Replies
28 Views
i am working application ABC where user can save configuration. Then later it can be open using same file. but when i am saving this configuration file. its not showing the icon. the application is built using qt c++.. here is my plist what is the possible cause? i tried directly providing path of icon in plist. i tried CFBundleSignature from ???? to ABCC
Posted Last updated
.
Post not yet marked as solved
1 Replies
89 Views
I've created a Full Immersive VisionOS project and added a spacial video player in the ImmersiveView swift file. I have a few buttons on a different VideosView swift file on a floating window and i'd like switch the video playing in ImmersiveView when i click on a button in VideosView file. Video player working great in ImmersiveView: RealityView { content in if let videoEntity = try? await Entity(named: "Video", in: realityKitContentBundle) { guard let url = Bundle.main.url(forResource: "video1", withExtension: "mov") else {fatalError("Video was not found!")} let asset = AVURLAsset(url: url) let playerItem = AVPlayerItem(asset: asset) let player = AVPlayer() videoEntity.components[VideoPlayerComponent.self] = .init(avPlayer: player) content.add(videoEntity) player.replaceCurrentItem(with: playerItem) player.play() }else { print("file not found!") } } Buttons in floating window from VideosView: struct VideosView: View { var body: some View { VStack{ Button(action: {}) { Text("video 1").font(.title) } Button(action: {}) { Text("video 2").font(.title) } Button(action: {}) { Text("video 3").font(.title) } } } } In general how do I control the video player across views and how do I replace the video when each button is selected. Any help/code/links would be greatly appreciated.
Posted Last updated
.
Post not yet marked as solved
3 Replies
125 Views
Recently we have started refactoring some code to use Swift concurrency in Xcode 15.3. As we have added some new async methods and Tasks, new runtime warnings have emerged titled "Known Hang" and several are listed. None of the stack traces listed with these warnings are in areas directly modified but some of the same types/methods called are also called from the modified areas. So I can sort of understand why they are coming up...but they had to have been there before we added the Swift concurrency. Example of a tooltip with the warnings: My first query is: Are these warnings only issued when Swift concurrency is added/applied (as they were not there when using closures and mostly just off the main thread to network calls)? The documentation indicates these can all be suppressed by turning off the Thread Performance Checker BUT I would rather just suppress the few places as we refactor our codebase (as it is quite large). In that way, any new ones may be documented and we can decide to fix them now or later. I have tried to follow the instructions and added an environment variable PERFC_SUPPRESSION_FILE (in the Scheme) with a full path to a file formatted similarly to the example in the documentation. class:NSManagedObjectContext method:-[NSManagedObjectContext save:] My second query is: I have verified that the variable is set by reading it from the ProcessInfo. However, regardless of my settings, the runtime warnings are still presented. I could not find any examples or even any mention of others using this environment variable. I am reaching out with any advice or ideas to try. Has anyone successfully tried this or found an issue/alternative? Help me Mr. Wizard!
Posted
by billdog.
Last updated
.
Post not yet marked as solved
0 Replies
72 Views
I have built the app on xcode and deployed it on my ios device. I am using a personal team account using my apple id. It is an xcode managed profile. I go to VPN & Device Management and accept the developer which works, but then when I hit "Verify App" there is a blink and nothing happens and no error code. I have fine internet I am able to access websites and I do not have a VPN.
Posted
by adampolak.
Last updated
.
Post not yet marked as solved
0 Replies
76 Views
Hi, i have been noticing some strange issues with using CoreML models in my app. I am using the Whisper.cpp implementation which has a coreML option. This speeds up the transcribing vs Metal. However every time i use it, the app size inside iphone settings -> General -> Storage increases - specifically the "documents and data" part, the bundle size stays consistent. The Size of the app seems to increase by the same size of the coreml model, and after a few reloads it can increase to over 3-4gb! I thought that maybe the coreml model (which is in the bundle) is being saved to file - but i can't see where, i have tried to use instruments and xcode plus lots of printing out of cache and temp directory etc, deleting the caches etc.. but no effect. I have downloaded the container of the iphone from xcode and inspected it, there are some files stored inthe cache but only a few kbs, and even though the value in the settings-> storage shows a few gb, the container is only a few mb. Please can someone help or give me some guidance on what to do to figure out why the documents and data is increasing? where could this folder be pointing to that is not in the xcode downloaded container?? This is the repo i am using https://github.com/ggerganov/whisper.cpp the swiftui app and objective-C app both do the same thing i am witnessing when using coreml. Thanks in advance for any help, i am totally baffled by this behaviour
Posted
by Saddif.
Last updated
.
Post not yet marked as solved
0 Replies
73 Views
Hello, I've upgraded Xcode to newest 15.4 and now I cannot edit text in the output console (debugger). The Xcode console (output) does not allow editing text and does not allow any text input anymore. I've seen that this may be related to structured logging. I used to mark things in console output by typing some notes for me when debugging. How to do that? How to make Xcode console allow input like add line break to mark items in my log, or add notes?
Posted
by slaj.
Last updated
.
Post not yet marked as solved
1 Replies
87 Views
Hi, I am using macOS Sonoma 14.5 and the latest version of Xcode (15.4). Every time I open Xcode, it asks me to install additional components. I accept, but when it finishes, the same dialog appears again. I've done this multiple times. I also uninstalled and reinstalled Xcode, but no luck. Can you please help me?
Posted
by isoldo.
Last updated
.
Post not yet marked as solved
2 Replies
182 Views
When I try to setup my new 13" iPad Pro for development with Xcode I get the following error. Previous preparation error: The developer disk image could not be mounted on this device.. Error mounting image: 0xe8000105 (kAMDMobileImageMounterTATSUDeclinedAuthorization: The server declined to authorize this image on this device for this user.) I have tried many times and tried multiple things like reseting the iPad and starting again. Rebooting both devices. Deleting ~Library/Developer/DeveloperDiskImages Still nothing. This is quite frustrating. Any help appreciated. Ben
Posted
by BenODwyer.
Last updated
.
Post not yet marked as solved
0 Replies
85 Views
Hello fellow developers, We are trying to develop a chatbot application for ios devices using the powers of Oracle Digital Assistant. Main Documentation :- https://docs.oracle.com/en/cloud/paas/digital-assistant/use-chatbot/oracle-ios.html Implementation instructions :- https://blogs.oracle.com/digitalassistant/post/oracle-techexchange-using-the-oracle-ios-sdk-to-integrate-oracle-digital-assistant-in-mobile-applications The point is when we are trying to run the app, we are facing tons of warnings as in below screenshot. Here is the code for the ViewController.swift as below: // // ViewController.swift // ODA_Configure // // Created by Macbook on 15/05/24. // //import UIKit // //class ViewController: UIViewController { // // override func viewDidLoad() { // super.viewDidLoad() // // Do any additional setup after loading the view. // } // // //} // Import the SDK import UIKit import BotClientUISDK public class ViewController: UIViewController { // Declare a global BotsViewController variable in your app view controller class public var chatViewController: BotsViewController? public override func viewDidLoad() { super.viewDidLoad() // Obtain a shared instance of BotsViewController from BotsUIManager chatViewController = BotsUIManager.shared().viewControllerInstance() // Specify the color changes if any in a particular component. Make sure you set all the required colors in BotsProperties before adding the chat view to the view controller. // Add the chatViewController to your navigationController self.navigationController?.pushViewController(chatViewController!, animated: false) // Obtain a shared instance of BotsManager let botsManager = BotsManager.shared() // If you require access to callback methods provided in AuthenticationProvider. Make sure your class conforms to BotsMessageServiceDelegate // botsManager.authenticationTokenProvider = self let baseUrl = "idcs-oda-81e5e7409d52405784089abe830a8820-da12.data.digitalassistant.oci.oraclecloud.com" let channelID = "ff8a2d3f-7d65-4dab-a09a-d8f574ce5b7a" // Initialize a BotsConfiguration object and set feature flags if required. let botsConfiguration = BotsConfiguration(url: baseUrl , channelId: channelID) BotsManager.shared().connect(botsConfiguration: botsConfiguration) // Set the feature flag values if the desired values are different from the default values botsConfiguration.showConnectionStatus = true botsConfiguration.enableSpeechSynthesis = true botsConfiguration.disablePastActions = "none" // Initialize the configuration in botsViewController. Make sure you set all the feature flag values before passing the botsConfiguration to initConfiguration. chatViewController?.initConfiguration(botsConfiguration: botsConfiguration) // If you require access to callback methods provided in BotsMessageServiceDelegate. Make sure your class conforms to BotsMessageServiceDelegate //botsManager.delegate = self // If you require access to callback methods provided in BotsEventListener. Make sure your class conforms to BotsEventListener //botsManager.botsEventListener = self // Initialize and establish connection to the chat server BotsManager.shared().initialize(botsConfiguration: botsConfiguration, completionHandler: { (connectionStatus, error) in if error != nil { print ("Error: \(String(describing: error?.localizedDescription))") } else { print ("Connection Status: \(connectionStatus)") } }) } } After executing this code, we are getting the message as build succeeded , and this is the emulator, which happens to be blank white all the time. Possibly due the warning which I have posted above this seems to be the showstopper in the development. We are developing this for a prestigious client and would request an assistance as soon as possible. P.S :- We are using Xcode 15 with Simulator of version 17.0.
Posted Last updated
.
Post not yet marked as solved
0 Replies
71 Views
Hi, I have been receiving an email error message: ITMS-90426: Invalid Swift Support - The SwiftSupport folder is missing. Rebuild your app using the current public (GM) version of Xcode and resubmit it. when submitting an app to the App Store Connect using xcode. I have searched for many solutions online, but none of them have worked. Later, I manually created the SwiftSupport directory and copied the Swift dynamic library (dylib) that the app depends on to this directory, as well as copying them to the. app/Frameworks directory. After submitting, I received an email saying that these. dylib dynamic libraries are not in the. app/Frameworks directory. I opened the IPA file and checked the directory, and I really saw that they are located below. I don't know where the problem is, can you tell me the exact reason?
Posted
by forchen.
Last updated
.
Post not yet marked as solved
1 Replies
672 Views
Hello, im a new Apple developper since 2 years. I have Been working hard to learn and trying to publish my first IOS , iPad OS and Mac OS app. My app is taking form but I have few problems with the Xcode simulator to run ''on device'' for my iPad and iPhone. My devices began to disconnect and now I can't connect it anymore to run my code and debug. the are constantly in the state ''Trying to reconnect to '' and "preparing device". I have already reset all my device and deactivate developper mode etc. i have a iPad 7th gen and an iPhone 14 Pro Max . they both have iOS 17.5 beta 2 (trying to fix the problem by keeping those up to date as much as possible.) my Xcode version is 15.4 beta My Mac book air 13 inch 2018 is running Sonoma 14.4.1 and the is no new os version bus its not an apple M family chip. I think there is a Sonoma 14.5 beta version but for apple architecture. I really need your help plz
Posted Last updated
.
Post marked as solved
6 Replies
520 Views
I tried to read an Object : -(NSMutableDictionary*) readMyObject:(NSData*)data; { NSError * error; Class class = [NSMutableDictionary class]; NSMutableDictionary * dict; dict = [NSKeyedUnarchiver unarchivedObjectOfClass:class fromData:data error:&error]; return dict; the result was nil. I searched by Developer for a solution and found one : { // NSKeyedUnarchiver * unarchiver = [[NSKeyedUnarchiver alloc] init]; [unarchiver decodeObjectOfClasses: [[NSSet alloc]initWithArray: @[[NSDictionary class], [NSMutableDictionary class], [NSArray class], [NSMutableArray class], [NSString class], [NSNumber class]]] forKey:NSKeyedArchiveRootObjectKey]; [unarchiver finishDecoding]; } The first line was from me and it crashed the project. I assume there is an easy answer, not for me.🥲 Uwe
Posted Last updated
.
Post not yet marked as solved
12 Replies
3.6k Views
I just upgraded to XCode15.3 and now all my projects with Assets are getting this compile error. I have tried removing DerivedData caches and rebooting but still get this error. Anyone else hit this problem with XCode 15.3? I was only Building for IOS 16.4 and 17.0.1 and Xcode 14.0 and 15.0 Build Error: Command CompileAssetCatalog failed with a nonzero exit code *** Terminating app due to uncaught exception 'IBPlatformToolFailureException', reason: 'The tool closed the connection (AssetCatalogSimulatorAgent) Execution Context: <IBSimulatorToolCoreSimulatorCLIExecutionContext: 0x600003d5d260 busyCount=0, Idle for 0.0 secs, lifeTime=26.3 secs>, device=IBSimDeviceTypeiPad3x (865E7291-E467-4E8D-B535-D64F43A57F15, iOS 17.4, Shutdown), idiom=<IBIPhoneIdiom: 0x6000028b8000>
Posted
by Scorpius.
Last updated
.
Post not yet marked as solved
1 Replies
147 Views
I created a prototype app with Reality Composer on an iPad. Now I would like to import the project to a Mac for further development using Xcode/Swift. How can I do this? I am able to export a .reality or .usdz file. If I open the .reality file in Xcode I just get the playback app/scene but it does not appear to be a project that I can edit.
Posted
by robodizi.
Last updated
.
Post not yet marked as solved
1 Replies
141 Views
Hi, I just got my new iPad Pro 11-inch, M4. I'm trying to hook up with Xcode 15.4 (latest) and got this error message. Previous preparation error: The developer disk image could not be mounted on this device.. Error mounting image: 0xe8000105 (kAMDMobileImageMounterTATSUDeclinedAuthorization: The server declined to authorize this image on this device for this user.) Has anyone experienced the same problem? any ideas? I've tried all sorts of things suggested online (including completely reinstalling Xcode and the iPad - Clearing trusted computers - restarting everything etc.)
Posted
by pungme.
Last updated
.
Post not yet marked as solved
0 Replies
76 Views
Hi community: I'm trying to replace it with drag-and-drop images in assets. I know for example that by adding a suffix @2 and @3, you can drag and drop and Xcode knows where they must be. Also, I remember that it could be possible to add a suffix like ~dark or ~light. There's no official documentation about it but I'm looking a way to drag and drop and autodetect assets per language. I've tried: image_es@fr.png image_fr@2x.png image_fr@3x.png But doesn't work. Any ideas where I can find the docs? Or can someone provide documentation about it? Thanks in advance.
Posted
by JesusMG.
Last updated
.