Android Studio: How to debug older version of Android SDK step-by-step

前端 未结 6 1052
醉话见心
醉话见心 2021-01-03 20:43

I have an Android project targetting the Android SDK v21. Now I need to debug it on a device with Android 4.4 (i.e. SDK v20). How do I tell Android Studio to attach an older

6条回答
  •  温柔的废话
    2021-01-03 21:07

    I can not confirm my answer works, but it is working for me.

    I replace my compileSdkVersion, buildToolsVersion, minSdkVersion and targetSdkVersion with new one like following in my build.gradle file.

    android {
          compileSdkVersion 22
          buildToolsVersion "22.0.1"
    
    
    defaultConfig {
        applicationId "com.example.mytest"
        minSdkVersion 15
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'),  'proguard-rules.pro'
             }  
       }
    }
    

    After changing it, you may not need to convert old to new or new to old sdk component.

提交回复
热议问题