分多个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

  • 这里你自己设置

预览


相关推荐
alexhilton23 分钟前
使用Android Archive进行打包
android·kotlin·android jetpack
badhope2 小时前
做了几年安卓开发,这些坑我帮你踩过了
android·android studio
逐光老顽童2 天前
Java 与 Kotlin 混合开发避坑指南:30 个真实案例实录
android·kotlin
爱勇宝3 天前
鸿蒙生态的下半场:开发者不只要能开发,还要能赚钱
android·前端·程序员
Yeyu3 天前
刷新一帧的艺术:invalidate / postInvalidate / postInvalidateOnAnimation全解析
android
潘潘潘3 天前
Android OTA 升级原理和流程介绍
android
plainGeekDev3 天前
null 判断 → Kotlin 可空类型
android·java·kotlin
plainGeekDev3 天前
getter/setter → Kotlin 属性
android·java·kotlin
YXL1111YXL3 天前
Handler 消息回收与协程异步执行的时序陷阱
android
恋猫de小郭3 天前
KMP / CMP 鸿蒙版本 Beta 发布,他有什么特别之处?
android·前端·flutter