xcode脚本

一、自动增加脚本

点击添加按钮


xcode脚本_第1张图片
屏幕快照 2018-08-28 11.16.28 PM.png

点击添加按钮


xcode脚本_第2张图片
屏幕快照 2018-08-28 11.18.16 PM.png

添加脚本

  buildNumber=$(/usr/libexec/PlistBuddy -c "Print CFBundleVersion" "$INFOPLIST_FILE")
  buildNumber=$(($buildNumber + 1))
  /usr/libexec/PlistBuddy -c "Set :CFBundleVersion $buildNumber" "$INFOPLIST_FILE"

编译运行、查看build version (递增)


xcode脚本_第3张图片
屏幕快照 2018-08-28 11.20.23 PM.png
二、运行shell脚本

新建target


xcode脚本_第4张图片
屏幕快照 2018-09-02 03.30.59 PM.png

选择scheme


屏幕快照 2018-09-02 03.32.44 PM.png

添加shell脚本
xcode脚本_第5张图片
20150116172903615.jpeg
xcode脚本_第6张图片
20150116172928125.jpeg
xcode脚本_第7张图片
20150116173048463.jpeg
xcode脚本_第8张图片
20150116173126402.jpeg

编译运行

xcode脚本_第9张图片
20150116173146932.jpeg

相关问题

1、shell脚本不能带.sh后缀,否则没法选择
2、Found an unexpected Mach-O header code: 1869112165错误:解决的办法,shell脚本中必须带#!/bin/sh。
 There is an problem launching using posix_spawn (error code: 8).错误:解决的办法,shell脚本中必须带#!/bin/sh
xcode脚本_第10张图片
20150116173522546.jpeg
3、'/Users/user/lcg/code/ShellDemo/ShellDemo/print' doesn't contain the architecture x86_64h错误,这个错误在xcode5.1版本不会出现,解决的办法是,去掉勾选Debug executable

你可能感兴趣的:(xcode脚本)