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

使用场景

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

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

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

2.编写powershell脚本

  1. 第一对脚本com-build.ps1和reset-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

  • 这里你自己设置

预览


相关推荐
三少爷的鞋3 小时前
Kotlin 协程,重点就在「协」这个字上
android·kotlin
好的佩奇3 小时前
Dart 之模式
android·flutter·dart
淡淡的香烟5 小时前
Flutter实现多语言切换
android·flutter·1024程序员节
AIsoft_86897 小时前
手机视频转文字工具清单:哪些APP支持录屏识别
android·音视频
_祝你今天愉快10 小时前
Paint Cavans高级绘制:[一]Paint画笔高级应用
android
@zulnger11 小时前
安卓进行稳定性测试
android·appium·1024程序员节
不吃凉粉11 小时前
android 副屏连接
android
zzu123zsw12 小时前
当 GPU 加速渲染遇上无头组件:拆解 Yororen UI 在 GPUI 生态下的状态解耦与 XML 模板实践
xml·ui·rust·gui·gpui
OxYGC13 小时前
手机为什么能“自动跳过“开屏广告?李跳跳、GKD 与 iOS 代理软件原理盘点
android·ios·开屏广告·广告屏蔽
Android-Flutter21 小时前
Compose 管理状态 详解
android·compose