问题描述
我使用 AS 1.4 已经有一段时间了,新的本机调试功能特别有用.
I've been working with AS 1.4 for quite a while and new native debugging feature is especially useful.
然而,本机调试在我的三星 Galaxy Note 10.1 2014 (Android 4.4) 上不起作用.当我尝试启动本机调试会话时,我看到以下消息:
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?
推荐答案
参见 https://code.google.com/p/android/issues/detail?id=187003
您的设备需要 root 访问权限,但 chmod 4750/system/bin/run-as
可能会解决问题.
You need root access on your device, but then chmod 4750 /system/bin/run-as
may solve the problem.
如果您没有 root 访问权限,您可以修改您的应用程序,并使用您的包标识启动 LLDB 服务器,使用 Runtime.exec()
.
If you don't have root access, you can modify your app, and start LLDB server with your package's identity, using Runtime.exec()
.
这篇关于Android Studio 1.4 无法启动调试服务器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!