「IOS入門」ipa書き出しをxcodebuildとccrunで自動化する手順

1.ipaを作成するプロセス
xcodebuildでプロジェクトソースをコンパイルしてxxx.cppに生成する
xcrunでxxx.cppを署名してxxx.ipaを生成する

2.操作手コマンド
xcodebuild clean
xcodebuild
xcrun -sdk iphoneos PackageApplication -v path/To/xxx.app -o xxx.ipa

3.getopsコマンドを使用
#!/bin/bash
while getopts h:ms option
do
case “$option" in
h)
echo “option:h, value $OPTARG"
echo “next arg index:$OPTIND";;
m)
echo “option:m"
echo “next arg index:$OPTIND";;
s)
echo “option:s"
echo “next arg index:$OPTIND";;
\?)
echo “Usage: args [-h n] [-m] [-s]"
echo “-h means hours"
echo “-m means minutes"
echo “-s means seconds"
exit 1;;
esac
done

4.xcodebuildを使用する
sage: xcodebuild [-project <projectname>] [[-target <targetname>]…|-alltargets] [-configuration <configurationname>] [-arch <architecture>]… [-sdk [<sdkname>|<sdkpath>]] [<buildsetting>=<value>]… [<buildaction>]…
xcodebuild -workspace <workspacename> -scheme <schemeName> [-configuration <configurationname>] [-arch <architecture>]… [-sdk [<sdkname>|<sdkpath>]] [<buildsetting>=<value>]… [<buildaction>]…
xcodebuild -version [-sdk [<sdkfullpath>|<sdkname>] [<infoitem>] ]
xcodebuild -list [[-project <projectname>]|[-workspace <workspacename>]]
xcodebuild -showsdks
Options:
-usage print full usage
-verbose provide additional status output
-project NAME build the project NAME
-target NAME build the target NAME
-alltargets build all targets
-workspace NAME build the workspace NAME
-scheme NAME build the scheme NAME
-configuration NAME use the build configuration NAME for building each target
-xcconfig PATH apply the build settings defined in the file at PATH as overrides
-arch ARCH build each target for the architecture ARCH; this will override architectures defined in the project
-sdk SDK use SDK as the name or path of the base SDK when building the project
-parallelizeTargets build independent targets in parallel
-jobs NUMBER specify the maximum number of concurrent build operations
-showsdks display a compact list of the installed SDKs
-list lists the targets and configurations in a project, or the schemes in a workspace
-find BINARY display the full path to BINARY in the provided SDK
-version display the version of Xcode; with -sdk will display info about one or all installed SDKs

IOS

Posted by arkgame