iOS:开发周边知识小记

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 , --switch   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:开发周边知识小记)