您好,欢迎来到花图问答。
搜索
您的当前位置:首页AndroidStudio run testOnly="

AndroidStudio run testOnly="

来源:花图问答

今天做导航栏的适配,除了在模拟器运行,还要在真机测试。
模拟器、vivo手机都没问题,可在华为上却无法安装。
检索了一大圈,换了好几次关键词,才找到了原因。

Note: The Run button builds an APK with testOnly="true", which means the APK can only be installed via adb (which Android Studio uses). If you want a debuggable APK that people can install without adb, select your debug variant and click Build > Build APK(s).

也就是说studio3.0版本开始,run运行生成的apk一定是testonly的,其application中会有 testOnly="true"属性(为了验证,我还反编译查看了),而testonly的软件只能通过adb安装,如果apk脱离studio,不通过adb安装,那么就通过Build>Build Bundle(s) /APK(s)>Build APK(s)来生成apk。

问题解决!

Copyright © 2019- huatuowenda.com 版权所有 湘ICP备2023022495号-1

违法及侵权请联系:TEL:199 1889 7713 E-MAIL:2724546146@qq.com

本站由北京市万商天勤律师事务所王兴未律师提供法律服务