"devicectl device process launch --start-stopped" attach debugger from command line

Topic : Attaching debugger via lldb to remote process on tv device

Current status

  1. I launch an app on a remote tv device that is paired to a macbook using the command
  • xcrun devicectl device process launch --start-stopped -d XXXX-XXXXXX, com.metasample.SampleApp -j launch.json
  1. App is launched in stopped state and waiting for debugger to be attached to continue execution
  2. Using the XCode->Debug->Attach to Process, I am able to select the process and connect to the process and execute the app through the debugger.

Expectation

I would want to replace step 3 and use a command line instead to attach the debugger to the remote process instead of doing it via XCode.(the reason is to automate the execution without any manual intervention)

  • I know the process id of the app on the remote tv device when i inspect the launch.json file that is created when the launch the app. eg pid 312
  • I also know the ip address of the device eg ip 192.168.178.29

However I do not know how to establish the debug session using lldb from command line.

I launch lldb in the command line and execute these commands

  • platform select remote-tvos
  • target create /Users/works/apps/SampleApp-Payload/SampleApp.app/SampleApp
  • gdb-remote 192.168.178.29: "what is the port?" - I do not know what port to connect to?

Many Thanks for your suggestions and inputs on how to connect to the remote app via command line lldb.

Post not yet marked as solved Up vote post of manstan Down vote post of manstan
669 views