# 执行解压操作 os.chdir(rootPath) # 新建文件夹 folder = endingFile #获取此py文件路径,在此路径选创建在new_folder文件夹中的test文件夹 if not os.path.exists(folder): os.makedirs(folder) os.chdir(folder) os.system(unzipStr) # 在当前文件夹下遍历解压获得的.o # for tempFile in glob.glob("*.txt"):
for tempFile in os.listdir(folder): if tempFile.endswith(".o"): checkStr = 'otool -l ' + tempFile + ' | grep bitcode' output = commands.getstatusoutput(checkStr) keyword = 'bitcode' # print output if keyword not in output[1]: if folder not in unsupports: print checkStr unsupports.append(folder) break
for root, dirs, files in os.walk(rootPath): for file in files: if file.endswith(".a"): fileList.append(os.path.join(root, file))