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

Xcode Documentation

Pinned Posts

Posts under Xcode tag

3,070 Posts
Sort by:
Post not yet marked as solved
1 Replies
64 Views
In order to test an iPhone app I am developing on my mac on an actual device, I connected my iPhone to my mac with a wired connection and installed the app, but got an error message saying “Uneble to verify app”. I went to Settings -> General -> VPN and Device Management -> the app in question in ENTERPRISE APP -> Verify App -> Verify, but no matter how many times I tap on it, the status of the app remains “Not verified”. If anyone has a solution to this problem, we would appreciate it if you could help us.
Posted
by Kyo_jp.
Last updated
.
Post not yet marked as solved
11 Replies
756 Views
I've reached a point where I can no longer make any progress diagnosing the issues that have popped up with Apple Watch development support. To hopefully help draw attention and focus to the severity of this problem, I'm gathering all related threads into this single thread. Summary of problems There are several, possibly related, issues at play: Xcode is not discovering Apple Watches. This means it's not possible to deploy apps to Apple Watches that aren't already provisioned with Xcode. I've confirmed this behavior with a watch running watchOS 10.0. The logging profile for watchOS has expired. It's no longer possible to pull logs via Console from Apple Watches. AppIntent-based complications on watchOS 10.5 no longer load, staying stuck in a "placeholder" state. This can be reproduced with the Backyard Birds demo app. It's no longer possible to debug widget extensions on Apple Watch hardware. Feedback submitted FB13758427: No longer able to connect to Apple Watch from Xcode I was attempting to test another regression related to AppIntents no longer working on watchOS 10.5. To confirm the behavior had regressed since earlier versions of watchOS, I set up one of my older Apple Watches that is still running watchOS 10.0. After wiping the watch and repairing it with one of my test devices (iPhone 11 Pro, iOS 17.4.1), I’m unable to get the Apple Watch to appear in Xcode’s Devices & Simulators manager. The phone is connected via USB cable, and the phone appears as a Connected phone, but the watch does not appear. My Apple Watch Ultra that I use as my daily driver does appear as a remote device (the globe icon is next to it), but the Apple Watch 10.0 does not appear. Details about the older watch: Version: 10.0 21R5341c Model: A2478 Not being able to test on other Apple Watches is severely limiting my ability to isolate and confirm the regression in AppIntent support that can be reproduced in the Backyard Birds demo app. Note that the 10.0 watch does actually appear in the Console app, but with a warning sign next to it. The 10.0 watch also appears twice. Clicking the warning sign does not reveal any information about why the warning is appearing, but after ~5 seconds I do get the following error in Console.app: “The user has not responded to the pairing request on 'Headless’ Respond to the Trust prompt on the device.” There is no trust prompt on the device. FB13756074: WatchOS logging profile is no longer valid https://developer.apple.com/bug-reporting/profiles-and-logs/?platform=watchos is no longer valid. See attached error that occurs when attempting to install the profile onto my Apple Watch Ultra. It seems that without this I’m unable to get any logs off of my Apple Watch, which is making testing/development quite difficult. FB13758450: AppIntent-based widgets no longer render on watchOS 10.5 AppIntent-based complications no longer get beyond a placeholder state on watchOS. This can be reproduced with the Backyard Birds demo app, which uses AppIntent-based widget configurations for the watchOS complications. AppIntent-based complications did appear to work in previous versions of watchOS 10, but I’m unable to confirm this with a 10.0 Watch I have due to FB13758427. To reproduce deploy the attached unmodified Backyard Birds app to a watch running watchOS 10.5. add a Backyard Birds complication to a watch face. Expected behavior: the widget shows live data Actual behavior: the complication never leaves a placeholder state. See the attached screenshot for the state the widget is stuck in. FB13758490: PacketLogger no longer logs packets PacketLogger used to log BTLE packets as they were received and transmitted on a macOS machine. Since updating to 14.5 Beta (23F5064f) however, PacketLogger no longer logs packets on macOS at all. Upon starting a new session, the interface remains empty. PacketLogger is still able to log packets from a connected iOS device. Related threads Apple Watch cannot reconnect WatchOS Sysdiagnose Profile is no longer XCode 15 can't run on iOS 17 devices. Previous preparation error: An error occurred while communicating with a remote process.. The connection was invalidated.
Posted Last updated
.
Post not yet marked as solved
0 Replies
61 Views
Hello, I have a swift package that supports visionOS and one of its targets is a xcframework that also support visionOS and when I try to archive that swift package (using xcodebuild archive) I get this error: note: '<xcframework path>' is missing architecture(s) required by this target (x86_64), but may still be link-compatible. (in target '[library name]' from project '<swift package name>') But starting in Xcode 15.2 (I have Xcode 15.4 installed), you cannot develop for visionOS on Intel machines. So why does it require that the xcframework needs x86_64 support for the visionOS simulator? Any help would be great. Thanks!
Posted
by klinee101.
Last updated
.
Post not yet marked as solved
1 Replies
95 Views
I try ti create a new project but Xcode don't let me do this... The "Next" button doesn't let me to continue.
Posted
by trevolt.
Last updated
.
Post not yet marked as solved
9 Replies
696 Views
I have a macOS app that links to several static libraries. Each library has its own Xcode project, and we have a workspace that includes the app along with all of the static libraries. After upgrading to Xcode 15, any changes made to the code in one of the libraries will get compiled, but not relinked into the app (so the app will still be run using the old code without the change). So far, the only way I can get it to include the change is to clean the entire workspace and rebuild, which takes several minutes. Following suggestions I've found online, I've tried turning off "Find Implicit Dependencies" in the scheme but I can't figure out how to explicitly set the dependencies (they don't appear when trying to add a Target Dependency under Build Phases). Also, it seems to be correctly finding the dependencies since it recognizes when a change has been made and recompiles. I've tried specifying the libraries in both the "Link Binary With Libraries" Build Phase and the Other Linker Flags build setting. Both work in terms of correctly building the app but neither one fixes this issue. Does anyone know how to fix this issue? Waiting 5 minutes to recompile the entire project after each minor change is destroying my productivity!
Posted
by KGraus.
Last updated
.
Post marked as solved
1 Replies
118 Views
Hello, I've got a "other swift flag" set up for one of my schemes. It works when I build locally, but not when I try building using Xcode Cloud. My Other Swift Flags is set up like this: My code looks something like this: class Config { #if LIMITED static let configProperty = 1 #endif } However, Xcode Cloud says Config has no member 'configProperty', when I build my 'Limited' scheme.
Posted
by GBecker.
Last updated
.
Post not yet marked as solved
4 Replies
1.5k Views
Since the macOS 14.4 and Xcode 15.3 update, I'm getting these message posted in the Xcode log when I run a Mac app, even for template apps. BOOL _NSPersistentUIDeleteItemAtFileURL(NSURL *const __strong) Failed to stat item: file:///Users/***/Library/Containers/***/Data/Library/Saved%20Application%20State/***.savedState/restorecount.plist I've already reported this to Apple. I just wanted to know if I was the only one affected (it happens on all my development Macs).
Posted
by jeanlain.
Last updated
.
Post not yet marked as solved
1 Replies
86 Views
When I build my product for the simulator or for direct install from Xcode to my device, all works fine. When I archive>distribute, the app is missing modules when it starts. "Runtime error module 'network' not found:resource (network.lu) does not exist in archive... And then a list of al the places it looked. Xcode 15.3 Solar2d 2024.3706 (latest) Macbook Pro M3 Sonoma 14.4.1 Programming in Lua on Solar2d "native" (includes Objective-C and Swift code) I have had a related (I think) problem with the simulator and device builds missing other modules (all includes) -- but only after working fine for maybe a dozen builds. I then explicitly add them in, one by one. There is no way I can manually add in network, because it is built into the Solar2d environment. I am pretty sure this is an Xcode bug, not a Solar2d bug. But also likely I have a setting wrong.
Posted Last updated
.
Post not yet marked as solved
0 Replies
57 Views
Xcode 15 introduced official support for static frameworks. docs here This is presumably because there's quite a bit over overlap with the mergeable libraries feature. Static frameworks potentially give developers a nice option for bundling resources with a static library. This was previously only really viable if you explicitly packaged up a .bundle with your .a (static library) which could be cumbersome for both the creator and consumer of a library. Or you explicitly copied your framework resources into your main app binary when building your app. The release notes for Xcode 15 state: Embedding a static framework using a Copy Files build phase now removes the static archive from the framework when it is embedded in the target bundle. When inspecting the app target on disk this appears to be the case. In fact the behaviour is the same as with a mergable in release mode whereby a "stub" binary exists with no symbols. The release notes also state: The COPY_RESOURCES_FROM_STATIC_FRAMEWORKS build setting, previously used in the legacy build system to extract and copy the resources from a static framework to the target bundle, no longer has any effect with the new build system as the entire framework is copied instead This also appears to be the case when inspecting the files on disk as the frameworks appear to be present in the main app with their resources. So far so good. The issue arises when trying to access the bundle associated with this framework. The documentation doesn't mention any special access requirements to it's assumed that standard bundle access APIs should work. Using a class let bundle = Bundle(for: InfoCoreMain.self) This returns the main application bundle and therefore fails to find the correct asset. This can be rationalised by the fact that the InfoCoreMain class does now actually exist within the main app target binary due to being statically linked. It's worth noting however, that mergable libraries in release mode do seem to work in this way and can resolve the bundle fine*. Using an explicit bundle identifier let bundle = Bundle(identifier: "***.***.InfoCore") Using an explicit bundle identifier returns nil even though we can see the framework on disk. Using a path Using a path to access the framework also doesn't work. if let bundlePath = Bundle.main.path(forResource: "InfoCore", ofType: "framework") { let bundle = Bundle(path: bundlePath) // Now you can access resources in the framework bundle } else { // Framework bundle not found } All of the above is the same behaviour for release and debug builds. I have tried this on Xcode 15.2 and 15.3 *Mergeable libraries do seem to have issues in debug mode. See this forum post. https://forums.developer.apple.com/forums/thread/749818
Posted
by Rednaz.
Last updated
.
Post not yet marked as solved
1 Replies
71 Views
I am working on a white label product and have around 400+ white label customers with minor changes in color, assets, and strings. I am considering creating a workspace and adding all customer projects to the workspace. However, I am unsure about the limitations of Xcode workspace. How many projects can be added to an Xcode workspace?
Posted Last updated
.
Post not yet marked as solved
2 Replies
120 Views
Hello! We are experiencing crashes on iOS both in debug and release builds in a game made in Godot 3.5.1. The main problem is that we don’t know where exactly the problem is and cannot understand how could we find a way to fix it. We don't expect that someone here will know how to fix this on Godot's side, but we would appreciate some help on how to get more info about the problem and potentially fix it. Debug builds: It is way more frequent in debug builds when we make a build, open it in Xcode, and install it directly on an iOS device. The first type of the crash in debug build is occurring like 70% of the time when the game is loading and trying to get into its main menu. The thing we are getting in Xcode looks like on first image below. Another type of crash happens when we open some save files and start the actual playable part of the game. It happens just after moving the character a few steps and it looks like on second image below. We are aware that the log recommends using breakpoints to find where exactly the problem is, but the thing is that we don’t know where we could do that in Xcode. We are not sure if we are missing something in Xcode or if we cannot do that when opening a project made in Godot. We tried many different builds with removed shader files, and scenes and changed different kinds of settings. We would get the same crash every time. When we made a new build, we cleared the build’s folder. Also, we occasionally deleted the .import folder of the project during development and reimported it. The problem occurred on many different iOS devices with more than 4GB of RAM. Release builds: These builds are uploaded on TestFlight. In release builds crashes wouldn’t occur like in debug builds. They would happen like totally randomly. In some testing sessions, it would happen like 10 minutes in the game, and in others in a few hours. Some testers couldn’t get the crash and altogether and we couldn’t find some repro steps to produce these crashes. In the attached files, you can find logs that we managed to collect from TestFlight. The most frequent type of the crash that we got, is following: Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Subtype: KERN_INVALID_ADDRESS Additional info: From reading Apple’s documentation Investigating memory access crashes, we got it that the problem is in “Invalid memory fetch”, but we couldn’t find how this could help us with further investigation. When we used Address Sanitizer tool and made a build, suddently the game stopped crashing in debug builds like it did before. Also we then didn't receive logs in Xcode that would hint us that something is going on. Tried to build our project in newer version of Godot, but the problem still persisted. Used software and hardware: Godot 3.5.1 macOS, Ventura, 13.5 Xcode, 15.2 iPad Air (5th generation), 17.4.1 MacBook Pro, Apple M1 If you have some clues or ideas on how to fix this problem, please write it, it would mean us a lot. Don’t hesitate to ask questions if something is unclear. Thank you very much in advance!
Posted
by fury_ivan.
Last updated
.
Post not yet marked as solved
0 Replies
93 Views
After a while I returned to Xcode . I bought a new Mac mini M2 and I installed the Xcode 15.3. To familiarize with the changes in the plataform I follow the tutorial you provide. I create a new iOS app following the instructions. I clicked in the ContentView and I was supposed to see in the canvas a representation of an iPhone running my app. Insteady I saw an error message "Cannot preview in this file - Unexpected error ocurred". I'm blocked in this situation . Do you have a solution for that? The code is provided by your tutorial. I didn't change it. Thanks for your help in this matter. Fernando
Posted
by araferna.
Last updated
.
Post not yet marked as solved
0 Replies
58 Views
I am in a weird twilight-zone of a git problem in xcode. I specify some files to be staged and it fails to do with no warning of any sort. So I cannot commit them or apply stashed changes to them. I can do it one.file.at.a.time. I have over 11k intermediate files that .gitignore won't ignore, nor stage nor commit to do anything so I could stop tracking them.
Posted
by proxima.
Last updated
.
Post not yet marked as solved
9 Replies
6.6k Views
I'm unable to run my app with ASAN enabled when targeting a physical iOS device. Simulator targets do work. With Xcode 12 and an iPad mini 4 running iOS 14 beta 1 I get the following error during app launch ==750==ERROR: AddressSanitizer failed to allocate 0xffffffffff9fc000 (-6307840) bytes at address 2db624000 (errno: 22) ==750==ReserveShadowMemoryRange failed while trying to map 0xffffffffff9fc000 bytes. Perhaps you're using ulimit -v With Xcode 11.5 and an iPad Air 2 running OS 12.4.1 the error is ==2177==Unable to find a memory range after restricting VM. ==2177==AddressSanitizer CHECK failed: /BuildRoot/Library/Caches/com.apple.xbs/Sources/clangcompilerrt/clang-1103.0.32.62/compiler-rt/lib/asan/asanmac.cc:92 "((0 &amp;amp;&amp;amp; "cannot place shadow after restricting vm")) != (0)" (0x0, 0x0) &amp;lt;empty stack&amp;gt;==2177==AddressSanitizer CHECK failed: /BuildRoot/Library/Caches/com.apple.xbs/Sources/clangcompilerrt/clang-1103.0.32.62/compiler-rt/lib/asan/../sanitizercommon/sanitizermallocmac.inc:143 "((!asaninitisrunning)) != (0)" (0x0, 0x0) warning: could not execute support code to read Objective-C class data in the process. This may reduce the quality of type information available. AddressSanitizer report breakpoint hit. Use 'thread info -s' to get extended information about the report. (lldb) thread info -s thread #1: tid = 0x1076c2, 0x000000011531e984 libclangrt.asaniosdynamic.dylib`__asan::AsanDie() My coworker is able to use ASAN with the same App using iPad Pro 10.5, iPadOS 13.5.1, Xcode 11.5 Are there any configuration changes I need to make to be able to use ASAN on my devices?
Posted
by smpeleato.
Last updated
.
Post not yet marked as solved
0 Replies
60 Views
I wan't to use Java in Xcode the class file is Main.class. So I set scheme -> run to a script like this: #!/bin/sh java -cp $(dirname $0) Main But when I run it, java said : Error: Could not find or load main class Main Caused by: java.lang.ClassNotFoundException: Main How can I fix this problem? And: It's really helpful to answer in Chinese if you know it.
Posted
by xycabcd.
Last updated
.
Post not yet marked as solved
4 Replies
85 Views
I just bought a m2 MacBook Pro running latest Xcode / Sonoma from apple refurbed. I am porting from an older macbook pro/intel chip a project that uses pthread. as this is my first week using the laptop, I recompiled the project but the apple linker does not find the libpthread library. I see it is not included in the installed Xcode. how do I get this library from Apple? regards Dave
Posted
by DaveBone.
Last updated
.
Post not yet marked as solved
1 Replies
65 Views
I was watching https://developer.apple.com/videos/play/wwdc2023/10248/ , in this video it is adviced to make below shated property async to benefit from concurency (in video 40:04 , exact time) , do yo know how to do it ? class ColorizingService { static let shared = ColorizingService() func colorize(_ grayscaleImage: CGImage) async throws -> CGImage // [...] } struct ImageTile: View { // [...] // implicit @MainActor var body: some View { mainContent .task() { // inherits @MainActor isolation // [...] result = try await ColorizingService.shared.colorize(image) } } }
Posted
by Huseyin_.
Last updated
.