iPhone Simulator location

前端 未结 17 1993
时光取名叫无心
时光取名叫无心 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:58

    With the introduction of CoreSimulator in Xcode 6, each simulated device now has its own data. Previous versions had all devices share the same data for each version of iOS.

    Devices are located in ~/Library/Developer/CoreSimulator/Devices. Logs are located in ~/Library/Logs/CoreSimulator

    Note that ~/Library/Developer/CoreSimulator/Devices//data/Library/Logs is a symlink to ~/Library/Logs/CoreSimulator/.

    CoreSimualtor will create an initial set of devices on first use (and after installation of older simulator runtimes). You can add or delete new devices from within Xcode.app or from the command line using 'xcrun simctl create' or 'xcrun simctl delete'

    0 讨论(0)
  • 2020-12-12 10:58

    As of 4.3.2 of Xcode for Lion, the iOS simulator is located in the contents of the app package... If you right click on xcode.app and click "Show package contents" then navigate to Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications there you will find the iOS Simulator app... Just drag it to your dock and there you go... Or you can make an Alias and drag that to your desktop (or wherever you want) for easy access to the simulator... Why Apple decided to bury it in the package, I have no clue.

    0 讨论(0)
  • 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.

    0 讨论(0)
  • 2020-12-12 11:01

    The top answer is correct for location of the simulator app. But there is a secondary location where the example apps (and your app builds) are stored for the simulator to access. This is:

    ~/Library/Developer/CoreSimulator/Devices

    Each subdir is a device ID. You can find where your app is by looking in each of these dirs at data/Containers/Bundle/Application/{app_id}

    0 讨论(0)
  • 2020-12-12 11:02

    Update for Xcode 4.4: While the iPhone simulator is still in the same place, Apple has included a shortcut to the iPhone Simulator at:

    /Applications/Xcode.app/Contents/Applications
    

    Changes since Xcode 4.3.1

    Please note that the new version of Xcode is now available on the Mac App Store. Hence all the stuff that used to come with an installer is now packaged into Xcode.app.

    Therefore the iOS Simulator binary is located here:

    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/
    

    The Apps installed in the simulator along with other configuration files are still here:

    ~/Library/Application Support/iPhone Simulator/
    

    Here is an extract from the current release notes of Xcode 4.3.1

    What's new in Xcode 4.3.1

    Xcode is now distributed as an application, rather than as an installer. This change enables Xcode to be updated directly from the Mac App Store.

    0 讨论(0)
  • 2020-12-12 11:02

    From xCode 8.0 the simulator .app is located in

    /Applications/Xcode.app/Contents/Developer/Applications

    0 讨论(0)
提交回复
热议问题