大佬教程收集整理的这篇文章主要介绍了为什么Android Studio 3.0.0在APK上设置FLAG_TEST_ONLY?,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
当我启动一个全新的应用程序并构建它时,以下代码(在应用程序内)显示已设置FLAG_test_ONLY标志.
Log.e(tag,"ApplicationInfo: " + (getApplicationInfo().flags & ApplicationInfo.FLAG_test_ONLY)); 10-31 09:54:05.226 16129-16129/com.example.dummy E/MainActivity: ApplicationInfo: 256@H_607_10@该应用程序的清单是:
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://scheR_504_11845@as.android.com/apk/res/android" package="com.example.dummy"> <application android:allowBACkup="true" android:icon="@mipmap/ic_launcher" android:label="@String/app_name" android:rounDicon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/AppTheme"> <activity android:name=".MainActivity"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest>@H_607_10@该标志使设备策略控制器无法安装它:Upgrading app in background using Device Policy Controller
为什么设置此标志,以及如何阻止它被设置?
如果您以其他方式构建APK,则不应添加该标志.具体来说,我使用了assembleRelease Gradle任务.我希望Android studio中的“Build APK(s)”菜单选项也能正常工作.
鉴于Instant Run和其他潜在的恶作剧,Android studio可能会为直接运行的版本而不是其他版本,我对他们添加此标志并不感到惊讶.就个人而言,我希望有一个更明确的选择,可以选择退出所有这些恶作剧(也许这个标志),因为我是那些希望我从IDE运行的应用程序与我的用户运行的应用程序相同的怪人之一.
FWIW,我在this blog post有更多的背景知识.
以上是大佬教程为你收集整理的为什么Android Studio 3.0.0在APK上设置FLAG_TEST_ONLY?全部内容,希望文章能够帮你解决为什么Android Studio 3.0.0在APK上设置FLAG_TEST_ONLY?所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。