2

I would like to know how I can debug an Android app by using lldb. I mean using lldb from console not over Android Studio.

From what I found out, Android Studio is doing this:

  1. Pushing the app to the device
  2. Starting this app
  3. Pushing lldb-server to the device
  4. Starting lldb-server on the remote device
  5. Forwarding the ports
  6. Connecting to the local port which is forwarded to the device

I would like to achieve the same using lldb from the console.

Let's say I have already lldb-server on the remote device (because Android Studio did this already for me), what do I need to do is to connect to an App using lldb from the console?

JBL
  • 12,588
  • 4
  • 53
  • 84
strentler
  • 111
  • 1
  • 9

1 Answers1

0

Never tried, but maybe this could help:

Additionally:

  • ensure that APK's native libraries (lib*.so) are having debug info/symbols. I pull the apk locally, locate .so file, and check the output of binutils nm utility. When you get familiar with your .so files only checking the size of the .so file could be enough.
  • one can debug by attaching to a running process/application (attach) and in some cases you need to debug application on application start (run).
  • in some debugging cases phone/emulator requires root access (file manipulations)
  • if you manage to debug C++ libs within Android Studio - check Debug+Console and Debug+LLDB output tabs to find interesting commands/options/steps
  • the procedure looks quite complicated and fragile - arm yourself with patience, don't ignore warnings and don't skip steps.
Robert Lujo
  • 15,383
  • 5
  • 56
  • 73