最近上传ipa文件总是收到如下内容的邮件:
自己很明确项目中并没有使用到,那最大可能就是第三方的库中使用了或者出现的UIWebView等关键词;
那么如何检查哪个第三方库使用到了呢?使用命令行
1、终端cd到自己项目根目录下
2、复制一下命令到终端并执行
find . \( -name "*.framework" -o -name "*.a" \) -exec sh -c '
usefullArray=();
echo "------------< search in *.framework & *.a>-------------"
for file do
if nm "$file"/`basename "$file" | sed -e s/\\.framework$//g` 2>/dev/null | grep UIWebView > /dev/null;
then
usefullArray+=("$file")
#echo "⚠️ UIWebView appears in "$file"";
else
echo "✅ UIWebView does not appear in "$file"";
fi;
done
echo "------------------------------------------------"
for i in "${usefullArray[@]}"
do
echo "⚠️ UIWebView appears in "$i"";
done
echo "------------------------------------------------"
echo " Done!"
' sh {} +
3、也可以复制下面的
find . \( -name "*.framework" -o -name "*.a" -o -name "*.h" -o -name "*.m" -o -name "*.swift" \) -exec sh -c '
usefullArray=();
echo "------------< search in *.framework & *.a & .h. m .swift>-------------"
for file do
if nm "$file"/`basename "$file" | sed -e s/\\.framework$//g` 2>/dev/null | grep UIWebView > /dev/null;
then
usefullArray+=("$file")
#echo "⚠️ UIWebView appears in "$file"";
else
echo "✅ UIWebView does not appear in "$file"";
fi;
done
echo "------------------------------------------------"
for i in "${usefullArray[@]}"
do
echo "⚠️ UIWebView appears in "$i"";
done
echo "------------------------------------------------"
echo " Done!"
' sh {} +