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

Xcode Documentation

Post

Replies

Boosts

Views

Activity

App Groups: How to use group. prefix and Team ID prefix for Multiplatform apps?
Hi there, I have a Multiplatform app with just one app target with an iPhone, iPad and Мас Destination. On the Mac my app is a developer singed App that is being distributed outside of the Mac App Store. I want to use App Groups, but as long as there are multiple destinations, Xcode only allows Group Identifiers starting with group.. However, for macOS I need to have a group ID that starts with the TeamID as explained here. So I created two separate entitlements, which are identical, but with different group IDs: With Automatic Code Signing enabled, I get this warning: Xcode still seems thinks it has to use the macOS Group ID for the iOS version. In the App Groups section, the mac Group ID is red and the iOS Group ID is not checked. The app builds and runs without issues on all platforms. The App Store Connect validation (for the iOS version) also works without any errors. Am I doing something wrong? Do I need a separate Mac target because Xcode does not support separate Group IDs for Multiplatform apps?
2
1
194
3w
CreateML for Image recognition with a spreadsheet catalog
I want to use createML to generate an image recognition model. This works when I put the images in separate sub-folders. But my data consists of many images in one folder with a spreadsheet index of the photos according to several different attributes. I suppose I could write a script to move the images into the correct folders, and repeat this for each of the attributes. But I was hoping there’s a way of doing this directly in createML since I’m sure it’s a common requirement. Anyone know if createML can do this or does anyone know of an app that would save me writing the script?
3
0
192
Oct ’24
没法删除语言
只能在string catalog里面添加语言,不能删除语言??这是什么设计? 在Project里面删除语言,并不能删除Localizable中的语言。但是如果这个语言没有任何国际化,是可以的。 也就是说,删不了曾经做过国际化的语言。 我应用还没发布,还在开发呢,为什么不让我删除语言??????????????????????????、
1
0
98
3w
Profile doesn't include the selected signing certificate
Hello, I have tried both automatic signing and manual signing, and still when I submit I get an error message that says "Provisioning profile failed qualification" and "Profile doesn't include the selected signing certificate.". Everything had been working fine, but I think it may have broken with an Xcode update - not sure. Please let me know what to look for. I appreciate any help you can give me.
1
0
123
3w
Xcode basics
I am trying to learn Xcode with C as a start to learning to program. So far I have not gotten Xcode to successfully build and run a program using C on Mac OS. Any recommendations on basic troubleshooting for Xcode setup and orientation. Every program I try to run says "Build failed".
6
0
177
3w
Transition to Apple Silicon Mac
I am currently developing on an Intel Mac and am thinking about switching to an Apple Silicon-equipped Mac soon. When I searched the web, I found that a very complicated migration process would be required, but what exactly would be required? Thank you for your response.
1
0
65
3w
Widget is not configurable on iOS 16
I created an Intent-based widget for my iOS app. The deployment target is iOS 16, but I stick to Intent vs AppIntent because I don't like how the configuration list pops up vs the list with search in the old API. So, the configuration works fine on iOS 17/18, but iOS 16 shows the error "unable to load" or just a blank view. This is how it looks on iOS 17/18 I don't see any specific errors in a console or warnings.
2
2
167
Oct ’24
Is it possible to include source code from an app extension in a framework?
If I have an XCode project that generates a framework when built, then I've noticed that its possible to add new additional targets to the project of type app extension. However if I add some source code to an app extension and regenerate the framework, then that source code is not accessable from the resulting framework (i.e. if the framework is included into an app, then the app code doesn't have visibility of the code that was added to the extension in the framework). Is this something which is possible to achieve? Ideally I would like to package the main source code that constitutes the framework content, along with the source code for a few extensions into a single framework, so that the app(s) that use the framework can include the framework into their main app target and also include it in the app extension target. I noticed that if the scheme of the framework is changed to the extension before building, then the result is not a .framework file but a .appex file. For client apps of the framework, can they directly include/use that .appex file? If so how can that be achieved? Does
1
0
132
3w
'Expand macro' menu option does nothing
I somehow broke my Xcode, it does not expand macros anymore. What I have tried: create new project clean the project remove derived data remove contents of ~/Library/org.swift.swiftpm/security What I have not tried: remove Xcode completely and re-install it (will have to re-setup everything, so don't want to resort to it) Xcode version is 16.1. The 'Add File' button has everything grayed-out, so I can't upload a video here, and 'YouTube' website is not a valid URL here for some reason. Has anyone else faced a similar problem?
1
0
98
3w
Is it possible to change the Xcode template type?
I've got a few years old app which was created using an Xcode template type of app. I'd like to split the model part of the code (model as in model-view-controller) out into a framework. Removed the view/controller source files to leave the model code is quick and easy, however the model code is large and complex with a couple of hundred of source files. Rather than create a new Xcode template type of framework and move the source files into there, is it possible to simply just change the template type of the existing project from app to framework?
1
0
114
3w
When application merges libswift_concurrency.dylib is duplicated in app binary
Environment: Xcode 16.1 Swift version: 6.0.2 Inside of an Xcode project, if I declare a framework and an application. The framework is mergeable and the application merges the framework by configuring MERGE_BINARY_TYPE to Manual (or automatic it's independent). If SWIFT_VERSION is set to 6.0.X and deployment target is set to iOS 15< the build is going to fail because of this error Duplicate linked dylib '@rpath/libswift_Concurrency.dylib' in '/Users/**/Library/Developer/Xcode/DerivedData/GSPackage-dvnngsrgctfovgfbvwdlsscfycyq/Build/Products/Debug-iphonesimulator/DummyApp.app/DummyApp.debug.dylib' If I'm checking the generated artifact and inspect all of it's @rpath with otool it's giving me the following: otool -L /Users/****/Library/Developer/Xcode/DerivedData/Dummy-gbccsjwxeajftsafghxzaqksgfim/Build/Products/Debug-iphonesimulator/Dummy.app/Dummy.debug.dylib | grep @rpath @rpath/Dummy.debug.dylib (compatibility version 0.0.0, current version 0.0.0) @rpath/libswift_Concurrency.dylib (compatibility version 1.0.0, current version 0.0.0, weak) @rpath/libswift_Concurrency.dylib (compatibility version 1.0.0, current version 0.0.0, weak) A radar is already opened with the ID: FB15693702
0
0
153
3w
WidgetKit with SwiftData on macOS
Xcode: 16.1 macOS: Sequoia When I run widget preview, I got the following errors CoreData: error: Store failed to load. <NSPersistentStoreDescription: 0x156237310> (type: SQLite, url: file:///Users/user/Library/Group%20Containers/group.com.app.name/Library/Application%20Support/default.store) with error = Error Domain=NSCocoaErrorDomain Code=256 "The file couldn’t be opened." UserInfo={reason=Unknown failure to access file: 1} with userInfo { reason = "Unknown failure to access file: 1"; } Unresolved error loading container Error Domain=NSCocoaErrorDomain Code=256 "The file couldn’t be opened." UserInfo={reason=Unknown failure to access file: 1} with this code let sharedModelContainer: ModelContainer = { let schema = Schema([Company.self, Person.self]) do { return try ModelContainer(for: schema, configurations: [.init(isStoredInMemoryOnly: false)]) } catch { fatalError("error: \(error)") } }() Does anyone know why this happens and how to fix this?
5
0
231
Oct ’24
macOS Sequoia doesn't respect Full Disk Access for UITests-Runner
We develop and test App for macOS. We start to see system alert - "UlTests-Runner" would like to access data from other apps on each UITest run. Our test suite does cleanup of files generated by App so we need access outside of UITests-Runner sandbox. We enabled Full Disk Access for UITests-Runner at Settings -> Privacy & Security -> Full Disk Access but unfortunately still see this alert. Is there any way to permanently remove/hide this alert or remove sandbox for 'UITests-Runner' since we want to run tests on CI and having this alert is not an option? Note: everything works fine on previous versions of macOS. Environment: macOS - 15.1 (24B83) Xcode - Version 16.1 (16B40)
0
1
164
3w
Localization Issue with Multiple Build Targets in Xcode - One Target Not Recognizing Localizable.strings File
Hello Apple Developer Community, I'm experiencing an issue with localization in my Xcode project that has two build targets, "Build X" and "Build Y." Both targets are set up to support the same language, but they each have slightly different wording, which is why I've created separate Localizable.strings files for each build target. Here's an overview of my setup: Project Structure I have a Localizable folder with two subfolders: Localizable/OrdnerX/Localizable.strings (for Build X) Localizable/OrdnerY/Localizable.strings (for Build Y) Configuration In the File Inspector, I’ve assigned each Localizable.strings file to its corresponding build target: OrdnerX/Localizable.strings is linked to Build X OrdnerY/Localizable.strings is linked to Build Y Under Build Phases, I verified that each build target references the correct Localizable.strings file. The paths are all correctly set, so each target should know where to find its respective localization file. Problem When I build and run Build X, everything works perfectly. The app displays the correct localized strings from OrdnerX/Localizable.strings. However, when I switch to Build Y, the app fails to find the localized strings from OrdnerY/Localizable.strings, and I’m left with placeholder text instead. I’ve double-checked the configurations for both build targets multiple times, and they appear identical. The Localizable.strings files for both targets are configured in exactly the same way, but Build Y just doesn’t seem to recognize its assigned localization file. Has anyone encountered a similar issue, or can anyone suggest potential fixes? I’d appreciate any advice on what might be causing this discrepancy. Thank you in advance!
0
0
80
3w
StoreKit Testing with different Country Codes
I am writing unit tests that change the country by setting the .storefront property of SKTestSession to different country codes. I have made sure that the country codes I am using are indeed valid based on ISO 3166-1 alpha-3 region code standards. My default storefront in the StoreKit Configuration file is "USA" but in the unit test, I set it to say "IND" and it runs my test. In the production code, when I print await Storefront.current?.countryCode, I indeed get "IND" as expected. Now when I change the value to say "RUS" by assigning it to the SKTestSession instance, the printed value in production code is still "IND" from the previous assignment. If I call .resetToDefaultState() on the session after first test passes with "IND", it defaults to "USA" but when I set it to "RUS" in my test after it, it stays on "USA". Basically the value does not change after the first change and calling reset resets it to configuration file default but reassigning a new value has no effect on Storefront. What am I doing wrong? Btw, I have tested with both XCTest and Swift Testing but the testing framework has nothing to do with this issue. I am on Xcode 16, macOS 15, Swift 6
3
0
337
Sep ’24