【问题标题】:The application runs in the debugger mode, the debugger won't connect应用程序在调试器模式下运行,调试器无法连接
【发布时间】:2012-02-02 13:31:29
【问题描述】:

我的 Android 应用程序不知何故停下来关注断点。我已经添加了

android:debuggable="true"

到清单。所以现在是:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="net.innodigital.iptv.PackVideo"
    android:versionCode="1"
    android:versionName="1.0">

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.SET_DEBUG_APP"/>

<uses-sdk android:minSdkVersion="10" />

<application android:icon="@drawable/icon" android:label="@string/app_label" android:debuggable="true">
    <activity android:name="PackVideo"
              android:label="@string/app_label"
              android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"
              >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.DEFAULT" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <activity android:name="ChannelsListActivity"
        android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen"
              >
        <intent-filter>
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
    <activity android:name="ServerSetActivity"
        android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
              >
        <intent-filter>
            <category android:name="android.intent.category.DEFAULT" />
        </intent-filter>
    </activity>
</application>
</manifest>

我已将调试器超时恢复为默认的 3000 毫秒。

我已重新启动正在使用的设备和 PC。

没有任何帮助。

我已经安装了IntelliJ IDEA11 并在那里运行调试。相同的反应:断点处没有停止。

我应该去哪里看看?事先表示感谢。

编辑:调试器似乎无法连接。即使我将超时设置为 10 秒。

Attempting to connect debugger to 'net.innodigital.iptv.PackVideo' on port 8615

永远等待。

【问题讨论】:

  • 需要更多信息来解释您要调试的内容。
  • 您到底想知道什么?
  • 你想调试什么。如果它是内置应用程序,则必须附加到该进程。
  • @Gangnus 的问题不会因为难以回答而被否决,而是因为问题不好而被否决。
  • 很高兴您解决了您的问题,但请注意您从未提及的两条关键信息,“昨天我导出了 apk”和“应用程序的两个实例为同一个端口而苦苦挣扎”在你原来的帖子里?当您从未向我们提供您自己需要的信息时,您如何期望任何人回答您的问题?

标签: android eclipse debugging intellij-idea breakpoints


【解决方案1】:

喂!它很有意思。碰巧的是,昨天我导出了APK 并将其安装在同一设备上。看来,该应用程序的实例并没有让来自 PC 的实例(正在新调试)安装到设备中。但它开始自行运行。并且调试器无法将旧 APK 与新(即使几乎相同)代码连接起来。这解释了:

  1. 为什么两者 IntelliJ IDEA 和 Eclipse 都无法将调试器连接到应用程序
  2. 为什么,从设备上卸载应用程序后,调试启动正常。

从中可以得出什么有趣的结论:

  1. 我们绝不应该混合使用不同类型的安装(来自 PC,来自 SD)。卸载一个,而不是安装另一个。
  2. PC 和 SD 的安装行为不同。这可能会导致其他不良影响。我们应该意识到这一点。

【讨论】:

  • @pPeter Mortensen。谢谢你的版本。只是我不明白为什么我有时会看到一个段落变成完全相同的段落?这是一个错误吗?
【解决方案2】:

根据设备,将其添加到清单中可能会有所帮助。

<uses-permission android:name="android.permission.SET_DEBUG_APP"/>

【讨论】:

  • 你也可以尝试重启ADB,如果还是不行,也许放置:Debug.waitForDebugger()会有所帮助。
  • +1 表示唯一的帮助。如您所见,我找到了其他解决方案,但还是谢谢您。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2021-08-31
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多