使用bash脚本在Info.plist中添加/替换URL方案 [英] Add/Replace URL Scheme in Info.plist using bash script

查看:109
本文介绍了使用bash脚本在Info.plist中添加/替换URL方案的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用bash脚本/命令在Info.plist文件中添加/替换URL方案.

I want to add/replace the URL scheme in Info.plist file using bash script/command.

我尝试了使用sed命令的各种模式,但没有成功.

I tried with sed command with various patterns but not succeeded.

我们想使用Jenkins自动生成版本,并且可以针对各种版本更改我们的URL方案,因此我们想要修改Info.plist文件,以便我们可以在不存在的情况下添加新的URL方案或替换现有的URL方案.一个使用脚本/命令.

We want to automate the build generation using Jenkins and our URL Scheme can be changed for various builds, so we want to modify the Info.plist file such that we can either add a new URL Scheme if not there or replace the existing one using script/commands.

请建议使用该命令来实现.

Please suggest the command to achieve this.

推荐答案

我们可以使用awk命令而不是sed轻松实现复杂的事情.

We can use awk command to achieve complex things easily instead of sed.

我可以通过"Ed Morton"的帮助完成任务,如

I am able to accomplish the task by the help of "Ed Morton" as in sed : Insert lines after specific pattern with newline

这篇关于使用bash脚本在Info.plist中添加/替换URL方案的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆