yii.
← Writing
開發筆記 · · 1 min read

Xcode | 問題 | 模擬器無法開啟(Unable to boot device due to insufficient system resources)

這篇寫於 2019 年。工具和 API 變化很快,部分步驟可能已經不適用。

紀錄開發時發現的問題

原因#

在開啟模擬器準備運行的時候跳出錯誤

解決#

通常會跳出視窗,顯示這些訊息

Please see Simulator Help for information on adjusting system settings to allow more simulated devices to boot at once.

maxUserProcs: 10533, runningUserProcs: 705, enforcedProcBuffer: 233

很像是跟系統記憶體有關的問題,可以使用這兩個方式來改進,在Terminal視窗輸入,後面的數值依照個人的環境去調整

1. sudo launchctl limit maxproc 2000 2500
2. sudo launchctl limit maxfiles 65536 200000

最後模擬器又能正常運行拉~

參考#

  1. https://stackoverflow.com/questions/46819134/how-do-i-adjust-the-system-settings-to-allow-more-simulated-devices-to-boot-at-o

本文原刊登於 Medium。