#Flutter#Mac M1

Mac M1 當要跑 pod install 時出現

Looking for related issues on cocoapods/cocoapods...
Searching for inspections failed: undefined method `map' for nil:NilClass

解決方法


ffi 相容性問題,安裝重新安裝 ffi

sudo arch -x86_64 gem install ffi

再使用

arch -x86_64 pod install


#Mac#NUEiP#自動打卡#Shell Script

去年有寫一個 Laravel 專案用排程實現公司使用的打卡系統自動打卡的功能,但缺點是上下班卡的時間與 latlng 太固定,雖可以做些 Rand 微調,但可能與實際上下班時間還是有差異。

https://github.com/MTsung/nueip_auto_clock_in

於是又再寫了一隻 Shell Script 讓 Mac 在休眠與喚醒時進行打卡動作,也確保本人在公司,避免有爭議。



#Mac#Linux#Git#Shell Script

公司有許多專案,git 倉儲 (repository) 有分正式與測試機,所以每次 clone 一個專案後都需要 git remote 去新增遠端倉儲位置,避免久久一個新專案 clone 下來後忘記做這動作,寫了一隻 shell script。

Shell Script 內容


建立一個檔案 git-clone.sh

vim git-clone.sh
#!/bin/sh
git clone git@test-domain.tw:/home/web/repos/$1.git
cd $1
git remote set-url --add --push origin git@test-domain.tw:/home/web/repos/$1.git
git remote set-url --add --push origin git@prod-domain.tw:/home/web/repos/$1.git

加上執行權限

chmod +x git-clone.sh


#Mac#Linux#SSH Key

SSH Key 可以讓對方 server 快速驗證你的身份,不用再輸入帳號密碼,方便的好東西。
使用 SSH Key 需要兩步驟:

  1. 本機產生公鑰及私鑰,私鑰請自行保存好!
  2. 將公鑰放置 server 


#Flutter#Mac

開啟你的 Terminal,執行:

sudo xattr -d com.apple.quarantine [你的 Flutter path]/bin/cache/artifacts/usbmuxd/iproxy

刪除 iproxy 的 com.apple.quarantine 屬性即可。