移轉到 M1 MacBook Pro 的體驗

目錄

前言
macOS 操作設定
觸控式軌跡版
多重桌面命名重新設定
觸控列預設更改
通訊 APP 安裝
Teams
Slack 工作空間
宅宅專區
環境變數
安裝brew
透過 brew 安裝 php 8
透過 php 安裝 composer
AWS
Docker
IDE工具
sublime工作區
小結
註釋
參考

前言

macOS 操作設定

觸控式軌跡版

多重桌面命名重新設定

觸控列預設更改

Photo by Tianyi Ma on Unsplash

通訊 APP 安裝

Teams

Slack 工作空間

  • 公司工作空間
  • AWS Community Builders 工作空間
  • Kubeflow 工作空間
  • Presto SQL 工作空間
  • Delta Lake 工作空間
  • cdk.dev 工作空間
  • og-aws 工作空間

宅宅專區

環境變數

  1. 轉移舊有的
  2. 新增環境變數
    在轉移之際,在 ~/.bash_profile 最前頭中加入了以下命令,
if [ -x /usr/libexec/path_helper ]; then
eval `/usr/libexec/path_helper -s`
fi
# 以上命令的效果和下面是一樣的,在執行前我有安裝 go 。
$ PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin"; export PATH;

安裝brew

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# 設定 PATH 環境變數,以我自己為例,我是把它放在 `~/.bash_profile` 裡頭。HOMEBREW="/opt/homebrew/bin:/opt/homebrew/sbin"
export PATH="$HOMEBREW:$PATH"
# 安裝常用(有想到)的套件
brew install git
brew install gpg
brew install npm
brew install pyenv
brew install wget
brew install svn
Photo by kazuend on Unsplash

透過 brew 安裝 php 8

# 第一次遇到的錯誤訊息
==> Installing php dependency: webp
==> Pouring webp--1.2.0.arm64_big_sur.bottle.tar.gz
Error: Interrupted system call @ rb_sysopen - /opt/homebrew/Cellar/webp/1.2.0/bin/cwebp
# 看完錯誤訊息做的事
export CPPFLAGS="-I/opt/homebrew/opt/openssl@1.1/include"
# 第二次遇到的錯誤訊息
Error: Directory not empty @ dir_s_rmdir - /private/tmp/d20210425-37137-e4jzzz
# 看完錯誤訊息做的事
$ rm -rf /private/tmp/d20210425-37137-e4jzzz
# 第三次遇到的錯誤訊息
==> Installing php dependency: gd
==> Pouring gd--2.3.2.arm64_big_sur.bottle.tar.gz
Error: Interrupted system call @ dir_initialize - /opt/homebrew/Cellar/gd/2.3.2/bin
# 看完錯誤訊息做的事
$ brew install php
# 第四次執行有跑完,不過途中有看到這行訊息
==> Installing php dependency: gd
==> Pouring gd--2.3.2.arm64_big_sur.bottle.tar.gz
Error: Failed to read Mach-O binary: /opt/homebrew/Cellar/gd/2.3.2/bin/annotate
$ php -v
PHP 8.0.3 (cli) (built: Apr 12 2021 00:29:32) ( NTS )
Copyright (c) The PHP Group
Zend Engine v4.0.3, Copyright (c) Zend Technologies
with Zend OPcache v8.0.3, Copyright (c), by Zend Technologies
$ brew link php

透過 php 安裝 composer

PHP Warning:  failed loading cafile stream: `/opt/homebrew/etc/openssl@1.1/cert.pem' in Command line code on line 1Warning: failed loading cafile stream: `/opt/homebrew/etc/openssl@1.1/cert.pem' in Command line code on line 1PHP Warning:  copy(): Failed to enable crypto in Command line code on line 1Warning: copy(): Failed to enable crypto in Command line code on line 1PHP Warning:  copy(https://getcomposer.org/installer): Failed to open stream: operation failed in Command line code on line 1Warning: copy(https://getcomposer.org/installer): Failed to open stream: operation failed in Command line code on line 1
echo 'export PATH="/opt/homebrew/opt/openssl@1.1/bin:$PATH"' >> /Users/$(whoami)/.bash_profile
# 官方文件給的操作指令
$ php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
$ php -r "if (hash_file('sha384', 'composer-setup.php') === '756890a4488ce9024fc62c56153228907f1545c228516cbf63f885e036d37e9a59d27d63f46af1d4d07ee0f76181c7d3') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
$ php composer-setup.php
$ php -r "unlink('composer-setup.php');"
# 額外指令
$ sudo mv composer.phar /usr/local/bin/composer
$ composer --version
Composer version 2.0.12 2021-04-01 10:14:59

AWS

  1. AWS CLI v2 安裝
  2. 八個帳號的權限設定重新來,Nice 抖!

Docker

softwareupdate --install-rosetta

IDE 工具

sublime 工作區

Photo by Tianyi Ma on Unsplash

M1接多螢幕

使用 Dell D6000 解決 M1 MacBook Pro 雙螢幕需求一瑀
攝影師:Tranmautritam,連結:Pexels

小結

註釋

  1. 一般使用者使用遷移助理應該沒有問題才是,我的狀況是因為新筆電(MacBook Pro M1)有綁管理機制,不只遷移助理卡牆,甚至在一開始拿到時,要更新系統或是 APP 都還不能自己執行。

參考

  1. Adermann, N. and Jordi Boggiano, J., 2021. Download Composer. [online] Getcomposer.org. Available at: <https://getcomposer.org/download/> [Accessed 25 April 2021].
  2. Docker Inc., 2021. Docker Desktop for Apple silicon. [online] Docker Documentation. Available at: <https://docs.docker.com/docker-for-mac/apple-silicon/> [Accessed 25 April 2021].
  3. Matties, M., 2020. Rename Desktops? — Apple Community. [online] Discussions.apple.com. Available at: <https://discussions.apple.com/thread/251266416> [Accessed 12 April 2021].
  4. Taber, M., 2012. Where is the default terminal $PATH located on Mac?. [online] Stack Overflow. Available at: <https://stackoverflow.com/questions/9832770/where-is-the-default-terminal-path-located-on-mac/9832861#9832861> [Accessed 25 April 2021].
  5. claui, 2020. macOS 11 Big Sur compatibility on Apple Silicon · Issue #7857 · Homebrew/brew. [online] GitHub. Available at: <https://github.com/Homebrew/brew/issues/7857> [Accessed 25 April 2021].

--

--

--

10 x AWS-certified, Data Architect in the 104 Corporation. An AWS Community Builder

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Scott Hsieh (史考特)

Scott Hsieh (史考特)

10 x AWS-certified, Data Architect in the 104 Corporation. An AWS Community Builder

More from Medium

HTTPS local web server with PHP and ngrok on Mac

ngrok UI in terminal displaying public URL and metrics about connections

How to Set up a Local Drupal Website With Lando

Validating `multipart/form-data` with Laravel Validation Rules with proper JSON data types

Using Fetch/Post with React and Laravel API