Debugging

RSS for tag

Discover and resolve issues with your app.

Posts under Debugging tag

200 Posts
Sort by:

Post

Replies

Boosts

Views

Activity

Posting a Crash Report
If you need help investigating a crash, please include a crash report in your post. To smooth things along, follow these guidelines: For information on how to get a crash report, see Acquiring crash reports and diagnostic logs. Include the whole crash report as a text attachment (click the paperclip icon and then choose Add File). This avoids clogging up the timeline while also preserving the wealth of information in the crash report. If you’re not able to post your crash report as an attachment, see Can’t Post Crash Report as Attachment below. If you want to highlight a section of the report, include it in the main body of your post. Put the snippet in a code block so that it renders nicely. To create a code block, add a delimiter line containing triple backquotes before and after the block, or just click the Code Block button. If possible, post an Apple crash report. Third-party crash reporters are often missing critical information and have general reliability problems (for an explanation as to why, see Implementing Your Own Crash Reporter). Symbolicate your crash report before posting it. For information on how to do this, see Adding identifiable symbol names to a crash report. If you need to redact the crash report, do so consistently. Imagine you’re building the WaffleVarnish app whose bundle ID is com.example.wafflevarnish but you want to keep your new waffle varnishing technology secret. Replace WaffleVarnish with WwwwwwVvvvvvv and com.example.wafflevarnish with com.eeeeeee.wwwwwwvvvvvvv. This keeps the text in the crash report aligned while making it possible to distinguish the human-readible name of the app (WaffleVarnish) from the bundle ID (com.example.wafflevarnish). Finally, for information on how to use a crash report to debug your own problems, see Diagnosing issues using crash reports and device logs. Can’t Post Crash Report as Attachment Crash reports have two common extensions: .crash and .ips. DevForums lets you attach the first but not the second (r. 117468172). To work around this, change the extension to .txt. If DevForums complains that your crash report “contains sensitive language”, leave it out of your initial post and attach it to a reply. That often avoids this roadblock. If you still can’t post your crash report, upload it to a file sharing service and include the URL in your post. Post the URL in the clear, per tip 14 in Quinn’s Top Ten DevForums Tips. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = "eskimo" + "1" + "@" + "apple.com" Revision History: 2024-05-21 Added some advice regarding the “contains sensitive language” message. 2023-10-25 Added the Can’t Post Crash Report as Attachment section. Made other minor editorial changes. 2021-08-26 First posted.
0
0
5.8k
May ’24
Debugging Resources
General: DevForums tags: Debugging, LLDB, Graphical Debugger Xcode > Debugging documentation Diagnosing memory, thread, and crash issues early documentation Diagnosing issues using crash reports and device logs documentation Choosing a Network Debugging Tool documentation Testing a release build documentation Isolating Code Signing Problems from Build Problems DevForums post What is an exception? DevForums post Language Exception from RCTFatal DevForums post Standard Memory Debugging Tools DevForums post Using a Sysdiagnose Log to Debug a Hard-to-Reproduce Problem DevForums post Posting a Crash Report DevForums post Implementing Your Own Crash Reporter DevForums post Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = "eskimo" + "1" + "@" + "apple.com"
0
0
2.3k
Oct ’23
How to attach to Privileged Helper as root?
We have a Privileged Helper tool that we install with SMJobBless. I would like to debug it. I've added WaitForDebugger in our helper tool launchd plist and it does wait. But I can't attach to it via Debug->Attach to Process in Xcode with error: Code: 3 Failure Reason: tried to attach to process as user 'myusername' and process is running as user 'root' I set Debug process as: root in scheme settings. But I'm not sure if it does anything since I'm not running this particular scheme at the moment of attach. I tried unsuccessfully to set "Wait for the executable to be launched" but I had to create a new scheme for it since helper is built as part of the main app so maybe I did something wrong. Am I doing something wrong or is it not possible to attach to root process?
0
0
45
18h
Unreal 5.3 build failed, copied project from windows pc
I am having problems building an Unreal project in Xcode. The problem starts when the compiler starts to build a custom made plugin, that works perfectly fine on windows. When looking at the log, it seems that I will have to rebuild the plugin for macOS-arm64, does anyone have some ideas how I should approach? Showing All Messages ------ Building 4 action(s) started ------ [1/4] Link [Apple] Trancendent Undefined symbols for architecture arm64: "ExampleLibraryFunction()", referenced from: FTrancendantMetaNodesModule::StartupModule() in Module.TrancendantMetaNodes.cpp.o ld: symbol(s) not found for architecture arm64 /Users/Shared/Epic Games/UE_5.3/ld:1:1: ignoring file /Users/nicolaslefevre/Desktop/KanuziTemple/Plugins/TrancendantMetaNodes/Source/ThirdParty/TrancendantMetaNodesLibrary/Mac/Release/libExampleLibrary.dylib, building for macOS-arm64 but attempting to link with file built for macOS-x86_64 Total time in Parallel executor: 2.18 seconds Total execution time: 2.95 seconds /Users/Shared/Epic Games/UE_5.3/clang:1:1: linker command failed with exit code 1 (use -v to see invocation)
0
0
43
19h
Bug Accessing Multiline SwiftUI TextFields in UITests
Hello, I am wondering if anyone else has seen this bug: Create a multiline TextField like so: TextField("a string", text: $myDataStore.placeholder, axis: .vertical) .accessibilityIdentifier("placeholder") .multilineTextAlignment(.leading) .lineLimit(...3) .textFieldStyle(CustomTextFieldStyle(text: $myDataStore.placeholder, hasErrors: myDataStore.placeholder.isEmpty)) Then create a UITest that accesses it. let multilineTextField = app.textViews["placeholder"] // note that multiline textFields can only be accessed as textVIEWS, not textFIELDS. They simply do not appear under po.textFields let exists = multilineTextField.waitForExistence(timeout: 3) XCTAssertTrue(exists, "The field did not appear in time.") multilineTextField.tap() // everything is fine up to here //BUG: multiline textfields will not tap into keyboard on larger device types like the iPhone 15, but they will on SEs. multilineTextField.typeText("A Test") // fails on anything other than an SE, "Neither element nor any descendant has keyboard focus" What is happening here?
0
0
71
4d
Screen Time Crash. IOS 18 Dev Beta 1
I have experienced a consistent bug with screen time in IOS 18 DB1. It just doesn’t work, but the limits still function. I cannot access screen time settings (it just crashes) nor can I disable screen time from within a blocked app itself. Have not found any workaround. I have logged a feedback report, FB13932765 (Unable to open screen time settings, it just crashes) I Hope this can be looked at and resolved by the next update. Thanks, Felix
2
6
386
3d
Xcode 15.4 - SwiftUI Publishing changes warning is not coming as a purple warning in the file
As I trying to check "Publishing changes from within view updates is not allowed, this will cause undefined behavior." within the app in Xcode 15.4 , but unable to see that in the specific file but is getting logged in the Xcode , even I tried adding debugger for "All runtime issues" , its not working. Console like Opposed to this I am expecting this to be visible in the file as Anyone can pls help me in there!! Thanks!!
1
0
119
5d
Bug? Xcode 16 macOS 15 SDK on macos 14.5 causes Metal Shader Colors to be Wrong
I've been upgrading Xcode consistently for years and have never seen Metal shaders behave differently from one version to another until now. On macOS 14.5, Xcode 16 beta, suddenly several color outputs turn out completely black where there should be color. All validation is on and nothing seems to be wrong (and hasn't been since maybe Xcode version 11). I've attached two screens. The first is the normal color scheme, the second is in Xcode 16. The settings are the exact same. Normal: Buggy with black + transparent colors (so it seems like either colors are overflowing or are all 0s)? Before I file a bug report or code level request, may I have some thoughts on how to debug this? The only clue I have is that I'm using bindless to multiply color texture samples with color values from my vertex struct. But it still fails even if I use hard-coded values for the texture samples, meaning somehow the color values are not being sent to the shader correctly? This is the most stable part of my rendering pipeline, so I'm surprised if the issue is there. Thank you.
1
0
221
1w
Screen Time Bug: iOS 18
Hey, So I obviously downloaded the dev beta the second I could, and I didn’t notice any bugs. Except after the first reboot, the new Screen Time settings UI is replaced by the old one (see video below). This also has an effect on Remote Screen Time Management somehow, making any change (Downtime, App limit, etc) from the guardian’s device over the internet (as in not directly on the managed phone) not take effect at all. Rebooting does nothing, connecting to wifi does nothing, everything. I reported this to the Feedback Assistant so hopefully they catch wind of this soon. Anyone else experiencing this bug or does anyone have a workaround? Reply if so. Thanks, Mr. Sharky
2
3
307
1w
Command CodeSign failed with a nonzero exit code
I am having a peculiar issue with an app I am developing. I am trying to upload it onto App Store Connect but I am getting one error, and a very odd behavior. The error message I am getting is: /Users/user/Documents/GitHub/MyApp/MyApp/DerivedData/MyApp.pub/Build/Intermediates.noindex/ArchiveIntermediates/MyApp.pub/InstallationBuildProductsLocation/Applications/MyApp.pub.app: resource fork, Finder information, or similar detritus not allowed Command CodeSign failed with a nonzero exit code I have cleaned built the directory, I have removed the Derived Data, but this always gets thrown. It was working fine a few months ago, I have only just got back to working on it. The other issue I am havving, when I set to archive the app, I set the target as Any iOS Arm Device (arm64), but when it is archiving it switches to my iPhone as the target. I don't prompt it to do this, it just does it. This is very frustrating. I'm using a MacBook Air M1, with a macOS Sonoma. I updated my Xcode the other day, that's Version 15.4 (15F31d). My App has a minimum target of iOS 15 and a project target of Xcode 13. Any help is appreciated.
3
0
255
2w
SwiftUI, tvOS - can't focus buttons
I'm trying to create a simple app for tvOS. But I immediately encountered difficulties. At the top I have a tab selection, and at the bottom there is item management. The problem is that all buttons in HStack are connected into one big button. So I solved it by adding .plain style to the buttons. But now I have a new problem - I can't focus on my buttons for tab selection. Here is the code: struct ContentView: View { var body: some View { VStack { HStack (alignment: .center) { Button("tab1"){} Button("tab2"){} } .frame(width: 500) // works when remove List { HStack { Text("Item 1") Spacer() Button("Button1"){} .buttonStyle(.plain) // added Button("Button2"){} .buttonStyle(.plain) // added } HStack { Text("Item 2") Spacer() Button("Button1"){} .buttonStyle(.plain) // added Button("Button2"){} .buttonStyle(.plain) // added } } } } } I would appreciate any help. Unfortunately, there is very little information on the Internet about designing applications for tvOS, which confuses me.
1
0
205
3w
Creating a test project
A highly-effective debugging technique is to create a test project focused on your issue, and iterate on solutions using only the test project. We often ask developers to provide us with a small Xcode test project because it helps focus a discussion on the relevant Apple APIs. An ideal test project: Focuses only on specific Apple APIs Uses the minimum amount of code possible (usually just a few files) Reliably demonstrates the problem for anyone who builds the project Contains no third-party libraries Builds with no warnings using Xcode's default build settings Does not require any third-party build tools There are two approaches to creating a focused Xcode project: Create a new project starting from one of Xcode's built-in templates, and add code to demonstrate the issue. Start with a copy of your existing project, and remove code not essential to the issue. Remove code iteratively, re-testing after every removal. If you find that you can no longer demonstrate the issue after removing a particular piece of code, it’s likely that the issue is within the last-removed code. After restoring this code to the project, keep reducing the surrounding code until everything remaining is essential to the issue. The first method is often faster if you can quickly find the right functionality to add. If that doesn't work out, the second method is usually a reliable approach. In many cases, creating the test project will help you locate and solve the issue by yourself. Even if it doesn't, the test project still has value! It provides a smaller starting point for others to look into your issue. And if the test project helps identify a bug, then you can attach it to a bug report; the engineer looking at your report will appreciate the effort. Sharing a link to a test project We're always willing to take a look at your test project when it satisfies the characteristics listed above. Just share a link to where we can find it as part of your post. The forums have a list of websites you can link to. If you find that your link isn't visible in the preview of your post, just include the URL without using Markdown link syntax. For example, this link with Markdown won't appear: Apple is based in [Cupertino](https://www.cupertino.org). but this version will: Apple is based in Cupertino. https://www.cupertino.org Revision History 2024-05-30 Initial version.
0
0
102
3w
Unable to Debug macOS Action Extension: "Attach failed" Error
Hello everyone, I'm encountering an issue while trying to debug a macOS Action Extension. I created a completely fresh project with an Action Extension target. When I select the Action Extension scheme and run it, choosing Finder as the host app (app to launch it in), I receive the following error: Attach failed: Could not attach to pid : “647”. (Not allowed to attach to process. Look in the console messages (Console.app), near the debugserver entries, when the attach failed. The subsystem that denied the attach permission will likely have logged an informative message about why it was denied.) This is in Console.app: macOSTaskPolicy: (com.apple.debugserver) may not get the task control port of (Finder) (pid: 647): (Finder) is hardened, (Finder) doesn't have get-task-allow, (com.apple.debugserver) is a declared debugger(com.apple.debugserver) is not a declared read-only debugger. I am pretty sure it worked before on my project that I am developing. It stopped working and now it doesn't even work on a fresh new project. Any ideas? I tried cleaning derived data, restarting my mac, nothing helps. As per the documentation it should work normally using the Build & Run button.
6
0
302
2w
(Swift) TextField border contained in a view remains visible even when the view is fully overlapped by another view.
I have a ZStack that contains a VStack with 2 views (view1 and view2) and a third view (view3). So, is either that view1 and View1 are visible, or view3 is visible. This is the relevant code: ZStack { VStack { view1() View2() } if showView3 View3() } view1 and view2 are 400px in width and 200px in height, while view3 is 400 x 400 px, so that it completely overwrite view1/view2 when visible. The problem I'm trying to solve is that the border of a TextField placed in view1 is visible when showView3 is true, what should not be happening (possible glitch in swift?). To show the problem, I prepared a code sample, which shows that when view3 is active, it completely overwrites view1/view2, but still, the border of the TextField remains visible. (See screenshot below) struct TestZStackView: View { @State private var showView3 = false var body: some View { ZStack { VStack { Toggle("view3", isOn: $showView3) View1() .frame(width: 400, height: 200) .background(Color.red) .zIndex(1) View2() .frame(width: 400, height: 200) .background(Color.green) .zIndex(1) } if showView3 { View3() .frame(width: 400, height: 400) .background(Color.blue) .zIndex(2) } } } } struct View1: View { var body: some View { TextField("Enter text", text: .constant("")) .padding() .cornerRadius(5) .textFieldStyle(RoundedBorderTextFieldStyle()) .zIndex(1) } } struct View2: View { var body: some View { Color.clear } } struct View3: View { var body: some View { Color.black // (Ensure no transparency) } } zIndex() are not required, I just placed them to see if the problem get solved, but it may no difference. BTW, in the code above, the visible border disappears if the view is minimized, but that is not the case in the real app I'm working on. In the screenshots attached, it can be seen how the TextField border remains visible when view3 is active ("https://developer.apple.com/forums/content/attachment/d0e75f25-d36e-4361-af64-54252d1f2a98" "title=Screenshot 2024-05-24 at 10.06.03 PM.png;width=800;height=632")
0
0
213
4w
(Swift) TextField border contained in a view remains visible even when the view is fully overlapped by another view.
I have a ZStack that contains a VStack with 2 views (view1 and view2) and a third view (view3). So, is either that view1 and View1 are visible, or view3 is visible. This is the relevant code: ZStack { VStack { view1() View2() } if showView3 View3() } view1 and view2 are 400px in width and 200px in height, while view3 is 400 x 400 px, so that it completely overwrite view1/view2 when visible. The problem I'm trying to solve is that the border of a TextField placed in view1 is visible when showView3 is true, what should not be happening (possible glitch in swift?). To show the problem, I prepared a code sample, which shows that when view3 is active, it completely overwrites view1/view2, but still, the border of the TextField remains visible. (See screenshot below) struct TestZStackView: View { @State private var showView3 = false var body: some View { ZStack { VStack { Toggle("view3", isOn: $showView3) View1() .frame(width: 400, height: 200) .background(Color.red) .zIndex(1) View2() .frame(width: 400, height: 200) .background(Color.green) .zIndex(1) } if showView3 { View3() .frame(width: 400, height: 400) .background(Color.blue) .zIndex(2) } } } } struct View1: View { var body: some View { TextField("Enter text", text: .constant("")) .padding() .cornerRadius(5) .textFieldStyle(RoundedBorderTextFieldStyle()) .zIndex(1) } } struct View2: View { var body: some View { Color.clear } } struct View3: View { var body: some View { Color.black // (Ensure no transparency) } } zIndex() are not required, I just placed them to see if the problem get solved, but it may no difference. BTW, in the code above, the visible border disappears if the view is minimized, but that is not the case in the real app I'm working on. In the screenshots attached, it can be seen how the TextField border remains visible when view3 is active ("https://developer.apple.com/forums/content/attachment/d0e75f25-d36e-4361-af64-54252d1f2a98" "title=Screenshot 2024-05-24 at 10.06.03 PM.png;width=800;height=632")
0
0
202
4w
Login with iPad Air works in Simulator but Apple says it doesn't
Device type: iPad Air (5th generation) OS version: iOS 17.5 I don't know what to do.. I am using Firebase for auth and it work on every device. Except for the iPad Air. Does somebody have a similar issue? try { String email = _emailController.text; String password = _passwordController.text; if (EmailValidator.validate(email)) { await _auth.signInWithEmailAndPassword( email: email, password: password); } else { print("Ungültige E-Mail-Adresse"); } } catch (e) { print("Anmeldefehler: $e"); } } }
0
0
179
4w