Mac清理Xcode缓存脚本

2018-04-03  本文已影响72人  面试小集

由于电脑存储空间有限,总是要定期清理Xcode缓存,所以写了一个脚本,提高效率,需要的朋友可以替换一下路径,方面使用。

#!usr/bin/python
#-*-coding:UTF-8-*-

import os
from subprocess import call 

path1 = "/Users/river/Library/Developer/Xcode/DerivedData"
path2 = "/Users/river/Library/Developer/Xcode/Archives"
path3 = "/Users/river/Library/Developer/CoreSimulator/Devices"
path4 = "/Users/river/Library/Developer/XCPGDevices"


os.chdir(path1)
os.system('pwd')
os.system('rm -rf *')
print 'DerivedData文件清理完成'

os.chdir(path2)
os.system('pwd')
os.system('rm -rf *')
print 'Archives文件清理完成'

os.chdir(path3)
os.system('pwd')
os.system('rm -rf *')
print 'CoreSimulator/Devices文件清理完成'

os.chdir(path4)
os.system('pwd')
os.system('rm -rf *')
print 'XCPGDevices文件清理完成'
上一篇 下一篇

猜你喜欢

热点阅读