Android Studio生成的<module>/release/output.json是什么 [英] What is the <module>/release/output.json generated by Android Studio
问题描述
我最近注意到每次运行 Build
时,Android Studio 3 Canary 1 都会在
生成一个新文件 -> Generate Signed APK...
,内容如下.
I recently noticed a new file generated at <module>/release/output.json
by Android Studio 3 Canary 1 each time I run Build
-> Generate Signed APK...
, which has contents that look like following.
有人也能确认看到这种行为吗?还是因为我的笔记本电脑上的一些本地配置?
Can anyone confirm seeing this behavior as well? Or is it due to some local configuration on my laptop?
谁能解释一下这个文件的用途?添加到 .gitignore
是否安全?
And can anyone explain the purpose of this file? Is it safe to add to .gitignore
?
[{
"outputType": {
"type": "APK"
},
"apkInfo": {
"type": "MAIN",
"splits": [],
"versionCode": 32
},
"outputFile": {
"path": "/path/to/the/generated/release/filename.apk"
},
"properties": {
"packageId": "com.example.android",
"split": ""
}
}]
推荐答案
Android studio 3.0 负责这个文件.您无需担心 output.json 文件.
Android studio 3.0 is responsible for this file. You don't need to worry about the output.json file.
让我向你解释一下:
对于旧版本,Android Studio 所做的是生成一个签名的 APK 并将其放在输出"文件夹中.即使您的 APK 有多个风味维度,它们也可以位于同一目录中,即输出文件夹.从最新版本的 Android Studio 3.0(金丝雀和稳定版)开始,他们已经组织了这种文件结构.对于每个风味维度,每当您签署 APK 时,它都会有一个单独的文件夹,其中包含相应的 output.json 文件.这个文件实际上只是对源 APK 的描述.如您所见,您在此处共享的文件描述了已发布的 APK.
For older versions, what Android Studio did was generate a signed APK and put it in the "output" folder. Even If you had multiple flavour dimensions for your APK, all of them could be located at the same directory, which was the output folder. From the latest release of Android Studio 3.0 (canary and stable), they have organized this file structure. For every flavour dimension, whenever you sign an APK, it will have a separate folder with a corresponding output.json file in it. This file is actually nothing but a description of the source APK. As you can see, the file you shared here is describing the released APK.
这篇关于Android Studio生成的<module>/release/output.json是什么的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!