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

  • 这里你自己设置

预览


相关推荐
云水一下1 小时前
零基础玩转bWAPP靶场(三十):XML/XPath 注入(登录表单)
xml·web安全·bwapp
爱笑鱼2 小时前
Binder(八):远端进程死了,BinderProxy 为什么还能收到通知?
android
Android-Flutter2 小时前
Kotlin 冷流与热流详解
android·kotlin
zhangphil2 小时前
Android ContentProvider/ContentResolver读图片,跨进程 IPC慢
android
yueqc12 小时前
Android .so 文件压缩
android·so·包体积
龚礼鹏3 小时前
深入解析 Android Automotive (AAOS) 启动流程与 CarService 核心机制(基于 Android 16 最新源码视角)
android
rosmis3 小时前
agent各指标定义
android·java·开发语言
风样滴男人哟4 小时前
PHP特性之反射类ReflectionClass机制
android·开发语言·php
小孔龙5 小时前
RenderNode 与 DisplayList:Android 硬件加速的绘制记录与复用
android·性能优化
云水一下5 小时前
零基础玩转bWAPP靶场(三十一):XML/XPath 注入(搜索)
xml·web安全·bwapp