Skip to content

Commit 5213787

Browse files
author
xixi
committed
init
init
1 parent 02e853a commit 5213787

File tree

2 files changed

+71
-0
lines changed

2 files changed

+71
-0
lines changed

demo.sh

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
function getfiles(){
2+
for file in `ls $1`
3+
do
4+
if [ -d $1"/"$file ]
5+
then
6+
echo $1"/"$file
7+
getfiles $1"/"$file
8+
else
9+
# 这里是对文件的操作,可以是移动,删除,复制,
10+
# 也可以在对文件进行判断,支队指定类型的文件进行操作
11+
echo $file
12+
find $file;
13+
fi
14+
done
15+
}
16+
17+
18+
function find(){
19+
# key='.xcworkspace'
20+
key="pli"
21+
if [[ $1 =~ $key ]]
22+
then
23+
echo "包含"
24+
else
25+
echo "不包含"
26+
fi
27+
}
28+
29+
getfiles $1

demoshell.sh

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
echo "传递参数";
2+
echo "当前脚本路径:$0";
3+
4+
PROJECT_PATH="$( cd "$( dirname "$0" )" && pwd )";
5+
6+
7+
# 项目target名字
8+
TARGET_NAME=$1
9+
10+
# 打包环境
11+
CONFIGURATION=Release
12+
13+
#工程文件路径
14+
# APP_PATH="${PROJECT_PATH}.xcodeproj" #普通工程
15+
APP_PATH="${PROJECT_PATH}/${TARGET_NAME}.xcworkspace" #带pod工作区
16+
17+
# Xcode clean
18+
xcodebuild clean -workspace "${APP_PATH}" -configuration "${CONFIGURATION}" -scheme "${TARGET_NAME}"
19+
20+
# 打包目录
21+
DESKTOP_PATH="~/Desktop"
22+
23+
# 时间戳
24+
CURRENT_TIME=$(date "+%Y-%m-%d %H-%M-%S")
25+
26+
# 归档路径
27+
ARCHIVE_PATH="${DESKTOP_PATH}/${TARGET_NAME} ${CURRENT_TIME}/${TARGET_NAME}.xcarchive"
28+
29+
30+
# 导出路径
31+
EXPORT_PATH="${DESKTOP_PATH}/${TARGET_NAME} ${CURRENT_TIME}"
32+
33+
34+
# plist路径
35+
PLIST_PATH="${PROJECT_PATH}/ExportOptions.plist"
36+
37+
# archive 这边使用的工作区间 也可以使用project
38+
xcodebuild archive -workspace "${APP_PATH}" -scheme "${TARGET_NAME}" -configuration "${CONFIGURATION}" -archivePath "${ARCHIVE_PATH}"
39+
40+
# # 导出ipa
41+
xcodebuild -exportArchive -archivePath "${ARCHIVE_PATH}" -exportPath "${EXPORT_PATH}" -exportOptionsPlist "${PLIST_PATH}"
42+

0 commit comments

Comments
 (0)