How to debug on device or lldb?

Is there any way to attach a debugger to an app running on an iOS device? I have an app that is behaving oddly and I think I’ve exhausted what I can do easily with MsgBoxes. Is there any way to attach a debugger to the app running on the device?

If not, is there a way to be able to get the system.debuglogs from the app running on the device?

What kind of issues does your app have, which are not traceable with debugging in the simulator?

That would seem possible :
https://www.cocoanetics.com/2011/03/accessing-the-ios-system-log/
http://stackoverflow.com/questions/6144347/using-objective-c-to-read-log-messages-posted-to-the-device-console

Problem is that requires using XCode to build a small app that can display that. Amazingly enough, for all the amazing pile of useless cr@p found in the App Store, nobody seems to have found it in his heart to combine a TextView with the code displayed at these two links. My level in Objective-C is rather primitive, so I won’t be able to concoct the magic tool. But I believe it would take less than 20 minutes to a competent XCode user to do this.

There is Swift code at the second link. If absolutely nobody volunteers, I may give it a try in some of my free time. No promises, though.

If you don’t need all system messages, replacing System.Debuglog is easy, though : create a text file in Documents and append the messages to it. Then all you need to do is make Documents accessible via iTunes.
See https://forum.xojo.com/18037-how-to-get-database-into-out-of-ios-device

Yes, just connect your device to your computer and run Xcode. In the Devices window, select your device and you can view the device console which will show all your Xojo System.Debuglogs.

If you want to forego Xcode, you can use iOSconsole from lemon jar.

Thanks for the suggestions. I am going to take a look at these and see what’s what.

As far as debugging in the simulator, there are some things that the simulator just doesn’t handle. Recently I’ve been working on a music player app, and there are no songs or playlists or anything like that in the simulator.

I’d like to be able to figure out how to handle certain types of media and hierarchical playlist folders, smart playlists, and maybe other stuff, but I can’t even play around with that in the simulator.

It’s a pain to find, but you can get access to the Documents folder (and others) in the simulator. (I used the debugger to get the path to the folder item where I saved stuff). If you can figure out how music and playlists are stored, maybe you can copy them to the simulator. You’ll have to do this for each iOS device you’re simulating.

On the simulator, apps are not sandboxed.

On the device, since the apps are sandboxed, the Documents folder is within a container that is specific to each app.

As far as I know the only way to access it is from the app itself, or from iTunes if you have set file sharing on. Or on a jailbroken device.