《Disney +》 迪士尼、Marvel、彼思、星球大戰…  「Zoff」X「DQ X」聯名款眼鏡確定再度上市!同場加映試戴心得回顧!   TGS2021「光榮特庫摩」線下展場體驗重製版《零~濡鴉之巫女~》的美麗驚悚   在現實世界一起去狩獵吧!USJ首個魔物獵人VR遊戲設施「Monster Hunter World:Iceborne XR WALK」明年春季登場!   必備精選優惠重返PlayStation Store   日本最大數位教育中心「REDEE」開設體驗VR的HTC「VIVE」專區!   在《NBA 2K21》MyTEAM第5季:英雄時代打造超級強隊   PlayStation Store:「雙倍折扣」優惠回歸   《Streets of Rage 4》新「生存」模式創作花絮 

Xcode 清掉 Cache 的方法 – 2019

商業

Xcode 編譯時,都會產生不少 Cache 的檔案,要怎麼清除掉這些檔案呢?

  • 註:目前環境 Xcode 10,目前看到 Xcode 10 以前都沒問題,10 以後還不確定

Xcode 清掉 Cache 的方法

想要清掉 Xcode 產生的 Cache,除了要省空間外,主要是遇到某些情況,想要將環境清乾淨,整個重新編譯,確認問題用。

Xcode 清除 Cache 的步驟

  1. 開啟 Xcode
    1. Command + Shift + K
    2. Command + Option + Shift + K
  2. 開啟 Terminal
    1. ls ~/Library/Developer/Xcode/DerivedData/ModuleCache # 先看看
    2. rm -fr ~/Library/Developer/Xcode/DerivedData/ModuleCache # 擔心的話建議先 mv 到自己目錄
    3. ls -lh "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang.jon/ModuleCache" # path: /var/folders/gq/xxxxxxxxxxxxxxx/C/org.llvm.clang.jon/ModuleCache
    4. rm -fr "$(getconf DARWIN_USER_CACHE_DIR)/org.llvm.clang.jon/ModuleCache" # 擔心的話建議先 mv 到自己目錄
    5. defaults delete com.apple.dt.Xcode # 清掉 xcode build cache

相關網頁

  • 下述摘錄自此篇:Xcode Quick Fix - Clear Cache 此篇作者有直接寫一隻程式:fix-xcode.rb
    1. Clean the Build
      • Command + Shift + K
      • Product → Clean Build Folder
    2. Clean the Build Folder
      • Command + Option + Shift + K
    3. Reset the Simulator Content and Settings
      • Menu Bar → iOS Simulator → Reset Contents And Settings
    4. Delete Derived Data
      • Menu Bar → Window → Organizer → Projects → Select Your Project
    5. Delete the Module Cache
      • rm -fr ~/Library/Developer/Xcode/DerivedData/ModuleCache
    6. Delete Xcode Preferences
      • defaults delete com.apple.dt.Xcode # terminal 直接輸入即可
  • 下述摘錄自此篇:How to clear Xcode cache and stop crashes
    1. clean build: Command + Shift + K
    2. Clean out the build folder: Command + Shift + Option + K
    3. Reset Simulator content and settings: menu → iOS Simulator → click Reset Content and Settings
    4. Delete derived data: rm -fr ~/Library/Developer/Xcode/DerivedData/ModuleCache
    5. Launch Terminal: defaults delete com.apple.dt.Xcode
  • How to Empty Caches and Clean All Targets Xcode 4 and later
  • 乾淨的移除 Xcode - Qiita
Tsung

隨機商業新聞