3

从eclipse启动模拟器后,我启动我的练习应用程序在调试下运行。每次控制台说应用程序已加载并在设备上启动时,但什么都没有发生。调试会话永远不会开始。永远不会显示模拟器上显示“等待调试器”的警报消息。我后来检查并看到应用程序已成功加载,我可以从模拟器运行,但没有调试器。在这个过程中是否缺少某些东西,是否有某种标志要设置,在某处说 debug=true?任何人都可以提供建议吗?

我的清单文件是:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.example.tryit1"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="16"
        android:targetSdkVersion="15" />
    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name=".Tryit1Activity"
            android:label="@string/title_activity_tryit1" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application> </manifest>

以防万一,以下是来自 DDMS logcat 的相关消息:

09-25 12:03:56.962: W/ActivityManager(694): No content provider found    for permission revoke: file:///data/local/tmp/tryit1.apk  
09-25 12:03:57.272: W/ActivityManager(694): No content provider found for    permission revoke: file:///data/local/tmp/tryit1.apk
09-25 12:04:00.830: I/PackageManager(694): Removing non-system package:com.example.tryit1 
09-25 12:04:00.865: I/ActivityManager(694): Force stopping package com.example.tryit1 uid=10044 
09-25 12:04:01.893: I/PackageManager(694): Package com.example.tryit1 codePath changed from /data/app/com.example.tryit1-1.apk to /data/app/com.example.tryit1-2.apk; Retaining data and using new 
09-25 12:04:01.981: I/PackageManager(694): Running dexopt on: com.example.tryit1 
09-25 12:04:05.004: I/ActivityManager(694): Force stopping package com.example.tryit1 uid=10044 
09-25 12:04:05.043: W/PackageManager(694): Code path for pkg : com.example.tryit1 changing from /data/app/com.example.tryit1-1.apk to /data/app/com.example.tryit1-2.apk 
09-25 12:04:05.111: W/PackageManager(694): Resource path for pkg : com.example.tryit1 changing from /data/app/com.example.tryit1-1.apk to /data/app/com.example.tryit1-2.apk 
09-25 12:04:05.560: D/PackageManager(694): New package installed in /data/app/com.example.tryit1-2.apk 
09-25 12:04:06.007: I/ActivityManager(694): Force stopping package com.example.tryit1 uid=10044 
09-25 12:04:08.161: D/BackupManagerService(694): Received broadcast Intent { act=android.intent.action.PACKAGE_REMOVED dat=package:com.example.tryit1 flg=0x8000010 (has extras) } 
09-25 12:04:08.800: D/BackupManagerService(694): Received broadcast Intent { act=android.intent.action.PACKAGE_ADDED dat=package:com.example.tryit1 flg=0x8000010 (has extras) }
4

1 回答 1

2

开始调试:

  1. 你应该去ddms
  2. 选择您的申请流程
  3. 单击贪婪错误按钮(之后此错误应出现在您的进程附近)

在此处输入图像描述

您还应该检查android:debuggableAndroidManifest.xml 中应用程序的属性是否设置为 true。

于 2012-09-25T21:04:12.990 回答