Android testonly一直为true的问题

最近用Android Studio(以下简称AS)写了一个小的app,调试的时候一切正常,但是在手机上安装或者是用adb安装的时候就提示失败,下图是adb安装时提示的错误:

Android testonly一直为true的问题Android testonly一直为true的问题Android testonly一直为true的问题

本人也是费了九牛二虎之力,才找到了解决方法,多话不说,直接上答案:

在新版AS(本人使用的是 3.0.1)中,点Android testonly一直为true的问题这个绿三角生成的apk,都会被标记为test only。

正确的做法是选择Build APK(s),如下图所示:

Android testonly一直为true的问题