Snippets de terminal para desenvolvimento iOS

Lembre-se de substituir o seguinte:
* {USER_NAME}pelo nome de usuário do sistema
* {API_KEY}pela chave da API do TestFlight.
* {TEAM_KEY}com sua chave de API TestFlight Team.

# ---------------------------------
# xcode functions
# ---------------------------------
function xcclean() {
# Cleans the project via xctool CLI for workspace [$1] and scheme [$2] respectively.
if [ -z "$2" ]
then
echo
"Workspace: "$1"".""
xctool
-workspace ""$1.xcworkspace"" -scheme ""$1"" -sdk iphonesimulator clean
else
echo
""Workspace: ""$1"". Scheme: ""$2"".""
xctool
-workspace ""$1.xcworkspace"" -scheme ""$2"" -sdk iphonesimulator clean
fi
}

function xcbuild() {
# Builds project via xctool CLI for workspace [$1] and scheme [$2] respectively.
if [ -z ""$2"" ]
then
echo
""Workspace: ""$1"".""
xctool
-workspace ""$1.xcworkspace"" -scheme ""$1"" -sdk iphonesimulator build
else
echo
""Workspace: ""$1"". Scheme: ""$2"".""
xctool
-workspace ""$1.xcworkspace"" -scheme ""$2"" -sdk iphonesimulator build
fi
}

function xctest() {
# Runs unit tests via xctool CLI for workspace [$1] and scheme [$2] respectively.
if [ -z ""$2"" ]
then
echo
""Workspace: ""$1"".""
xctool
-workspace ""$1.xcworkspace"" -scheme ""$1"" -sdk iphonesimulator test -parallelize
else
echo
""Workspace: ""$1"". Scheme: ""$2"".""
xctool
-workspace ""$1.xcworkspace"" -scheme ""$2"" -sdk iphonesimulator test -parallelize
fi
}

function xcbuildtests() {
# Build tests without re-building the project (good for testing SDKs) via xctool CLI for workspace [$1] and scheme [$2] respectively.
if [ -z ""$2"" ]
then
echo
""Workspace: ""$1"".""
xctool
-workspace ""$1.xcworkspace"" -scheme ""$1"" -sdk iphonesimulator build-tests
else
echo
""Workspace: ""$1"". Scheme: ""$2"".""
xctool
-workspace ""$1.xcworkspace"" -scheme ""$2"" -sdk iphonesimulator build-tests
fi
}

function xcruntests() {
# Runs tests from build-test command (good for testing SDKs) via xctool CLI for workspace [$1] and scheme [$2] respectively.
if [ -z ""$2"" ]
then
echo
""Workspace: ""$1"".""
xctool
-workspace ""$1.xcworkspace"" -scheme ""$1"" -sdk iphonesimulator run-tests -parallelize
else
echo
""Workspace: ""$1"". Scheme: ""$2"".""
xctool
-workspace ""$1.xcworkspace"" -scheme ""$2"" -sdk iphonesimulator run-tests -parallelize
fi
}

function xcall() {
# Cleans and builds project