Created
May 31, 2019 01:44
-
-
Save victorchee/799c30dfb3a91d09780840ba27d46bd3 to your computer and use it in GitHub Desktop.
Find hot patch in Xcode project.
This file contains hidden or 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
#!/bin/sh | |
echo "请输入需要检测的工程路径" | |
read path | |
if [ ${#path} = 0 ] | |
then | |
echo "请在.sh文件后面添加路径" | |
exit | |
fi | |
cd $path | |
echo "当前路径为`pwd`" | |
#搜索目录下面的.a文件 | |
for i in `find . -name *.a`; do | |
# echo $i | |
i_=${i##*/} | |
# echo $i_ | |
i_=${i_%.a} | |
# echo $i_ | |
nm -n $i >> "$i_.txt" | |
grep 'dlopen' "$i_.txt" >/dev/null 2>&1 || grep 'dlsym' "$i_.txt" >/dev/null 2>&1 | |
if [[ $? == 0 ]]; then | |
echo "$i_ 中有dlopen dlsym" | |
fi | |
rm $i_.txt | |
done | |
#搜索目录下面的framework | |
for i in `find *.framework/ */*.framework/ -size +100k`; do | |
# echo $i | |
i_=${i##*/} | |
# echo $i_ | |
nm -n $i >> "$i_.txt" | |
grep 'dlopen' "$i_.txt" >/dev/null 2>&1 || grep 'dlsym' "$i_.txt" >/dev/null 2>&1 | |
if [[ $? == 0 ]]; then | |
echo "$i_ 中有dlopen dlsym" | |
fi | |
rm $i_.txt | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment