Android Studio 1.4 无法启动调试服务器

标签 android debugging android-studio android-ndk

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

但是 native 调试不适用于我的 Samsung Galaxy Note 10.1 2014 (Android 4.4)。当我尝试启动 native 调试 session 时,我看到以下消息:

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

我还发现了一个 Unresolved 问题: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

有办法解决吗?

最佳答案

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

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

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

关于Android Studio 1.4 无法启动调试服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33172427/

相关文章:

java - 查找ArrayList的索引

java - 如何将 sqlite 中的数组与 json 数组的内容进行比较

java - 如何从 ant 以 Debug模式启动 jetty

android - 无法使用 gradle 安装执行构建

android - 从 AppTheme.NoActionBar 更改为其他任何内容都会给我 Android Studio 2.1.2 中的错误

android - 从字符串资源中引用 XML 整数资源

android - 在 Android studio 项目中将 card.io 源代码作为模块导入

ruby-on-rails - 权限被拒绝运行来自Ruby gem的方法

c - Windows 是否有一个好的 Valgrind 替代品?

android - 无法启动 Activity 组件信息