2016-03-05 116 views
2

如何在Android Studio中調試JUnit測試用例?我放置了一個斷點並使用了「調試測試用例」,但它只是運行代碼並忽略了斷點。在Android Studio中調試測試用例

更新: 這是我的build.gradle內容

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 23 
    buildToolsVersion "23.0.2" 

defaultConfig { 
    applicationId "com.****.mancala" 
    minSdkVersion 18 
    targetSdkVersion 23 
    versionCode 1 
    versionName "1.0" 
} 
buildTypes { 
    release { 
     minifyEnabled false 
     proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
    } 
    debug { 
     debuggable true 
    } 
} 
} 

dependencies { 
    compile fileTree(dir: 'libs', include: ['*.jar']) 
    testCompile 'junit:junit:4.12' 
    compile 'com.android.support:appcompat-v7:23.1.1' 
} 
+0

爲庫項目的androidTest同樣的事情。 Legit斷點簡單地被忽略。 – halxinate

回答

0

確保您的build.gradle文件(一個與所有的依賴),你的調試版本類型中有debuggable true

也只是好措施確保其有效斷點(不空行等)

+0

我把debuggable放在調試部分,但仍然無法正常工作。 – user3273345