我尝试使用在我们的构建服务器上运行的此脚本从 iOS 模拟器中删除应用程序
#!/bin/Bash
#Go to iOS Sim
cd ~/Library/Application\ Support/iPhone\ Simulator
#Loop through each Version of iOS
for dir in ~/Library/Application\ Support/iPhone\ Simulator/*/
do
dir=${dir%*/}
cd "$dir"
#Check if the iOS version has any apps installed
if [ -d "$dir/Applications" ]; then
echo Applications folder exists in "$dir"
cd "$dir/Applications"
#Delete each app
for app in "$dir/Application/*/"
do
echo $app
if [ "${#app}" -eq 36 ]; then
echo Delete Folder
fi
done
fi
done
我卡在#Delete each
应用程序部分。我想遍历 Applications 文件夹并首先检查文件夹的字符数是否为 36(GUID)然后删除该文件夹