Aleksei Petrenko
Aleksei Petrenko

Reputation: 7168

Android Studio 1.4 cannot launch debug server

I've been working with AS 1.4 for quite a while and new native debugging feature is especially useful.

However native debugging does not work on my Samsung Galaxy Note 10.1 2014 (Android 4.4). When I try to start the native debugging session I see the following message:

Starting LLDB server: run-as com.example.hellojni /data/data/com.example.hellojni/lldb/bin/start_lldb_server.sh /data/data/com.example.hellojni/lldb /data/data/com.example.hellojni/lldb/tmp/platform.port1445003703353 "lldb process:gdb-remote packets"

Error while launching debug server on device: com.android.tools.ndk.run.DebuggerContext$StartServerException: java.lang.IllegalStateException:
Failed to read platform port /data/data/com.example.hellojni/lldb/tmp/platform.port1445003703353

I also found an open issue: https://code.google.com/p/android/issues/detail?can=2&start=0&num=100&q=&colspec=ID%20Type%20Status%20Owner%20Summary%20Stars&groupby=&sort=&id=185061

Is there a way to solve this?

Upvotes: 3

Views: 5105

Answers (2)

Robert Lujo
Robert Lujo

Reputation: 16361

I encounter Android Studio 3.5 similar issue with LLDB debugger - where "Starting LLDB server" process hangs forever, no debugging process is started and after solving this I encounter another issue. The issues with workarounds are explained in bug reports I submitted:

  1. Android Studio C++ Debugger startup silently ignores phone LLDB setup critical issues - workaround: ensure to use AVD emulator based on Google API and not Google Play (no root access)
  2. Android Studio C++ Debugger uses wrong paths on phone in LLDB setup procedure causing: failed to get reply to handshake packet - workaround: check which paths are wrong and create them on device like: mkdir -p .../bin

Upvotes: 1

Alex Cohn
Alex Cohn

Reputation: 57173

See https://code.google.com/p/android/issues/detail?id=187003

You need root access on your device, but then chmod 4750 /system/bin/run-as may solve the problem.

If you don't have root access, you can modify your app, and start LLDB server with your package's identity, using Runtime.exec().

Upvotes: 3

Related Questions