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

Xcode Documentation

Post

Replies

Boosts

Views

Activity

Asset Symbol Generation - color and image accessors for Asset Catalogs
Hey, in Xcode 16's release notes there is this: Asset catalogs now provide an inspector property for enabling system color and image accessors for generated asset symbols, which allows Swift packages to opt-in to generating these accessors. (113704993) What exactly does this mean? Can we make the generated asset symbols public, so that we can share assets between local swift packages in the project? Unfortunately, I don't see this option in the inspector. I only see "Asset Symbols > Extensions On/Off". Not sure what that means, either. Thanks
0
1
125
6d
Text Don't Show in swipeActions buttons !
Hi, I have the below code and don't know why the text doesn't show fro swipe buttons just the icons show ? Kind Regards import SwiftUI struct NewView: View { var body: some View { NavigationStack { List { ForEach(1...7, id: \.self) { number in VStack { Text("Item \(number)") .padding() } .swipeActions(edge: .trailing) { Button(role: .destructive) { withAnimation { deletePatient2() } } label: { Label("Delete", systemImage: "trash.fill") } Button { deletePatient2() // toDoToEdit = item } label: { Label("Edit", systemImage: "pencil") } .tint(.orange) } } } } .listStyle(.plain) } func deletePatient2() { } } #Preview { NewView() }
3
0
128
6d
"Failed to install or launch the test runner" error
We have multiple Jenkins jobs running UI Tests on a Mac with a device attached. This works most of the time but sometimes the tests don't run and the xcreport generated has an error like: BCOVBRDCoverageUITests-Runner encountered an error in BCOVBRDCoverageUITests failed with: Failed to install or launch the test runner. (Underlying Error: Failed to create directory on device 'Brightcove's iPhone 14 Plus' (00008110-000C54912246401E) to hold runtime profiles for application with bundle ID 'com.brightcove.BCOVBRDCoverageUITests.xctrunner': (null). (Underlying Error: The system failed to get the path on the remote device for the provided domain. (Underlying Error: The connection was interrupted.))) Has anyone else run into this? Any ideas on how to get around it? Kicking off another job after seeing this behavior works fine. The failures seem to be random or we haven't noticed a pattern yet.
0
1
83
6d
How to access Test Plans launch arguments and environment in the app target during UI tests
I am able to reproduce this also in a minimal example. Here is my setup: a Hello World app and a UI test target. a Test Plan which executes the UI test target test plan configures application language as German for sanity testing whether changing the test configuration via the test plan in general works -> this works perfectly test plan configures launch arguments and Environment variables in the shared settings "Arguments passed on launch" In the ContentView of the app I try to access these values via ProcessInfo: print(ProcessInfo.processInfo.arguments) print(ProcessInfo.processInfo.environment) Now I run the test plan Expected: my custom launch arguments appear in arguments my custom env vars appear in environment Actual: none of them appear. What am I doing wrong here?
2
1
90
6d
iOS Simulator Fails to Launch .app file
I'm creating a build to use in UI automation with the following xcodebuild command: xcodebuild -scheme Test-QA \ -project $GITHUB_WORKSPACE/iosApp/Test.xcodeproj \ -sdk iphonesimulator \ -configuration ‘Debug QA’ \ -destination 'platform=iOS Simulator,name=iPhone 15,OS=latest' \ -derivedDataPath “/Users/test/build” \ clean build Installed the app using 'xcrun simctl install booted /path/appfile.app' Works fine on the original runners simulator and some other machines. However, when I try to run the .app file on the testing machine's simulator, it returns the following error: xcrun simctl launch booted com.test.app.qa An error was encountered processing the command (domain=FBSOpenApplicationServiceErrorDomain, code=1): Simulator device failed to launch com.test.app.qa. The request was denied by service delegate (SBMainWorkspace). Underlying error (domain=FBSOpenApplicationServiceErrorDomain, code=1): The request to open "com.test.app.qa" failed. The request was denied by service delegate (SBMainWorkspace). Console log : Bootstrapping failed for <FBApplicationProcess: 0x103f9ca40; app<com.test.app.qa((null))>:<invalid>> with error: <NSError: 0x600000d22010; domain: RBSRequestErrorDomain; code: 5; "Launch failed."> { NSUnderlyingError = <NSError: 0x600000d20600; domain: NSPOSIXErrorDomain; code: 1> { NSLocalizedDescription = Launchd job spawn failed; }; } Additional Details: Both machines are running the same version of Xcode 15.4 and arm64. The simulator was reset to ensure a clean state. The same error persists even after rebooting the machines. Ensured that the bundle identifier is correct. Both devices have Rosetta installed. What could be causing this error?
0
0
147
6d
Xcode 16 Beta 3 Watch App - No Simulator Runtime Version Even though Simulator is installed.
Today I installed Xcode 16 Beta 3. I have the watchOS 11 simulator installed on my Mac. When building my watch app with Xcode Beta 3 I am getting the following error. /Applications/Xcode-16-beta-3.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Library/Application Support/MessagesApplicationStub/MessagesApplicationStub.xcassets: No simulator runtime version from [<DVTBuildVersion 21F79>] available to use with iphonesimulator SDK version <DVTBuildVersion 22A5307d> I have no idea what those assets are for but they aren't part of my project. I tried generating a new standalone watch app project using Xcode 16 Beta 3 and I am getting the same error message so this isn't something particular to my original watch project. Any help on how to fix this issue is appreciated.
1
0
173
1w
AppIntents don't show up in Shortcuts app when in SPM package
Hi there, I successfully created an AppIntent for our app, and when I had it in the same target as our main app it showed up fine in the shortcuts app. Then I realized that many of the new System Control widgets introduced in iOS 18 (e.g. lockscreen, control center) live in the widget extension target, but they also need to reference that same AppIntent. So to fix this, I thought I'd migrate out the code into it's own SPM package that both the WidgetExtension and the Main App processes can reference. However, after doing that and rebuilding, the intent no longer shows up in the Shortcuts app. Furthermore, my AppShortcutsProvider class now has this error when trying to define the list of appShortcuts: App Intent <name> should be in the same target as AppShortcutsProvider Is this intended, and if so, how do we reference the same AppIntent across multiple targets?
1
0
89
1w
Can't select new build
I cannot select my newly uploaded build in app store connect for review. The UI to select a different build is just gone. I have reached out to apple and they said they are aware and fixing it but its been a week since and nothing has changed. I uploaded a build to be reviewed to app store connect, and it got rejected due to an issue with connecting to my server. I discovered the issue was that my server was using http rather than https and apple doesn't allow this. I including things in my info.plist to allow the http connection, and I think this could be what triggered this app store connect issue, but I think xCode would have told me there was info.plist issue with my build while trying to upload it so I don't know. I have since migrated my app to https and uploaded a new build and I still can't select it to be reviewed. Anyone else have any similar issues?
0
0
64
1w
How disable ~/Applications/asr auto creation
It's quite annoying (maybe it's only my personal interests). Some apps or the macOS system always create ~/Applications/asr directory and create some txt files in it. asr20240708_1638030_0.txt {"type":"asr","wp_version":"","easr_version":"e792c1d2b4b5055e56fb902dfefdb483802041cc_Thu_Dec_30_17:18:43_2021_+0800","spil_version":"","wpe_version":"","vad_version":"9db42b766a4bc4e853bfa3fd2f846bf931d6c05f_Wed_Mar_24_15:56:16_2021_+0800","header_type":0} It there any way to disable this 'useful' feature?
0
0
68
1w
Augmented Reality app unable to load the image from the camera
I have an app on the App Store for many years enabling users to post text into clouds in augmented reality. Yet last week abruptly upon installing the app on the iPhone the screen started going totally dark and a list of little comprehensible logs came up of the kind: ARSCNCompositor <0x300ad0e00>: ARSCNCompositor (0, 0) initialization failed. Matting is not set up properly. many times, then RWorldTrackingTechnique <0x106235180>: Unable to update pose [PredictorFailure] for timestamp 870.392108 ARWorldTrackingTechnique <0x106235180>: Unable to predict pose [1] for timestamp 870.392108 again several times and then: ARWorldTrackingTechnique <0x106235180>: SLAM error callback: Error Domain=Slam Error Code=7 "Non fatal error occurred due to significant drop in a IMU data" UserInfo={NSDescription=Non fatal error occurred due to significant drop in a IMU data, NSLocalizedFailureReason=SlamEngineNodeGroup Failure: IMU issue: gyro data stream verification failed [Significant data drop]. Failed on timestamp: 870.413247, Last known timestamp: 865.350198, Delta: 5.063049, System timestamp: 870.415781, Delta between system and frame: 0.002534. } and then again the pose issues several times. I hoped the new beta version would have solved the issue, but it was not the case. Unfortunately I do not know if that depends on the beta version or some other issue, given the app may be not installed on the Mac simulator.
1
0
98
1w
NSHostingView Not Working With Swift 6.0
I recently compiled my macOS App with Swift 6 in Xcode 16 (was using Swift 5 previously) and noticed that AppKit Integration doesn't appear to be working as before. All my instances of NSHostingView which allow me to add a SwiftUI View to an AppKit NSWindow view controller no longer respond to mouse input anymore. All my NSHostingView instances display but refuse to accept any user interaction. Has anyone else noticed this and is there a workaround to get NSHostingView to once again be able to accept user/mouse events with Swift 6?
4
0
183
1w