美文网首页
iOS开发周边知识小记(持续更新)

iOS开发周边知识小记(持续更新)

作者: 春暖花已开 | 来源:发表于2017-10-14 09:25 被阅读32次
    1、删除过期的Provisioning Profile:

    进入~/Libraray/MobileDevice/Provisioning Profiles,在里面就可删除。

    2、xcode-select的作用:

    我们可能会安装多于1个版本的Xcode,那么我们选择默认的Xcode来编译我们的代码就会用到xcode-select

    xcode-select的命令及其作用如下:
      -h, --help                  print this help message and exit
      -p, --print-path            print the path of the active developer directory
      -s <path>, --switch <path>  set the path for the active developer directory
      --install                   open a dialog for installation of the command line developer tools
      -v, --version               print the xcode-select version
      -r, --reset                 reset to the default command line tools path
    

    举个例子,我们可以用xcode-select -p来打印当前Xcode的路径

    /Applications/Xcode.app/Contents/Developer
    

    我们可以用以下命令来切换我们的Xcode:

    sudo xcode-select -s /Applications/Xcode.app 
    //或者切换到旧的Xcode
    sudo xcode-select -s /Applications/Xcode_old.app
    
    3、xctool

    xctool是Facebook开源的另一种构建工具,它用于构建iOS应用程序。xctool替换了xcodebuild,具有以下特性:

    • 能够作为Xcode.app运行相同的测试
    • 构建输出和测试结果都是JSON格式的,使得我们不需要解析输出
    • xctool只有在发现错误的时候才打印消息,而xcodebuild对每个源文件都会打印。
    4、xcodebuild

    构建Xcode projects和workspaces

        xcodebuild [-project name.xcodeproj] [[-target targetname] ... | -alltargets]
                    [-configuration configurationname] [-sdk [sdkfullpath | sdkname]] [action ...]
                    [buildsetting=value ...] [-userdefault=value ...]
    
         xcodebuild [-project name.xcodeproj] -scheme schemename
                    [[-destination destinationspecifier] ...] [-destination-timeout value]
                    [-configuration configurationname] [-sdk [sdkfullpath | sdkname]] [action ...]
                    [buildsetting=value ...] [-userdefault=value ...]
    
         xcodebuild -workspace name.xcworkspace -scheme schemename
                    [[-destination destinationspecifier] ...] [-destination-timeout value]
                    [-configuration configurationname] [-sdk [sdkfullpath | sdkname]] [action ...]
                    [buildsetting=value ...] [-userdefault=value ...]
    
         xcodebuild -version [-sdk [sdkfullpath | sdkname]] [infoitem]
    
         xcodebuild -showsdks
    
         xcodebuild -showBuildSettings
                    [-project name.xcodeproj | [-workspace name.xcworkspace -scheme schemename]]
    
         xcodebuild -list [-project name.xcodeproj | -workspace name.xcworkspace]
    
         xcodebuild -exportArchive -archivePath xcarchivepath -exportPath destinationpath
                    -exportOptionsPlist path
    
         xcodebuild -exportLocalizations -project name.xcodeproj -localizationPath path
                    [[-exportLanguage language] ...]
         xcodebuild -importLocalizations -project name.xcodeproj -localizationPath path
    
    5、RVM
    curl -L get.rvm.io | bash -s stable
    source ~/.bashrc
    source ~/.bash_profile
    

    修改 RVM 的 Ruby 安装源到国内的淘宝镜像服务器:

    sed -i -e 's/ftp\.ruby-lang\.org\/pub\/ruby/ruby\.taobao\.org\/mirrors\/ruby/g' ~/.rvm/config/db
    

    相关文章

      网友评论

          本文标题:iOS开发周边知识小记(持续更新)

          本文链接:https://www.haomeiwen.com/subject/gvkxuxtx.html