• 终端:Xcode模拟器上安装.app方法


    有的时候,我们可能需要将别人的Xcode运行之后的程序包(xxx.app)安装在自己的模拟器上,如下我将介绍如何通过终端来安装。

    一,实现

    • 获取自己Xcode生成的xxx.app

      steps 1:在工程didFinishLaunchingWithOptions:方法中打印bundle路径:

      NSLog(@"%@", [[NSBundle mainBundle] pathForAuxiliaryExecutable:@""]);

      steps 2:拷贝打印的bundle路径,然后点击桌面->选择屏幕上方工具栏上的前往->选择前往文件夹:

      steps 3:将拷贝的路径粘贴在前往文件夹路径中,点击回车即可:

    • 安装别人Xcode生成的xxx.app

      steps 1:打开终端

      steps 2:在终端输入xcrun simctl install booted xxx.app路径,点击回车。注意,xxx.app路径为你需要安装到模拟器中的app的路径,获取方法直接将其拖入终端即可。这里有个小技巧,可先复制xcrun simctl install booted粘贴到终端,然后再将xxx.app拖入到终端,两者之间以空格隔开。

    二,建议

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

    • 异常问题

      1、xcrun simctl install booted /path/xxx.app

      2、xcrun: error: unable to find utility “simctl”, not a developer tool or in PATH`

      xcrun simctl install booted /path/xxx.app

      3、xcrun: error: active developer path (“/Volumes/Xcode/Xcode.app/Contents/Developer”) does not exist, usexcode-select –switch path/to/Xcode.app to specify the Xcode that you wish to use for command line developer tools (or seeman xcode-select)

      No devices are booted`
      这些问题将会导致安装不成功,如果没有安装上可执行下面的操作。

    • 解决方案

      steps 1:获取Xcode路径。获取Xcode路径只需到应用程序中找到Xcode,然后将其拖入到终端即可获取到Xcode的路径。

      steps 2:在终端中继续输入sudo xcode-select -switch Xcode路径/Contents/Developer即可。

      Tips

      比如我的Xcode路径为:/Applications/Xcode.app。那么我在终端中则会输入为:sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer

  • 相关阅读:
    IfcFlowDirectionEnum
    QAxWidget
    IfcDistributionFlowElementType
    IfcBuildingElementProxy 概念用法
    opencv图片旋转90度
    IfcMaterialList
    IfcDistributionChamberElement
    IfcArithmeticOperatorEnum
    FileWriter
    IfcDistributionChamberElementType
  • 原文地址:https://www.cnblogs.com/lxlx1798/p/7457642.html
Copyright © 2020-2023  润新知