分多个AndroidManifest.xml来控制项目编译

使用场景

  • 公司项目和我的项目的AndroidManifest.xml混在一起,我需要区分开来编译观察app运行

1.在app/src/main/ 下写多个AndroidManifest.xml

  1. AndroidManifest.own.xml
  2. AndroidManifest.com.xml

2.编写powershell脚本

  1. 第一对脚本com-build.ps1reset-com-manifest.ps1
powershell 复制代码
# com-build.ps1 这行可以删掉
Move-Item -Path .\app\src\main\AndroidManifest.com.xml -Destination .\app\src\main\AndroidManifest.xml
Write-Warning "NEXT TIME SWITCH BUILD, do run first: reset-com-manifest.ps1"
# reset-com-manifest.ps1 这行可以删掉
Move-Item -Path .\app\src\main\AndroidManifest.xml -Destination .\app\src\main\AndroidManifest.com.xml

3. 运行步骤

  1. com-build.ps1
  2. 然后在AndroidStudio里面点击按钮编译
  3. reset-com-manifest.ps1

4. 当然你也需要自己项目的编译own-build.ps1和reset-own-manifest.ps1

  • 这里你自己设置

预览


相关推荐
凛_Lin~~1 分钟前
LiveData 源码解析
android·安卓·livedata
hai_android30 分钟前
FusibleFlow:Kotlin Flow 的融合机制原理
android·kotlin
龚寿生1 小时前
23-敏捷开发实战:从Scrum到看板的团队协作方法论
android·学习·scrum·敏捷流程
zhangguojia72 小时前
Activity启动流程(四):从setContentView到View树创建与Window挂载
android
三少爷的鞋5 小时前
Kotlin 2026:裁员、AI、Rust——黄金时代结束了吗?Jake Wharton 为你解答
android
alexhilton5 小时前
从零开始的架构测试套件
android·kotlin·android jetpack
finhaz6 小时前
台电x98plus在安卓x86的使用
android·平板·安卓x86
事圆则缓6 小时前
遗留项目改造实战指南:从可读性、代码质量到性能和 AI 约束
android·ai·代码规范
mmsx7 小时前
Android 手簿 ADB 无线调试全攻略:USB 转 WiFi 一键连接
android·前端