- 安裝 xcode
- 安裝 xcode command line tool
- 檢查是否安裝 在終端中運行: xcrun simctl list
- 如果出現所有的 Device Types,則可以進行第3步
- 如果出現error:
xcrun: error: unable to find utility "simctl", not a developer tool or in PATH
-
安裝xcode
終端運行: xcode-select --install
-
或者是安裝成功繼續第3步,否則繼續
- 如果出現報錯說command已經存在
xcode-select: error: command line tools are already installed
-
在終端中輸入:
DEVELOPER_DIR="/Applications/Xcode.app/Contents/Developer/"
export DEVELOPER_DIR
- 繼續執行 i步驟,如果出現 Device Types則第3步,如果還是無效則google查詢問題
- 檢查是否安裝 在終端中運行: xcrun simctl list
- 啟動simulator
- 安裝app
終端運行: xcrun simctl install booted <path to app>
- booted表示當前啟動的simulator,可以替換為xcrun simctl list里面的device UDID
- 運行后沒有信息輸出表示安裝成功