How to debug share ios extension?

How to print logs from Xcode lldb debugger from extension?

+5
source share
3 answers

Simple answer:

  • log messages are not printed, however you can stop at breakpoints and then print everything using lldb .

    • Run the application
    • While the application is running, go to DebugAttach to process using PID or name

enter image description here

  1. Enter the name or ID of the expansion pack and click

enter image description here

  1. Then run the extension in any way that you can do this on your device.
  2. Wait for the debugger to stop the expansion at the breakpoint.
+6
source

You do not need to attach to the extension of your application manually. Xcode should take care of all this automatically.

Look at the launcher editor for your extension schema. The executable file will be installed in your application or "Ask for launch". In any case, launching the target will lead to the launch of the application you have selected.

Go to this application on your device, create / select everything that is in the application that you want to provide, click the sharing icon, select the extension in the list of active sharing extensions. Then, when your distribution extension starts, the debugger automatically connects to it. This may take a couple of seconds, but you will see that your extension with all its threads appears in the Navigator Navigator, and if you set any breakpoints, it should stop at them.

If you do this like this, the debugger will also connect to stdout so that you see the log messages in the debugger console.

+1
source

If you are debugging a device, you can open Device Manager with Command, Shift, 2 and view console messages there. Choose your device.

If you are debugging a simulator, messages go to the system log. You can open it from the simulator using the / or "Open System Log" command from the "Debug Simulator" menu.

0
source

Source: https://habr.com/ru/post/1235204/


All Articles