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.
Xcode
RSS for tagBuild, test, and submit your app using Xcode, Apple's integrated development environment.
Posts under Xcode tag
201 Posts
Sort by:
Post
Replies
Boosts
Views
Activity
I've recently upgraded to Xcode 16 and noticed a change in how the Tab key functions during autocomplete.
(not-replied-but-closed post: https://discussions.apple.com/thread/255762888)
Previously, pressing Tab would extend the typed text up to the first point of choice.
For example, we have two classes: NSViewController and NSViewCoordinator
BEFORE, typing: "NSV" + Tab used to complete to NSViewCo
Now, in Xcode 16, pressing Tab selects the first suggestion by default, instead of completing up to the choice point.
That is very inconvenient because very often I want just see all possible cases with some prefix...without need of typing all prefix manually.
Seems there is no way to restore the previous behavior and that looks very very sad.
I have reverse engineered Xcode 16...and what I get?
They just install new CodeCompletion handler instead of old one without any chance to configure this behaviour by settings or UserDefaults =\
Hope this thread would raise votes and attract Xcode devs here
I am encountering the following issue while working with app group preferences in my Safari web extension:
Couldn't read values in CFPrefsPlistSource<0x3034e7f80> (Domain: [MyAppGroup], User: kCFPreferencesAnyUser, ByHost: Yes, Container: (null), Contents Need Refresh: Yes): Using kCFPreferencesAnyUser with a container is only allowed for System Containers, detaching from cfprefsd.
I am trying to read/write shared preferences using UserDefaults with an App Group but keep running into this error. Any guidance on how to resolve this would be greatly appreciated!
Has anyone encountered this before? How can I properly configure my app group preferences to avoid this issue?
I have static libraries and headers of a C++ project that I believe are correctly built for iOS and iOS Simulator destinations. The C++ project is built via CMake with something like:
cmake dirName \
-G "Unix Makefiles" \
-B buildDir \
-DCMAKE_INSTALL_PREFIX=installDir \
-DCMAKE_SYSTEM_NAME=iOS \
-DCMAKE_SYSTEM_PROCESSOR=arm64 \
-DCMAKE_OSX_ARCHITECTURES=arm64 \
-DCMAKE_OSX_SYSROOT=$(xcrun --sdk iphonesimulator --show-sdk-path) \
-DCMAKE_OSX_DEPLOYMENT_TARGET=15.0
...
cmake --build buildDir --config Release --target install
I believe those are all the important parameters. This gives me a static library (.a) and headers that I believe should be compatible with arm64 iOS simulators, and I do this same thing for x86_64 architecture with simulators and for actual iOS non-simulator via the iphoneos SDK path.
I'm pretty sure this gives me the correct static lib and headers. Let's assume it does because I'm not able actually create the XCFramework to know if they're right. This does work with a macOS lib and headers, but I need iOS for this library. How do I package this into an XCFramework now?
This Apple developer articles says I should be a able to create an xcframework via xcodebuild -create-xcframework -library libName.a -headers include but when I try to do this with my my iOS arm64 simulator static lib I get:
error: binaries with multiple platforms are not supported '/Users/.../install/ios-arm64-simulator/libName.a
But, when I run: lips -info libName.a I get Non-fat file libName.a is architecture arm64, so, I'm not sure what to do here. Trying to extract arm64 from that static library also produces an error as it it is just an arm64 lib.
I'm not really sure what's going on, but from reading online this specific command, xcodebuild -create-xcframework is a consistent pain point in the process of trying to get an XCFramework, and the seemingly only workaround is to archive a framework project and then create the xcframework via xcodebuild -create-xcframework -archive MyFramework.xcarchive -framework[or -library].
However, how am I supposed to get this static lib and headers into a suitable xcodeproj so that I can archive it correctly? Everytime I try to copy the headers and static lib into the Framework xcodeproj and set what I believe are all the correct settings, my .xcarchive is always empty.
Does anyone have any advice here on how to get this to work?
The main impetus for trying to get this C++ static lib and headers into an XCFramework as that seems like the only valid way to link a 3rd party C++ lib to an SPM package and have the C++ package be interfaceable with Swift.
Hey everyone! Totally a newbe question here but cant find the answer anywhere when searching so figured I would just post. Trying to create my first SwiftUI app in Xcode and wanted to create a simple launch screen with an image file, and a text label. however when I select the launch screen in the Project settings it lets me pick it, but then when i navigate away it never saves the value.
Then when I go somewhere else and come back its blank again... Any thoughts?
XCode 16.2
ReferenceError: ReadableStream is not defined
at Object. (/Users/anaadmin/Documents/AnaNewApp/node_modules/@expo/cli/node_modules/undici/lib/web/fetch/response.js:528:3)
at Module._compile (node:internal/modules/cjs/loader:1198:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
at Module.load (node:internal/modules/cjs/loader:1076:32)
at Function.Module._load (node:internal/modules/cjs/loader:911:12)
at Module.require (node:internal/modules/cjs/loader:1100:19)
at require (node:internal/modules/cjs/helpers:119:18)
at Object. (/Users/anaadmin/Documents/AnaNewApp/node_modules/@expo/cli/node_modules/undici/lib/web/fetch/index.js:11:5)
at Module._compile (node:internal/modules/cjs/loader:1198:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1252:10)
After trying out all suggestions and different versions of tools such as XCode, nvm, yarn, node, etc., nothing works for me
i added :
<PROJECT_PATH>/node_modules/@langchain/core/dist/utils/stream.cjs - add const { ReadableStream } = require("web-streams-polyfill");
npm install web-streams-polyfill
Tried downgrading to Node 18 as well as various polyfills but haven't been able to get it to work
Following does not work in xcode
Delete your Podfile.lock (I like to use the command '-rm -rf Podfile.lock' on the terminal for this)
Delete your Pods folder (I like to use the command '-rm -rf Pods' in the terminal for this)
Delete your .xcworkspace
Pod install
Clear your project into XCode> Product> Clean Build Folder
i have tried
cd ios
pod install
Continuously i am getting same error.
Any one know, how to resolve this error
I have a SwiftUI project which has the following hierarchy:
IOSSceneDelegate (App target) - depends on EntryPoint and Presentation static libs.
Presentation (Static library) - Depends on EntryPoint static lib. Contains UI related logic and updates the UI after querying the data layer.
EntryPoint (Static library) - Contains the entry point, AppDelegate (for its lifecycle aspects) etc.
I've only listed the relevant targets here.
SceneDelegate was initially present in EntryPoint library, because the AppDelegate references it when a scene is created.
public func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
// Set the SceneDelegate dynamically
let sceneConfig: UISceneConfiguration = UISceneConfiguration(name: "mainWindow", sessionRole: connectingSceneSession.role)
sceneConfig.delegateClass = SceneDelegate.self
return sceneConfig
}
The intent is to move the SceneDelegate to the Presentation library.
When moved, the EntryPoint library fails to compile because it's referencing the SceneDelegate (as shown above).
To remove this reference, I tried to set up the SceneDelegate in the old way - In the info.plist file, mention a SceneConfiguration and set the SceneDelegate in Presentation.
// In the Info.plist file
<key>UIApplicationSceneManifest</key>
<dict>
<key>UIApplicationSupportsMultipleScenes</key>
<true/>
<key>UISceneConfigurations</key>
<dict>
<key>UIWindowSceneSessionRoleApplication</key>
<array>
<dict>
<key>UISceneConfigurationName</key>
<string>Default Configuration</string>
<key>UISceneDelegateClassName</key>
<string>Presentation.SceneDelegate</string>
</dict>
</array>
</dict>
</dict>
// In the AppDelegate
public func application(_ application: UIApplication, configurationForConnecting connectingSceneSession: UISceneSession, options: UIScene.ConnectionOptions) -> UISceneConfiguration {
// Refer to a static UISceneconfiguration listed in the info.plist file
return UISceneConfiguration(name: "Default Configuration", sessionRole: connectingSceneSession.role)
}
As shown above, the Presentation.SceneDelegate is referred in the Info.plist file and the reference is removed from the AppDelegate (in EntryPoint library).
The app target compiles, but when I run it, the SceneDelegate is not invoked. None of the methods from the SceneDelegate (scene(_:willConnectTo:options:), sceneDidDisconnect(_:), sceneDidEnterBackground(_:) etc.) are invoked. I only get the AppDelegate logs.
It seems like the Configuration is ignored because it was incorrect. Any thoughts? Is it possible to move the SceneDelegate in this situation?
Hey, I am building some widgets and I'm quite surprised that Swipe gestures for widgets is not supported. It means the user must sacrifice home screen real estate to view multiple widgets to receive the same information. Ideally, swiping left / right inside of the widget should give a developer access to present different views.
I realize that it means that a user would need to swipe outside of the widget, (or swipe to the beginning/end of the series of views inside of the widget) for the page to swipe, but I'd argue that this is the intuitive behavior of what widget scrollview would or should look like anyway.
Hello guys,
I have a question regarding the submission requirements. My app uses ARKit and requires Metal files for shaders, which are not supported by Swift Playgrounds. Therefore, I developed my app using Xcode.
(swift playgrounds returning error for metal file)
Since my app relies on a real device for proper functionality, I would like to know if, under these circumstances, the scene build is performed by Xcode. If the build were instead done by Swift Playgrounds, my scene would not function correctly.
I'm asking that because of this note
Thank you for your time and assistance.
Hi all, reposting from here:
https://unix.stackexchange.com/questions/789849/xattr-c-not-removing-com-apple-finderinfo-attribute
I was trying to build my Xcode project, but ran into the error "resource fork, Finder information, or similar detritus not allowed." I was following the solutions from this stack exchange post, but xattr seems to not be working as expected.
Basically, running xattr -cr . on my project directory successfully removes all xattrs except for com.apple.FinderInfo, which persists on all .xcodeproj and .xcworkspace files. I've tried everything under the sun, from xattr -d to sudo to dot_clean to tar to rsync and nothing can remove it. Is this just some kind of immortal attribute? It's preventing me from building my project. I'm at a loss here, this is my senior thesis project.
Hi all, reposting this from here:
https://unix.stackexchange.com/questions/789849/xattr-c-not-removing-com-apple-finderinfo-attribute
I came to this problem because my Xcode project was failing to build due to the error "resource fork, Finder information, or similar detritus not allowed" (was trying the solutions on this post).
Basically, running xattr -cr . in the terminal on my project directory removes all extended attributes except com.apple.FinderInfo, which stays on all .xcodeproj and .xcworkspace files. I've tried everything under the sun, from sudo to xattr -d to dot_clean to tar to rsync and nothing works. Is this just an immortal attribute that can never be removed? I'm truly at a loss here, this is for my senior thesis project.
I was just filling the submission for the swift student challenge and there is a note below adding the zip file saying
Note: Xcode app playgrounds are run in Simulator.
Now my xcode app playground(.swiftpm) is an AR app and needs an ipad or an iphone to run . So will my submission still be eligible for assessment and checked on ipad???
I created a data structure based on a dictionary of words. The purpose is to link each word to all other words made up of the same letters plus one.
Example: table -> ablate, cablet, tabled, gablet, albeit, albite, etc.
For this I built a data model made of three entities: Word, Draw, Link.
A Draw is a set of letters corresponding to a Word and sorted in alphabetic order, like : HOUSE -> EHOSU. A Link is a letter that you add to a Draw to get another Draw.
So my data model looks like this:
And here is how I implemented it in Xcode:
Entity Word
(let's forget the attribute optComp that plays no role here)
Entity Draw
Entity Link
I am populating the data in two steps:
first I read a list of words from a .txt source and I populate the Word entity and at the same time the Draw entity with the corresponding relationship (function loadDic())
This first step apparently works fine. I can easily find all anagrams of any word with something like word.sort.word.spelling
I read through the Draw entity. For each draw I seek all existing +1 draws considering each letter of the alphabet. If there are, I create a Link and add the relationships (function createLinks())
Here is where something goes wrong. If the Link's and the relationship Draw.plus seem to be correctly created, the other relationship Link.gives is only partially populated, say 50%.
Moreover, I tried to apply an additional routine (updateLinks()) , focusing only on Link's with an empty Link.gives relationship and updating them. But again, only 50% of the nil relationships appear to be populated.
I could not find out why those relationships are not properly populated. If someone can help me out I would be grateful.
Here is the code:
LoadDic() function (OK) :
func loadDic() {
print("Loading dictionary...")
dataAlreadyLoaded.toggle()
guard let url = Bundle.main.url(forResource: INPUT_FILE, withExtension: "txt") else {
fatalError("\(INPUT_FILE).txt not found")
}
if let dico = try? String(contentsOf: url, encoding: String.Encoding.utf8 ) {
let lines = dico.split(separator: "\r\n")
for line in lines {
let lineArray = line.split(separator: " ")
print("\(lineArray[0])") // word
let wordSorted = String(lineArray[0].sorted())
let draw = getDraw(drawLetters: wordSorted) ?? addDraw(drawLetters: wordSorted) // look if draw already exists, otherwise create new one.
let wordItem = Word(context: viewContext) // create word entry with to-one-relationship to draw
wordItem.spelling = String(lineArray[0])
wordItem.optComp = (Int(String(lineArray[1])) == 1)
wordItem.sort = draw
do {
try viewContext.save()
} catch {
print("Errort saving ods9: \(error)")
}
}
}
print("Ods Chargé")
}
func addDraw(drawLetters: String) -> Draw {
let newDraw = Draw(context: viewContext)
newDraw.draw = drawLetters
return(newDraw)
}
func getDraw(drawLetters: String) -> Draw? {
let request: NSFetchRequest<Draw> = Draw.fetchRequest()
request.entity = Draw.entity()
request.predicate = NSPredicate(format: "draw == %@", drawLetters)
do {
let drw = try viewContext.fetch(request)
return drw.isEmpty ? nil : drw[0]
} catch {
print("Erreur recherche Tirage")
return nil
}
}
createLinks() function (NOK):
func createLinks() {
var erreur = " fetch request <Draw>"
let request: NSFetchRequest<Draw> = Draw.fetchRequest()
request.entity = Draw.entity()
request.predicate = NSPredicate(value: true)
print("Building relationships...")
do {
let draws = try viewContext.fetch(request)
count = draws.count
for draw in draws {
print("\(count) - \(draw.draw!)")
linkTable.removeAll()
for letter in ALPHABET {
print(letter)
let drawLettersPlus = String((draw.draw! + String(letter)).sorted()) // draw with one more letter
if let drawPlus = draws.first(where: { $0.draw == drawLettersPlus }) { // look for Draw entity that matches augmented draw
let linkItem = Link(context: viewContext) // if found, create new link based on letter with relationship to augmented draw
linkItem.letter = String(letter)
linkItem.gives = drawPlus
erreur = " saving \(draw.draw!) + \(letter)"
try viewContext.save()
linkTable.append(linkItem) // saves link to populate the one-to-many relationship of the initial draw, once the alphabet is through
}
}
let drawUpdate = draw as NSManagedObject // populate the one-to-many relationship of the initial draw
let linkSet = Set(linkTable) as NSSet
drawUpdate.setValue(linkSet, forKey: "plus")
erreur = " saving \(draw.draw!) links plus"
try viewContext.save()
count -= 1 // next draw
}
} catch {
print("Error " + erreur)
}
print("Graph completed")
}
updateLinks function (NOK):
func updateLinks() {
var erreur = "fetch request <Link>"
let request: NSFetchRequest<Link> = Link.fetchRequest()
request.entity = Link.entity()
print("Running patch...")
do {
request.predicate = NSPredicate(format: "gives == nil")
let links = try viewContext.fetch(request)
for link in links {
let baseDraw = link.back!.draw!
print("\(baseDraw) \(link.letter!)")
let augmDrawLetters = String((baseDraw + link.letter!).sorted())
if let augmDraw = getDraw(drawLetters: augmDrawLetters) {
viewContext.perform {
let updateLink = link as NSManagedObject
updateLink.setValue(augmDraw, forKey: "gives")
erreur = " saving \(augmDraw.draw!) \(link.letter!)"
do {
try viewContext.save()
} catch {
print("Erreur mise à jour lien")
}
}
}
}
} catch {
print("Error " + erreur)
}
}
RESULT
And this is the output showing the content of the Draw entity with relationships after createLinks() is applied:
And here after updateLinks() is applied :
I'm trying to set up Xcode Cloud for the first time. When I go through the "Get Started" flow and get to "Grant Access to Your Source Code" step, when I click the "Grant Access" button, I get "This Operation Could Not Be Completed."
It has the correct URL to my Github repo.
Github is working fine in Xcode itself: I can push and pull changes and view repo history.
I've tried:
restarting Xcode
rebooting the Mac
Removing the Github account from Xcode and adding it back
Creating a new Github personal token and removing the Github account from Xcode and using the new token to add it back
I've looked through my Github settings and don't see anything that might cause an issue.
I filed FB16511549 to report this. The error dialog in Xcode automatically filled the feedback fields, and says:
"API Invalid status code: 500. XcodeCloudCombineAPI.XCCResponseError:1"
I'm running Xcode 16.2 (16C5032a) on an M4 MacBook Pro running Sequoia 15.3.1 (24D70).
Does anyone have any insights or ideas of other things to try?
Thanks.
I'm trying to add Assets.xcassets to a .swiftpm project, but I'm getting the warning:
⚠️ Ignoring duplicate build file in build source build phase
(Just to know, that is about developing in XCODE, in Swift Playgrounds does not appear it, even in this second being harder to setting up)
The problem is that there are no “Build Phases” in XCODE to remove duplicate files manually.
I've already tried adding the path of Assets.xcassets in the resources property of Package.swift, like:
.executableTarget(
name: "AppModule",
path: ".",
resources: [
.process("Assets.xcassets")
]
)
Even so, the warning persists. Does anyone know how to solve this? Is there any way to remove duplicate references or force a cleanup of the Swift Package Manager cache to fix it?
I appreciate any tips! 🙏🚀
I am setting up a new app and am having problems with Xcode Cloud. From Xcode if I click on the "Cloud" button under the Report Navigator I get a spinner for a long time then get the message "Could not load Xcode Cloud data". I also visited the "Xcode Cloud" tab under my app in App Store Connect and I get a spinner and nothing loads.
This is a recent account and I'm setting up Xcode Cloud for the first time. Below is what I've tried and I'm out of ideas on how to get this working.
In Xcode, I signed out and back in as the Account Holder
Closed Xcode and reopened
This occurred yesterday and today and have not seen a problem under the Apple System Status page
On the latest Xcode 16.2
Checked the Signing & Capabilities tab in Xcode and my team a bundle Id is correct and it's happy with signing. At this time on my machine I am using the distribution profile.
Hi Team,
I have created multiple certificates for macOS application. Below are the certificates created-
Apple Development Certificate
DeveloperID Installer Certificate
Apple Distribution Certificate
others certificates
Later, I have imported the all these above certificates in keychain-access.
Now, I tried to compile the code through Xcode. I am getting error for code signing certificate.
Warning: unable to build chain to self-signed root for signer "Apple Development: Amit (M2WMF2YERI)”
....
Command CodeSign failed with a nonzero exit code
When I checked the TeamID of User(Amit) I can see that his current TeamID is [P8ZW3W9R2Q].
There is mismatch of teamID in apple development certificate generation.
Note-
All certificates are generated with current TeamID[P8ZW3W9R2Q] of user (Amit) except Apple Development certificate which has been generated with TeamID [M2WMF2YERI] which is generated with old TeamID of user (Amit).
I attempted to generate the apple development certificate multiple times but it is getting generated with old TeamID TeamID[M2WMF2YERI] of user(Amit)
Summary-
While creating a developer certificate using apple developer account and mapping it in keychain, the certificate is being generated with old apple account details (Inactive) instead of the current one. This is causing issues when using the certificate in keychain.
If anyone has encountered this issue, how it was resolved?
Thanks
Hey, I am developing my app in Swift using Xcode for iOS 16 or later.
I want to implement the navigation behavior found in apps like WhatsApp or Instagram, where navigating from the feed to a user's profile keeps the tab bar visible. Then, when opening a chat from the profile, a new view appears, leaving the profile view behind along with the tab bar.
I have this code as a base to achieve this, but when navigating from View 1 to View 2, it applies the effect that should only happen in View 3. I haven't been able to prevent View 2 from using this effect and limit it only to View 3.
Can anyone help me???
import SwiftUI
struct ContentView: View {
@State private var path: [String] = [] // Controls the navigation stack in View1
var body: some View {
NavigationStack(path: $path) {
TabView {
View1(path: $path)
.tabItem {
Label("View 1", systemImage: "1.circle")
}
View4()
.tabItem {
Label("View 4", systemImage: "4.circle")
}
}
.navigationDestination(for: String.self) { value in
if value == "View3" {
View3(path: $path) // View3 outside the TabView
}
}
}
}
}
struct View1: View {
@Binding var path: [String]
var body: some View {
VStack {
Text("View 1 with TabBar")
Button("Go to View 2") {
path.append("View2") // Adds View2 to the stack
}
}
.navigationDestination(for: String.self) { value in
if value == "View2" {
View2(path: $path)
}
}
}
}
struct View2: View {
@Binding var path: [String]
var body: some View {
VStack {
Text("View 2 with TabBar")
Button("Go to View 3 (Without TabBar)") {
path.append("View3") // Adds View3 to the stack
}
}
}
}
struct View3: View {
@Binding var path: [String]
var body: some View {
VStack {
Text("View 3 without TabBar")
.font(.largeTitle)
.padding()
Button("Go Back") {
path.removeLast() // Returns to View2
}
}
}
}
struct View4: View {
var body: some View {
Text("View 4 with TabBar")
}
}
I had a standalone python application (created with pyinstaller) which was working perfectly alone. This macOS application was created in VS. I later decided to improve the application by implementing some Swift features (Subscription Manager). This required me to write a brief Swift file (Subscription Management) in XCode which the Python file called on.
Python Standalone Application Calling Swift :
# Function to check if the user has a valid subscription
def check_subscription():
subscription_manager_path = "/Users/isseyyohannes/Library/Developer/Xcode/DerivedData/SubscriptionManager2-ezwjnnjruizvamaesqighyoxljmy/Build/Products/Debug/SubscriptionManager2" # Adjust path
try:
result = subprocess.run([subscription_manager_path], capture_output=True, text=True, check=True)
return "VALID_SUBSCRIPTION" in result.stdout # Return True if valid, False otherwise
except subprocess.CalledProcessError as e:
print(f"Error checking subscription: {e}")
return False # Return False if there's an issue
However, when I try to run xcrun altool --validate-app ... I get the following error message.
The error reads as follows
Running altool at path '/Applications/Xcode.app/Contents/SharedFrameworks/ContentDeliveryServices.framework/Frameworks/AppStoreService.framework/Support/altool'...
2025-02-16 11:02:21.089 *** Error: Validation failed for '/Users/isseyyohannes/Desktop/ALGORA Performance.app'.
2025-02-16 11:02:21.089 *** Error: Could not find the main bundle or the Info.plist is missing a CFBundleIdentifier in ‘/Users/isseyyohannes/Desktop/ALGORA Performance.app’. Unable to validate your application. (-21017)
{
NSLocalizedDescription = "Could not find the main bundle or the Info.plist is missing a CFBundleIdentifier in \U2018/Users/isseyyohannes/Desktop/ALGORA Performance.app\U2019.";
NSLocalizedFailureReason = "Unable to validate your application.";
I located the Info.plist file which had everything correct (my Bundle ID, etc.) for the python file. I am successfully able to notarize the application, just having issues submitting it.
**It is worth noting I currently have a python executable calling on a file written in swift code and created in xcode.
I created the python application with the following command on VS.
pyinstaller --onefile --noconsole \
--icon="/Users/isseyyohannes/Downloads/E0BWowfbDkzEiEAckjsHAsYMzpdjjttT.icns" \
--codesign-identity "Developer ID Application: Issey Yohannes (GL5BCCW69X)" \
--add-binary="/Users/isseyyohannes/Library/Developer/Xcode/DerivedData/SubscriptionManager2-ezwjnnjruizvamaesqighyoxljmy/Build/Products/Debug/SubscriptionManager2:." \
--osx-bundle-identifier com.algora1 \
/Users/isseyyohannes/Desktop/ALGORA\ Performance.py
Note : All steps on Apple Developer site are done (ex. Creating identifier, secret password etc)
I have a sample SwiftUI iOS app. As shown in the screenshot below, my project has three configurations: Debug, MyDebug, Release.
If I select the Debug or MyDebug scheme, I get a preview. But if I select the Release scheme, I get an error that says the following.
”***.app” needs -Onone Swift optimization level to use previews (current setting is -O)
, where *** is the app name.
It probably has nothing to do with the Preview error, but the Info.plist has a dictionary such that the key name is devMode, and the value is $(DEVMODE). And I have a user-defined setting as shown below.
My ContentView has the following.
import SwiftUI
struct ContentView: View {
@State private var state: String = ""
var body: some View {
VStack {
Text("Hello, world!: \(state)")
}
.onAppear {
if let devMode = Bundle.main.object(forInfoDictionaryKey: "devMode") as? String {
print("Development mode: \(devMode)")
state = devMode
}
if let path = Bundle.main.path(forResource: "Info", ofType: "plist") {
if let dict = NSDictionary(contentsOfFile: path) {
print("**** \(dict)")
}
}
#if DEBUG
print("Debug")
#elseif MYDEBUG
print("MyDebug")
#else
print("Que?")
#endif
}
}
}
#Preview {
ContentView()
}
So my question is how I get the preview for all three build schemes? Muchos thankos.