【问题标题】:Finding the path of the iOS Simulator app查找 iOS Simulator 应用程序的路径
【发布时间】:2012-09-22 11:03:49
【问题描述】:

我想从命令行运行模拟器。有没有办法通过命令行找到模拟器路径。苹果经常改变模拟器的位置,比如

/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone Simulator.app/Contents/MacOS/iPhone Simulator

/Applications ........ / IOS simulato....

有没有办法从终端找到模拟器路径。 ?

【问题讨论】:

标签: ios xcode xcode4.2 ios-simulator


【解决方案1】:

这里有两个建议:

  • 你可以使用xcode-select来打印Xcode的路径:

    # This returns sthg like "/Applications/Xcode.app/Contents/Developer"
    XCODEPATH=$(xcode-select --print-path)
    # Then build the rest of the path to the simulator SDK
    SIMSDKPATH=${XCODEPATH}/Platforms/iPhoneSimulator.platform/Developer
    # And add the rest of the path to the Simulator app
    SIMULATORPATH=$(SIMSDK}/Applications/iPhone Simulator.app/Contents/MacOS/iPhone Simulator
    
  • 你可以使用xcrun在iphonesimulator SDK中找到一个xcodebuild工具的路径,然后从这里扣除路径:

    # This returns sthg like "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc"
    GCCPATH=$(xcrun -sdk iphonesimulator -find gcc)
    # Then go up 3 directories
    SIMSDKPATH=$(dirname $(dirname $(dirname ${GCCPATH})))
    # And down to the Simulator app
    SIMULATORPATH=${SIMSDKPATH}/Applications/iPhone Simulator.app/Contents/MacOS/iPhone Simulator
    

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-06-06
  • 2022-11-04
  • 2020-03-13
  • 2013-11-23
  • 2019-09-15
相关资源
最近更新 更多