2017年10月17日 星期二

如何解決Xcode indexing paused的問題

今天分享如何解決Xcode在執行測試時遇到的indexing paused的問題,遇到這個問題時會導致Xcode無法順利的執行測試,例如無法順利地利用模擬器或真機做測試而一直卡在那裡,如下畫面:



而在網路上找到的解決方法有: (以下舉例我找到的答案)
  1. Open your Project Folder.
  2. Find ProjectName.xcodeproj file.
  3. Right-Click Copy and Paste to Safe Place.
  4. Right-Click Show Package Contents.
  5. Find project.xcworkspace file and delete that file.
  6. Reopen Your Project and clean and Rebuild.
或是
  1. Deleting "Derived Data" in the Organizer, and re-open and workspace. (fail to fix)
  2. "Show Package Contents" on the .xcodeproj file and deleting .xcworkspace
甚至有附上語法
rm -frd ~/Library/Developer/Xcode/DerivedData/*

rm -frd ~/Library/Caches/com.apple.dt.Xcode/*

不幸的是,上述的方法在我自己嘗試以後都無法解決!

在我折騰一番之後我發現另一個解法,首先去工具列的Product --> Scheme --> Edit Scheme...,如下圖




按下去之後會看到如下畫面




點擊左側的Run,然後在右邊的畫面中找到Launch的地方,這邊預設會是Wait for executable to be launched,將它改成Automatically然後按下Close並且執行,理論上這時候就可以解決indexing paused卡住的問題了





參考網址:
1. https://stackoverflow.com/questions/13831559/xcode-stuck-on-indexing

2. https://stackoverflow.com/questions/26494082/swift-xcode-index-freezing-or-slow

沒有留言:

張貼留言

解決iOS 14上如果更換預設瀏覽器(例如從Safari換成Chrome)時, 用Scheme架構會無法回到上一頁的問題

 如果遇到以下問題時 須在Info裡的LSApplicationQueriesSchemes裡設定多增加https, 如下圖: