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

  • 这里你自己设置

预览


相关推荐
Digitally1 小时前
如何将安卓手机备份到电脑?7种方法
android
火柴就是我2 小时前
android:enableJetifier=true 再学习
android·flutter
杨筱毅2 小时前
【Android】【底层原理】深入解析SELinux模块
android·底层机制
Tom4i3 小时前
基于 Launcher3 的 iOS 风格桌面 04 拖拽和移位
android
2501_915106323 小时前
iOS 反编译防护工具与实战组合 从静态侦察到 IPA 成品加固的工程化路径
android·ios·小程序·https·uni-app·iphone·webview
游戏开发爱好者86 小时前
iOS 26 iPhone 使用记录分析 多工具组合构建全方位设备行为洞察体系
android·ios·小程序·uni-app·cocoa·iphone·webview
zhangphil13 小时前
HARDWARE 属性的Bitmap与普通Bitmap,GPU与RenderThread渲染与处理方式异同比较,Android
android
消失的旧时光-194315 小时前
Flutter 异步编程:Future 与 Stream 深度解析
android·前端·flutter
alexhilton15 小时前
Compose CameraX现已稳定:给Composer的端到端指南
android·kotlin·android jetpack
阿里云云原生17 小时前
移动端性能监控探索:可观测 Android 采集探针架构与实现
android