iPhone Simulator location

前端 未结 17 2041
时光取名叫无心
时光取名叫无心 2020-12-12 10:32

Where on my machine is the iPhone simulator installed?

I\'m been trying to find where a test application I run in the simulator is stored.

17条回答
  •  独厮守ぢ
    2020-12-12 10:59

    A super simple and sexy way is to use Apple Script:

    property findtype : quoted form of "kMDItemContentType = \"com.apple.application-bundle\""
    
    set simulatorFolder to POSIX path of (path to application support folder from user domain) & "iPhone Simulator/"
    set appFiles to paragraphs of (do shell script "mdfind -onlyin " & quoted form of simulatorFolder & " " & findtype)
    if appFiles is not {} then
        set mostRecentApp to item 1 of appFiles
        tell application "Finder" to reveal ((POSIX file mostRecentApp) as alias)
        tell application "Finder" to activate
    end if
    

    Paste this into Apple Script Editor and export it as a Mac app. Then you can just run the app whenever you need a Finder window open in the sandbox. The code is courtesy StefanK at MacScripter.

提交回复
热议问题