美文网首页
Xcode自测项目里是否有UIWebview

Xcode自测项目里是否有UIWebview

作者: 小y想吃糖 | 来源:发表于2020-05-08 15:16 被阅读0次

在项目跟目录下,创建一个.py为结尾的文件,例如checkUIWebview.py,复制下面代码进去。

#!/usr/bin/python

# -*-coding:utf-8 -*-=

import os

importcommands

defmain():

    forpath, dir_list, file_listinos.walk('./'):

        forfile_nameinfile_list:

            # 略过 .DS_Store 文件

            iffile_name.find('.DS_Store') !=-1:

                continue

            # 略过 没有framework  .a 的文件

            ifpath.find('.framework') ==-1andfile_name.find('.a') ==-1:

                continue

            full_path = os.path.join(path, file_name)

            # print(full_path)

            iffull_path.endswith('.h'):

                continue

            (status, output) = commands.getstatusoutput('file %s'% full_path)

            index = output.find('Mach-O universal binary')

            ifindex !=-1:

                # print(full_path)

                (status, output) = commands.getstatusoutput('strings %s | grep -ir "uiwebview"'% full_path)

                iflen(output) >0:

                    print full_path

if__name__ =="__main__":

    print('Start to check library')

    main()

保存打开终端,cd到项目,然后执行以下命令

python /项目路径/checkUIWebview.py

出现的路径文件即含有UIWebview。

相关文章

网友评论

      本文标题:Xcode自测项目里是否有UIWebview

      本文链接:https://www.haomeiwen.com/subject/tdmfnhtx.html