我发现在Android studio项目中有一个名为androidTest的文件夹,如果我不在Android studio中做测试,我可以删除文件夹androidTest吗?
是的,如果你不想用它,你可以删除它
是的,如果你不使用单元测试,你可以删除两个包名(test)和(androidTest)结束。
为了减少apk的大小,你可以删除下面与Test
相关的库testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
除了删除依赖项和文件夹,还要确保删除:
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
为了不得到更多的错误,
删除这个后,我的apk大小减少了大约300 KB。
//欢呼
是,你可以删除它们,你可以去build.gradle
,然后删除下列依赖项,这些依赖项是在任何新的android项目中预装的。
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
,然后点击androidTest
和Test
包,按下Delete
,他们将被删除!
testimplationand androidtestimplationand androidtestimplationand androidtestimplation不属于Apk大小
testimimplementation中的test部分讲述了一个不同的风格,它不是发布版本的一部分。