ios speed test package

The package only way to test support package

First, add the following script to the project "Run script", then it does not create a

# 如果是Debug环境并且目录存在
if [ "${CONFIGURATION}" = "Debug" ] && [ -d "${BUILD_ROOT}/${CONFIGURATION}-iphoneos" ]
then
# 打开工程目录
cd ${BUILD_ROOT}/${CONFIGURATION}-iphoneos
# 删除Payload避免重复
rm -rf Payload
# 创建Payload文件夹
mkdir Payload
# 拷贝app到Payload
cp -rf ${PROJECT_NAME}.app Payload
# 打包成ipa
zip -r ${PROJECT_NAME}.ipa Payload
# 打开目录
open .
fi

Here to explain what
$ {BUILD_ROOT} is compiled path
$ {CONFIGURATION} is the current build environment
$ {PROJECT_NAME} is the name of the project

Second, the manual script package

# 工程文件路径
APP_PATH=$1
# 获取文件名与后缀 - xxx.xcworkspace
BASE_NAME=$(basename ${APP_PATH})
# 编译工程名
APP_SCHEME=${BASE_NAME%.*}
# 归档路径
ARCHIVE_PATH="/Users/sam/Desktop/${APP_SCHEME}.xcarchive"
# 编译环境
CONFIGURATION=$2
# 导出路径
EXPORT_PATH="/Users/sam/Desktop/${APP_SCHEME}_appstore"
# plist路径
PLIST_PATH=$3

# archive
xcodebuild -workspace "${APP_PATH}" -scheme "${APP_SCHEME}" -configuration "${CONFIGURATION}" -archivePath "${ARCHIVE_PATH}" archive
# 导出ipa
xcodebuild -exportArchive -archivePath "${ARCHIVE_PATH}" -exportPath "${EXPORT_PATH}" -exportOptionsPlist "${PLIST_PATH}"

$ 1, $ 2, $ 3, respectively, are the three parameters are passed in the command, then we run the script

Reference Links:
https://www.jianshu.com/p/d1e7dd688df7

Published 172 original articles · won praise 35 · views 390 000 +

Guess you like

Origin blog.csdn.net/u012198553/article/details/103185855