【问题标题】:Android Studio 1.4 cannot launch debug serverAndroid Studio 1.4 无法启动调试服务器
【发布时间】:2016-01-15 07:43:06
【问题描述】:

我使用 AS 1.4 已经有一段时间了,新的原生调试功能特别有用。

但是本机调试在我的三星 Galaxy Note 10.1 2014 (Android 4.4) 上不起作用。当我尝试启动本机调试会话时,我看到以下消息:

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

我还发现了一个未解决的问题: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

有没有办法解决这个问题?

【问题讨论】:

    标签: android debugging android-studio android-ndk


    【解决方案1】:

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

    您需要设备上的 root 访问权限,但 chmod 4750 /system/bin/run-as 可能会解决问题。

    如果您没有 root 访问权限,您可以修改您的应用,并使用您的包的身份启动 LLDB 服务器,使用 Runtime.exec()

    【讨论】:

    • 我试过了,但没有帮助。我设法更改了 run-as:-rwsr-x--- root shell 9500 2015-03-25 21:42 run-as 的权限,但现在我得到了完全相同的错误消息。
    • 我应该试试你建议的第二种方法。你知道我在哪里可以找到有关Runtime.exec() 方法的更多详细信息吗?
    • 这篇文章很好,深入描述了过程:ian-ni-lewis.blogspot.co.il/2011/05/…。有点老了,讲的是gdb,不过今天还是很贴切的。
    • 你试过setxattr /system/bin/run-as security.capability吗?
    【解决方案2】:

    我在 LLDB 调试器中遇到了 Android Studio 3.5 类似问题 - “启动 LLDB 服务器”进程永远挂起,没有启动调试进程,解决此问题后我遇到了另一个问题。我提交的错误报告中解释了解决方法的问题:

    1. Android Studio C++ Debugger startup silently ignores phone LLDB setup critical issues - 解决方法:确保使用基于 Google API 而不是 Google Play 的 AVD 模拟器(无 root 访问权限)
    2. Android Studio C++ Debugger uses wrong paths on phone in LLDB setup procedure causing: failed to get reply to handshake packet - 解决方法:检查哪些路径错误并在设备上创建它们,例如:mkdir -p .../bin

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-04-08
      • 2018-04-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多