Search code examples
iosiphonedebuggingremote-debugginglldb

Attach lldb to iPhone from command line


While attaching lldb to iPhone works from within Xcode. It is flaky at times. I wonder if it is because XCode has some additional checks before attaching to a process in iPhone. I'd like to debug an iPhone app from command line. lldb has some tutorial that suggest using platform select but that command is unsuccessful in even connecting.

$ (lldb) platform select remote-ios
  Platform: remote-ios
 Connected: no

Am I missing something?

This question has been asked earlier but has no correct answers:


Solution

  • Probably the easiest way to do this is using ios-deploy e.g.

    ios-deploy --bundle=<bundle.app> --debug

    The above command will install your application bundle to the attached iOS device, and launch it with an lldb session connected.