Apple 产品及系统重要使用记录

15 minute

TOC

Apple 服务

Apple 帐号问题

Apple 分为两个帐号,iCloud 帐号和 AppStore 帐号,一般建议 iCloud 帐号使用国区,AppStore 帐号使用美区帐号,搭配使用 Apple One 服务。美区 Apple Music 曲库最全,AppStore 软件最全,Apple Fitness 很有用,Apple Arcade 的游戏也挺丰富的。

对于帐号具体功能,iCloud 帐号用于同步相簿、联系人、备忘录、日历等存放在 iCloud 的信息。AppStore 帐号和软件购买、Apple Music、Apple TV、Apple Books 相关。

这里注意,所有自己上传的文件,都属于 iCloud 内容,比如 Apple Music 自己上传的音乐,但是 Apple Music 收藏的音乐则属于 AppStore 帐号,同步随 AppStore 帐号。注意切换 AppStore 帐号会导致下载的 Apple Music 下载的音乐被删除,但是播放列表、播放历史不回被删除,而是正常的云同步状态。

Apple 服务与代理分流问题

有些代理软件的分流操作会错误将 Apple 服务加入代理。下面从一个论坛上的关于 Apple Map 的例子引入:

解决 China IP List 分流导致 iPad 和 Mac 的 Maps App 提供商为 TomTom 的问题

如果你和我一样在使用透明代理和 China IP List 的组合,iPad 和 Mac 上的 Maps App 会使用 TomTom 作为地图提供商,而在不使用代理的设备上应该是高德地图。

由于 Mac 和 iPad 是根据 IP 地址判断地区的,而判断的域名只有国外的解析,所以如果单纯使用 China IP List 会导致判断为国外用户。

  1. 如果你是 Surge 用户,请将 *.ls.apple.com 加上 DIRECT 的规则。
  2. 如果是透明代理和 China IP List 的组合,无法对域名进行单独处理,可以添加一段 host,将请求转发到国内的 SNI Proxy 处理。具体的域名是 gsp[0-64]-ssl.ls.apple.com 和 gspe[0-64]-ssl.ls.apple.com。

所以,从这个 Apple Map 的例子可以知道 *.ls.apple.com 应该直连。下面是一个 Qx 的配置:

1[filter_local]
2host-wildcard, *.ls.apple.com, direct

另外,测试发现其实 iPhone 并不需要这个配置,这里判断 iPhone 应该是根据 SIM 卡判断地区。

Apple Map 没有同步指南等信息

Mac 上设置 - icloud,关闭 Apple Map 同步,退出后重新打开 Apple Map,然后打开 Apple Map 同步。

Apple 官方节假日日历地址

Apple 日历可以订阅 ics 日历:

 1# 大陆节日
 2webcal://p10-calendars.icloud.com/holiday/CN_zh.ics
 3# 台湾节日
 4webcal://p10-calendars.icloud.com/holiday/TW_zh.ics
 5# 香港节日
 6webcal://p10-calendars.icloud.com/holiday/HK_zh.ics
 7# 美国节假
 8webcal://p10-calendars.icloud.com/holiday/US_en.ics
 9# 日本节假
10webcal://p10-calendars.icloud.com/holiday/JP_ja.ics
11# 澳大利亚
12webcal://p10-calendars.icloud.com/holiday/AU_en.ics
13# 法国节假
14webcal://p10-calendars.icloud.com/holiday/FR_fr.ics
15# 德国节假
16webcal://p10-calendars.icloud.com/holiday/DE_de.ics
17# 英国节假
18webcal://p10-calendars.icloud.com/holiday/GB_en.ics

Airpods 相关

AirPods Max 2 (2024) 相比于 2020 年的第一代差异只在于换了一个 TypeC 口,没有任何音质、ANC 主动降噪功能上的升级,仍搭载 H1 芯片。

AirPods3 并不支持主动降噪,AirPods4 普通版也不支持,AirPods4 ANC 版支持。

Apple Watch 相关

蜂窝网络

如果需要脱离 iPhone 使用,只需要在 Apple Watch 应用内开通蜂窝网络(注意 Watch 需要时蜂窝版),移动是每月多交 10 元,和话费一起交,流量也是一起算的。

蜂窝网络的意义在于:

  1. 救急,iPhone 没电了,无法坐地铁,看地图
  2. 运动时无需携带 iPhone,无需担心错过电话和消息

公交地铁卡相关

同一张 NFC 卡无法同时绑定在 iPhone 和 Watch。我的操作是 iPhone 一个城市的卡,Watch 另一个城市的卡,国内各个城市的卡其实都是通用的。

iPhone 相关

Wallet

Wallet 开通的八达通和实体卡八达通完全一样,测试在香港可以坐地铁、购物。

机型重大变化

  1. 15 开始支持 TypeC
  2. 14p 开始支持灵动岛
  3. 13,14 刘海较 12 窄一截
  4. 16 多了一个快捷拍照按钮
  5. 16 标准版仍为 60HZ
  6. 13p 开始有 120HZ
  7. 15p 静音键更新

iPad 相关

我的 iPad 只用来看书和论文,基本没有遇到什么问题。

Mac 系统遇到的问题

desktop 文件夹里有东西,但是桌面不显示,而且无法拖动任何文件到桌面

原因是一些破解软件修改了系统配置造成的。

1defaults write com.apple.finder CreateDesktop -bool true; killall Finder

阻止 Anydesk 开机自启

删除该文件:

1/Library/LaunchAgents/com.philandro.anydesk.Frontend.plist

Mac 系统重要操作和配置记录

Apple Map 修改语言

系统语言为英文时修改内置地图软件语言为中文。

先将 [View]-> [Labels]-> [Always Show Labels in English] 取消即可在地图上显示中文。

如果需要将搜索内容也改成中文,需要设置 macOS 特定 app 的语言。

1defaults write com.apple.maps AppleLanguages '(zh-CN)'
2# defaults write com.apple.maps AppleLanguages '(en-US)'

可以将菜单栏,搜索内容变为中文。(想变回英文只需将最后改成’(“en-US”)’)

Apple Book 将导出的 epub 文件夹转为 epub 文件

Right click on the .epub file and click on Show Package Contents.

Select all the contents (CMD + A) → Right click → Compress.

This will create a .zip file. Simply change the extension from .zip to .epub and voila! The file has become an ePub document.

MAC 禁用系统输入法

sudo open ~/Library/Preferences/com.apple.HIToolbox.plist

AppleEnabledInputSources -> remove {KeyboardLayout=ABC} -> save

访达 -> 进入文件夹 ~/Library/Preferences/com.apple.HIToolbox.plist -> 右键显示简介 -> 已锁定 v

PS: 在 Ventura 版本下成功

MAC Ventura 真正进入 Recovery

进入恢复模式操作步骤为:1.长按电源键 2.长按直到启动选项出现 3.正在载入启动选项 4.选项界面

而如果在【3.正在载入启动选项】页面时就松开电源键了,在选项界面后续操作中,虽然是在恢复模式的界面,但是系统却认为不是在恢复模式。

解决方式:

长按电源键直到【4.选项界面 】出现后再松手即可!

配置开机启动程序

1chmod +x startup.sh
2# 访达右键 startup.sh > 显示详情 > 打开方式选终端
3# 设置 > 通用 > 登录项添加 startup.sh

禁止系统更新和提示

1# /etc/hosts
2
3127.0.0.1 swdist.apple.com
4127.0.0.1 swscan.apple.com
5127.0.0.1 swcdn.apple.com  #optional, download url
6127.0.0.1 gdmf.apple.com
7127.0.0.1 mesu.apple.com
8127.0.0.1 xp.apple.com
1alias fkred="defaults delete com.apple.systempreferences AttentionPrefBundleIDs; defaults delete com.apple.systempreferences DidShowPrefBundleIDs; killall Dock"
2fkred

Hostname

1sudo scutil --set HostName MacBookPro-Jzh
2scutil --get HostName
3
4# setting -> general -> sharing -> Local hostname
5sudo scutil --set LocalHostName MacBookPro-Jzh
6scutil --get LocalHostName

SMB 共享

mac 通用 -> 共享 -> 文件共享开启 -> 指定共享文件夹和权限控制(可选)

iphone 文件 -> 连接服务器 -> 输入 Mac-Jzh.local(本机名称 + .local) -> 输入 Mac 账号密码(或以客人模式登录)

将快速操作和快捷指令添加到右键

Automator 创建快速操作(注意输入类型和适用 APP),然后设置 -> 键盘 -> 键盘快捷键 -> 服务 -> 勾选

快捷指令详细信息勾选快速操作, 编辑快捷指令,然后设置 -> 隐私与安全性 -> 扩展 -> 访达 -> 勾选

Steam 下载 Windows 游戏文件

Navigate to /Users/YOUR_USERNAME_HERE/Library/Application Support/Steam/steamapps/. Create a file called appmanifest_22320.acf (the number is based on its Steam App ID). If using TextEdit, make sure that your document is in plain text mode by going to the menu bar and choosing “Format” -> “Make Plain Text”. Also, ensure that it’s not named with the extension .acf.txt. Add the following into that file:

1"AppState"
2{
3        "AppID" "22320"
4        "Universe" "1"
5        "StateFlags" "1026"
6        "installdir" "The Elder Scrolls III - Morrowind"
7}

Launch the Steam client and let it download. You can then find Morrowind.esm at ~/Library/Application Support/Steam/steamapps/common/The Elder Scrolls III - Morrowind/Data Files/

SRC

Mac 重要软件

REST 测试插件

  • vsc: rest client
  • idea: http client

环境变量分别写在:

  • .vscode/settings.json
  • .http 同一目录下

http 文件内字符串变量统一不加引号

textutil

用于转换 webarchive 为文件夹,好像是内置的。

1textutil -convert html /Users/USERNAME/NAME.webarchive

dart

1brew tap dart-lang/dart
2brew install dart

Jenkins

1wget http://mirrors.jenkins.io/war-stable/latest/jenkins.war
2java -jar jenkins.war --httpPort=8080
3open http://localhost:8080 # and then set up in browser

RocketMQ

1wget https://dist.apache.org/repos/dist/release/rocketmq/5.1.4/rocketmq-all-5.1.4-bin-release.zip
2unzip rocketmq-all-5.1.4-bin-release.zip
3sudo mkdir -p /usr/local/share/rocketmq && sudo mv rocketmq-all-5.1.4-bin-release /usr/local/share/rocketmq/
4
5# start
6cd /usr/local/share/rocketmq/rocketmq-all-5.1.4-bin-release/bin

alist

 1cd $dld
 2wget https://github.com/alist-org/alist/releases/download/v3.30.0/alist-darwin-arm64.tar.gz
 3tar -zxvf alist-darwin-arm64.tar.gz
 4chmod +x alist
 5sudo mkdir /usr/local/share/alist
 6sudo mv alist /usr/local/share/alist
 7# echo 'export PATH="$PATH:/usr/local/share/alist"' >> ~/.zprofile
 8# source ~/.zprofile
 9
10data_dir="/Users/zh/.alist"
11# mkdir data folder
12mkdir "$data_dir"
13# start server
14cd "$data_dir" && alist server
15# get admin info
16cd "$data_dir" && alist admin
17# add some storages
18# ...

后台服务,开机自启,vim ~/Library/LaunchAgents/ci.nn.alist.plist:

 1<?xml version="1.0" encoding="UTF-8"?>
 2<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
 3<plist version="1.0">
 4    <dict>
 5        <key>Label</key>
 6        <string>ci.nn.alist</string>
 7        <key>KeepAlive</key>
 8        <true/>
 9        <key>ProcessType</key>
10        <string>Background</string>
11        <key>RunAtLoad</key>
12        <true/>
13        <key>WorkingDirectory</key>
14        <string>/Users/zh/.alist</string>
15        <key>ProgramArguments</key>
16        <array>
17            <string>/usr/local/share/alist/alist</string>
18            <string>server</string>
19        </array>
20    </dict>
21</plist>
1launchctl load ~/Library/LaunchAgents/ci.nn.alist.plist
2# 开启: launchctl start ~/Library/LaunchAgents/ci.nn.alist.plist
3# 关闭: launchctl stop ~/Library/LaunchAgents/ci.nn.alist.plist
4# 卸载配置: launchctl unload ~/Library/LaunchAgents/ci.nn.alist.plist

Applite

一个方便地卸载、安装、更新 Mac 各类软件(含 brew 源)的工具。

1brew install --cask applite

graphviz

1brew install libtool
2brew link libtool
3brew install graphviz
4brew link --overwrite graphviz

By default, the dot executable is expected:

  • Firstly in: /usr/local/bin/dot
  • Then in: /usr/bin/dot

You can also specify the environment variable GRAPHVIZ_DOT to set the exact location of your GraphViz executable.

ffmpeg

1brew install ffmpeg

Pngpaste

1brew install pngpaste 

ftp

1brew install inetutils

Vsce

Vscode 扩展开发工具,用于打包和发布等。

1npm install -g vsce
2# usage
3vsce package

MySQL

 1brew search mysql     
 2==> Formulae
 3automysqlbackup       mysql-client          mysql-client@8.4      mysql@5.7             mysqltuner
 4mysql                 mysql-client@5.7      mysql-connector-c++   mysql@8.0             qt-mysql
 5mysql++               mysql-client@8.0      mysql-search-replace  mysql@8.4
 6
 7==> Casks
 8mysql-connector-python              mysqlworkbench                      sqlpro-for-mysql
 9mysql-shell                         navicat-for-mysql
10brew install mysql@8.0
11brew services start mysql@8.0
12echo 'export PATH="/usr/local/opt/mysql@8.0/bin:$PATH' >> ~/.zprofile && source ~/.zprofile
13mysql_secure_installation
14mysql -u root -p

Github CLI

1brew install gh

Hugo

1brew install hugo

SteamCMD

1cd /usr/local/share
2curl -sqL "https://steamcdn-a.akamaihd.net/client/installer/steamcmd_osx.tar.gz" | tar zxvf -
3./steamcmd
4login {username} {password}
5
6# 下载创意工坊物品
7workshop_download_item {game-id} {id}
8# Wallpaper Engine
9workshop_download_item 431960 {id}

InfluxDb

1brew install influxdb influxdb-cli
2# start influxdb
3influxdb
4# setup a bucket
5influx setup
6# currently v2, use v1 shell by:
7influx v1 shell

解压缩工具

p7zip

1brew install p7zip
27za x test.7z
3
4# 分卷解压【其他格式类似】
5cat t1.7z > t.7z
6cat t1.7z.001 >> t.7z
7cat t1.7z.002 >> t.7z
87za x t.7z

unzip

1brew install unzip
2unzip test.zip

rar

1brew install rar
2unrar x test.rar

tar

1tar -zxf test.tar.gz

python(多版本)

 1brew install pyenv
 2v="3.10.9"
 3pyenv install $v
 4pyenv versions
 5pyenv global $v
 6pyenv init # 然后根据提示添加变量到文件
 7python -V
 8python3 -V
 9pip -V
10pip3 -V
11
12# 针对某个项目指定 python 版本
13v="3.9.13"
14pyenv install $v
15cd your_project
16~/.pyenv/versions/$v/bin/python -m venv venv
17source ./venv/bin/activate

bat

加强版 cat。

1brew install bat

ripgrep

加强版 grep。

1brew install ripgrep

fzf

命令行模糊搜索工具。

1brew install fzf

rclone mount

首先安装 macfuse

文档需知: “rclone will locate the macFUSE libraries without any further intervention”

接着:

1# 后台运行时不可使用 kill 操作,需要使用 umount ~/Pikpak 操作
2nnohup rclone mount --vfs-cache-mode writes pikpak: ~/Pikpak

pikpakcli

1wget https://github.com/52funny/pikpakcli/releases/download/v0.15/pikpakcli_0.15_Darwin_arm64.tar.gz
2tar -zxvf pikpakcli_0.15_Darwin_arm64.tar.gz
3mv ./pikpakcli /usr/local/bin/
4pikpakcli -h
5mkdir -p ~/.config/pikpakcli
6echo "username:" >> ~/.config/pikpakcli/config.yml
7echo "password:" >> ~/.config/pikpakcli/config.yml
8vim ~/.config/pikpakcli/config.yml

hiddenbar

1brew install --cask hiddenbar

node

同 linux, 详见 Linux 重要软件安装和配置记录

maven

若需要特定版本,操作方法同 linux, 详见 Linux 重要软件安装和配置记录

否则可直接通过 brew:

1brew install maven

brew

1/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

docker

1brew install --cask docker
2open /Applications/Docker.app

syncthing

1brew install syncthing
2brew services start syncthing

redis

1brew install redis
2brew services start redis
3redis-cli
4
5vim /opt/homebrew/etc/redis.conf
6requirepass xxx
7brew services restart redis

man zh page

1wget https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/manpages-zh/manpages-zh-1.5.1.tar.gz --no-check-certificate
2tar -zxvf manpages-zh-1.5.1.tar.gz
3cd manpages-zh-1.5.1 
4./configure --disable-zhtw
5sudo make && sudo make install
6man -M /usr/local/share/man/zh_CN grep
7alias mann="man -M /usr/local/share/man/zh_CN"

postgresql

1brew install postgresql@15
2brew services start postgresql@15
3## vim ~/.zprofile
4export PATH="/opt/homebrew/opt/postgresql@15/bin:$PATH"
5export LDFLAGS="-L/opt/homebrew/opt/postgresql@15/lib"
6export CPPFLAGS="-I/opt/homebrew/opt/postgresql@15/include"
7psql postgres

jq

1brew install jq

lux

一个视频下载器

1brew install lux