Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
217 additions
and
458 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
#!/bin/sh | ||
|
||
# 脚本目录和xxx.app要在同一个目录,如果想要配置,请填入包含后缀名的全称 | ||
g_app_name="" | ||
|
||
# 在当前目录下找到 .app 文件 | ||
AutoFindAppFolder() { | ||
for p_file in ./*; do | ||
#判断是否为文件夹 | ||
if [ -d "$p_file" ]; then | ||
file_name=$(basename "$p_file") | ||
#判断后缀名称是否是app | ||
file_last=${file_name##*.} | ||
if [ "$file_last" = "app" ]; then | ||
g_app_name="$file_name" | ||
fi | ||
fi | ||
done | ||
} | ||
|
||
# 读取用户输入 | ||
ReadUserSelectPara() { | ||
if [ -z "$g_app_name" ]; then | ||
# 文件名称为空 | ||
read -r input_name | ||
sleep 0.1 | ||
g_app_name=$input_name | ||
ReadUserSelectPara | ||
else | ||
# 文件名称有效 | ||
echo "*** 当前.app 文件:$g_app_name ***" | ||
fi | ||
} | ||
|
||
# 打包ipa | ||
AppToIpa() { | ||
app_file_name=$1 | ||
# 先删除里面当前的IPAFolder文件夹 | ||
rm -rf IPAFolder | ||
# 再创建IPAFolder文件夹 | ||
mkdir IPAFolder | ||
# 在文件夹里面创建Payload文件夹 | ||
mkdir IPAFolder/Payload | ||
# 将当前目录下的App_Name.app复制到Payload里面 | ||
cp -r "$app_file_name" IPAFolder/Payload/"$app_file_name" | ||
# 进入IPAFolder文件夹 | ||
cd IPAFolder | ||
# 压缩多个目录zip FileName.zip 目录1 目录2 目录3.... | ||
file_head=${app_file_name%.*} | ||
zip -r "$file_head.ipa" Payload | ||
echo "*** ipa 文件已经创建到 IPAFolder 文件夹下 ***" | ||
} | ||
|
||
# 脚本主函数 | ||
Main() { | ||
# 如果未设置,则自动获取一次 | ||
if [ -z "$g_app_name" ]; then | ||
AutoFindAppFolder | ||
fi | ||
# 如果自动获取仍旧为空,则要求用户输入 | ||
if [ -z "$g_app_name" ]; then | ||
echo "*** 请输入.app全名称,包含后缀名 ***" | ||
ReadUserSelectPara | ||
else | ||
# 转换 | ||
AppToIpa "$g_app_name" | ||
fi | ||
} | ||
|
||
cd "$(dirname "$0")" || exit 0 | ||
|
||
# 判断有无传递参数,Python脚本中传递有参数 | ||
if [ -z "$1" ]; then | ||
Main | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
脚本介绍 | ||
1. 图片批处理:image-shell.sh | ||
2. 自动化打包:auto-archive.sh | ||
3. app转ipa:convert-ipa.sh | ||
4. 图像界面 :dev-shell.py | ||
|
||
Python 图像界面仅支持 3.0 以上版本,例如 python3 拖入 dev-shell.py 到终端(注意 python3 后面有一个空格)。 | ||
|
||
------------------------------------------------------- | ||
|
||
# image-shell.sh | ||
直接使用步骤: | ||
1. 将 image-shell.sh 脚本和要处理的图片拖放到同一个文件夹中; | ||
2. 将 image-shell.sh 拖入终端,回车; | ||
3. 根据提示,输入数字1或2或3或4,执行脚本; | ||
4. 脚本会在原图片目录下新建文件夹,处理后的图片在新建文件夹中。 | ||
|
||
使用 Python 图形界面步骤: | ||
1. 将 image-shell.sh 脚本和 dev-shell.py 脚本拖放到同一个文件夹中; | ||
2. 打开终端,输入 python3和一个空格,拖入 dev-shell.py 到终端,回车; | ||
3. 根据图形界面提示,选择文件或者文件夹,点击确定按钮; | ||
4. 脚本会在原图片目录下新建文件夹,处理后的图片在新建文件夹中。 | ||
|
||
------------------------------------------------------- | ||
|
||
# auto-archive.sh | ||
直接使用步骤: | ||
1. 将 auto-archive.sh 脚本复制到文件后缀名 .xcodeproj 所在项目目录下; | ||
2. 将 auto-archive.sh 拖入终端,回车即可; | ||
3. 如果自动打包失败,请打开 auto-archive.sh 配置项目信息; | ||
4. 如果项目目录无 ExportOptions.plist 文件,请参考新建。 | ||
|
||
使用 Python 图形界面步骤: | ||
1. 将 auto-archive.sh 脚本和 dev-shell.py 脚本拖放到同一个文件夹中; | ||
2. 打开终端,输入 python3和一个空格,拖入 dev-shell.py 到终端,回车; | ||
3. 根据图形界面提示,选择文件或者文件夹,点击确定按钮; | ||
4. 如果脚本自动获取失败,请手动配置。 | ||
|
||
------------------------------------------------------- | ||
|
||
# convert-ipa.sh | ||
直接使用步骤: | ||
1. 将 convert-ipa.sh 和 .app 后缀名文件放在同一个文件夹中;; | ||
2. 将 convert-ipa.sh 拖入终端,回车即可; | ||
3. 转换完成的 ipa 文件在 IPAFolder 文件夹中。 | ||
|
||
使用 Python 图形界面步骤: | ||
1. 将 convert-ipa.sh 脚本和 dev-shell.py 脚本拖放到同一个文件夹中; | ||
2. 打开终端,输入 python3和一个空格,拖入 dev-shell.py 到终端,回车; | ||
3. 根据图形界面提示,选择文件,点击确定按钮。 | ||
|
||
|
Oops, something went wrong.