How to develop on MacOS for Apple platform

xcode

xip format

xip format install

To verify that a package is signed, execute the following command on a computer with the package:

pkgutil –check-signature /path/to/package.pkg

If the output is “Status: signed by a certificate trusted by Mac OS X”, the package is signed. If the output is “Status: no signature”, the package is not signed.

运行多个Xcode版本

from Baidu
显示当前版本:xcode-select --print-path
更换版本 sudo xcode-select --switch /Applications/Xcode-beta.app/Contents/Developer

Mac使用brew安装python3

install python3 on Mac
Permission denied

brew install python3
# 有可能出现文件夹不存在的错误和权限异常,brew会自动给出提示,安装提示进行赋权即可
sudo mkdir /usr/local/Frameworks
sudo chown $(whoami):admin /usr/local/Frameworks

#报错
Permission denied @ dir_s_mkdir - /usr/local/Frameworks

# do 
brew link python

python3: Virtual Environments

  • python3 内置虚拟环境 venv 模块
  • 定义虚拟环境所在目录,如 ~/.virtualenvs
  • 新建一个虚拟环境目录 python3 -m venv ~/.virtualenvs/firstenv
  • 激活这个虚拟环境 source ~/.virtualenvs/firstenv/bin/activate
  • 退出虚拟环境 deactivate或关闭命令行即可

激活时,可使用 pip freeze查看虚拟环境下的所有已安装软件

➜  ~ mkdir .virtualenvs
➜  ~ python3 -m venv .virtualenvs/firstenv
➜  ~ source .virtualenvs/firstenv/bin/activate
(firstenv) ➜  ~ pip freeze
(firstenv) ➜  ~ deactivate
 
comments powered by Disqus