【卡片記憶】快速啓動iOS模擬器

###假定場景ios

我想快速訪問模擬器,
我不想用xcode重複運行,安裝app
我想把ipa包直接分發出去,讓別人快速經過命令行安裝


問題獲得瞭解決,go-swift.net

###查看模擬器的日誌目錄swift

cd ~/Library/Logs/gym

cd ~/Library/Logs/DiagnosticReports/

###模擬器目錄xcode

print("💡 Simulator directory is : \(NSTemporaryDirectory())")

~/Library/Developer/CoreSimulator/Devices/<模擬器設備id>/data/Containers/Containers/Data/Application/<應用id>/tmp

###解決方案app

//獲取幫助
xcrun simctl help

//查看當前設備的模擬器列表
xcrun simctl list

//安裝到模擬器

xcrun simctl install booted xxx.app

//啓動模擬器
xcrun instruments -w "iPhone 6 (8.3 Simulator)"

//啓動某一應用
xcrun simctl install "iPhone 6" com.cn.goswift //com.cn.goswift是bundle id

//卸載應用

xcrun simctl uninstall "iPhone 6" com.cn.goswift //com.cn.goswift是bundle id

啓動apple watch
xcrun simctl launch "iPhone 6" com.goswift.watchkitapp 

//使用模擬器代開網頁 不用手動輸入

xcrun simctl openurl booted http://www.go-swift.net

//錄製模擬器視頻
xcrun simctl io booted recordVideo <filename>.<extension>

//模擬器截屏
xcrun simctl io booted screenshot

引用連接:點擊ide

###獲取幫助url

創新源於一種感受! http://go-swift.net.net

二維碼

相關文章
相關標籤/搜索