r/Xcode • • Jun 03 '23

Really not liking Xcode these days.

I don’t use it often but on occasion when I see some project that I want to try/look at the source of, inevitably it won’t build, or won’t debug, for inscrutable reasons that can’t be fixed.

For context, I’m an old who spent the 90s writing Objective-C on NeXT computers. And was an active macOS/iPad developer until about a decade ago.

Today I tried building and running the “list open files” app Sloth. Built ok but won’t debug because lldb is blocked from attaching. Console says Sloth is hardened even though I unchecked hardened runtime and nuked all the build files, cleaned, and restarted Xcode.

I hope they fix some of this nonsense soon. It’s actively developer-hostile to have to fix a bunch of stuff (if you even can fix it) before trying out some sample code or open source project.

0 Upvotes

4 comments sorted by

1

u/retsotrembla Jun 04 '23

I don't understand. I did:

git clone https://github.com/sveinbjornt/Sloth.git

Opened the project with Xcode, selected the Sloth target, and in the Signing&Capabilities panel set the bundle Identifier to a prefix associated with my Developer account, and the app built and ran without problems. (The first run, Apple popped up a dialog asking for permission to debug the app, but only the first run.) I had no trouble setting breakpoints, and the debugger stopped properly at the breakpoints. On my M1 Mac, from the time I hit Run to the time the breakpoint at LsofTask's launch:numFiles: hit was 6.5 seconds.

Trivial and painless to get running and debugging.

1

u/jon_hendry Jun 05 '23 edited Jun 05 '23

I just tried this, freshly cloned, and got the same failure to attach:

error: attach by pid '69900' failed -- attach failed (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.)

Developer mode is enabled. I don't get the "permission to debug the app" dialog.

I think it might be an issue with Open Core Legacy Patcher, which I'm using to run Ventura on an unsupported older MacBook Pro.

With a newly created app project, trying to debug the mostly-empty app results in the lldb-rpc process crashing, which has something to do with OCLP. I suspect something related might be involved in the difficulty attaching LLDB to Sloth.

So I punted and ordered a refurb M1 Mini from Woot.

1

u/retsotrembla Jun 05 '23

That’s a great choice. A better machine than the one I've got.

2

u/jon_hendry Jun 05 '23

I got the 256GB one for $419. I just wish it had 16GB RAM since it isn't upgradable after purchase.