Xcode7 模拟器安装app (转)

  本文转自同事zz的博客http://archerzz.cn/ios/xcode-install-app.html

  原由

  很多时候,为了学习了解别人的app,很多时候我们是直接拿别人的app安装在自己的模拟器上面。在xcode7之前,模拟器上app的安装步骤都比较简单,直接将对应[NSBundle mainBundle]路径下的app拷贝,再放到对应的模拟器路径下即可。在xcode7之后,这个方法变得不可用。在这里就告诉大家怎么在xcode7的模拟器中安装app。

  步骤

  1.首先拿到别人的app包文件

  2.打开模拟器,选择要安装模拟器的版本(如:iphone6或iphone6s)

  3.打开终端,在终端中输入 xcrun simctl install booted /path/to/your.app ("/path/to/your.app"为你将要安装的.app文件的路径)

  一般来讲,此时app便会在你的模拟器安装成功了。若没能安装成功的话需要配置一些其他文件

  安装失败时配置方法

  如果没有安装Command Line Tool,系统会自动提示安装,点击install即可

  如果出现以下问题:

  xcrun simctl install booted /path/xxx.app
  xcrun: error: unable to find utility "simctl", not a developer tool or in PATH`
  xcrun simctl install booted /path/xxx.app
  xcrun: error: active developer path ("/Volumes/Xcode/Xcode.app/Contents/Developer") does not exist, use `xcode-select –switch    path/to/Xcode.app to specify the Xcode that you wish to use for command line developer tools (or see `man xcode-select`)
`No devices are booted`
  解决:在终端中继续输入`sudo xcode-select -switch xcode路径/Contents/Developer`即可,比如我的Xcode路径为`/Applications/Xcode.app/Contents/Developer`

  那么我在终端中则会输入为sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

  至此在xcode7中安装app的问题基本就解决了

posted @ 2016-01-26 10:20  紫色大番薯  阅读(3536)  评论(0编辑  收藏  举报