Multiple WeChat instances on macOS too much hassle? I used DeepSeek to write a one-click tool
Fed up with that Zhihu routine of manually changing the Bundle ID and re-signing, which you have to redo after every update? One line of `wechat-clone create 3` gets you three instances, TUI included—ten minutes to write a Go tool so you don't wreck your keyboard in the terminal.
目录8 个章节
Introduction
I previously came across a tutorial on Zhihu for running two instances of WeChat on Mac. The steps were roughly: copy WeChat.app, change the Bundle ID, re-sign it, then launch with nohup. I tried it and it actually worked—after going through the manual steps, I successfully had two instances running.
But honestly the process is pretty tedious—every time you have to open the terminal and type several sudo commands, and one slip of the finger could copy the wrong path or mess up the signing. And if WeChat updates, the clone's signature becomes invalid and you have to do it all over again.
What's even worse: if you want three or four instances, you have to change every 2 in the tutorial to 3 or 4 and go through the whole process again for each. Someone in the original Zhihu post's comments even asked "how do I change it for three instances?", and the author had to put out a dedicated follow-up post highlighting all the places to change 🤣
So I thought, could I write a command-line tool to automate these steps? One command to handle create, repair, and delete, and while I'm at it, throw in an interactive UI for friends who aren't comfortable with the command line.
So I got right to it.
Demo
First, a look at the final result.
CLI mode, one command to create 3 clones:
$ wechat-clone create 3
正在创建 3 个微信分身...
✓ 分身 1 创建成功: /Applications/WeChat Clone 1.app
✓ 分身 2 创建成功: /Applications/WeChat Clone 2.app
✓ 分身 3 创建成功: /Applications/WeChat Clone 3.app
完成!
List existing clones:
$ wechat-clone list
找到 3 个微信分身:
WeChat Clone 1.app com.tencent.xinWeChat.clone1
WeChat Clone 2.app com.tencent.xinWeChat.clone2
WeChat Clone 3.app com.tencent.xinWeChat.clone3
Environment check:
$ wechat-clone doctor
正在检查环境...
✓ 系统平台: macOS
✓ 微信应用: 已找到: /Applications/WeChat.app
✓ codesign: 可用
✓ PlistBuddy: 可用
✓ 写入权限: /Applications 可访问
✓ 磁盘空间: 请确保有足够空间(每个分身约 400MB+)
✓ 已有分身: 暂无分身
环境检查通过! 可以正常使用。
Don't want to type commands? Just run wechat-clone to enter the interactive TUI—arrow keys to select, Enter to confirm:
微信分身管理工具
使用 ↑↓ 键选择,Enter 确认,q 退出
▸ 创建分身
查看分身列表
启动分身
修复分身
删除分身
环境检查
↑/↓ 移动 • Enter 选择 • q 退出
Installation
brew install star-plan/tap/wechat-clone
If you don't have Homebrew installed, you can also download the binary from GitHub Releases and drop it in /usr/local/bin/.
What It Does
In plain terms, it just automates the manual steps from that Zhihu tutorial. For each clone it creates, the tool runs the following in sequence:
sudo cp -Rcopy WeChat.appsudo PlistBuddymodifyCFBundleIdentifierinInfo.plistcodesign --force --deep --sign -ad-hoc re-signxattr -rd com.apple.quarantineclear the quarantine attribute
Exactly the same as doing it by hand, except you don't have to type the commands yourself.
Repair (repair) is just repeating steps 2-4—run it after a WeChat update. Remove (remove) is just sudo rm -rf, with a confirmation prompt to prevent accidents.
Command Cheatsheet
| Command | Description |
|---|---|
wechat-clone | Enter the interactive TUI |
wechat-clone doctor | Check whether the environment meets the requirements |
wechat-clone create 3 | Create 3 clones |
wechat-clone create 3 --force | Overwrite existing clones |
wechat-clone list | List all clones |
wechat-clone open | Show clone paths and guide you to launch them in Finder |
wechat-clone repair | Repair signatures for all clones |
wechat-clone repair 2 | Repair a specific clone |
wechat-clone remove 2 | Delete a specific clone (with confirmation) |
wechat-clone remove all --force | Force-delete all clones |
Tech Stack
| Component | Choice | Reason |
|---|---|---|
| Language | Go | Single-binary distribution, no runtime dependencies |
| CLI framework | cobra | The standard choice for Go CLIs, with a clear command structure |
| TUI framework | bubbletea + lipgloss | The Charm family, a modern terminal UI solution |
| Build/release | GoReleaser | Automatically builds for multiple architectures + pushes the Homebrew Formula |
The project structure is reasonably clean too:
wechat-clone/
├── main.go
├── internal/
│ ├── app/ # 业务逻辑(CLI 和 TUI 共享)
│ ├── cli/ # Cobra 命令定义
│ ├── macos/ # macOS 系统操作封装
│ └── tui/ # Bubble Tea 交互界面
The benefit of the layered design is that the CLI and TUI reuse the same business logic, so you don't have to write it twice. internal/macos/ wraps all the macOS-specific operations (PlistBuddy, codesign, xattr), and the upper layers just call them.
A Few Details
Launch method: After creating clones, the tool won't automatically open WeChat for you; instead it shows the path and guides you to launch it manually in Finder. The main reason is that automatic launching (nohup invoking the binary or the open command) behaves inconsistently across different macOS versions, so launching manually is actually more reliable. Just double-click the .app, or drag it to the Dock to pin it.
Numbering: If you delete clone 2 and then create a new one, the new clone will be numbered 4 rather than filling the gap at 2. Simple and reliable, no numbering conflicts.
sudo privileges: Copying and modifying files under /Applications requires sudo. The tool will request it automatically when needed, and the terminal will prompt you for your password.
Data isolation: Each clone has its own Bundle ID, so WeChat creates a separate data directory for each clone. They don't interfere with each other. Multiple clones can be logged into different accounts at the same time.
Wrapping Up
At its core this is just a small project that packages 5 terminal commands into a tool—no black magic. But it really does save a lot of hassle—especially when you need multiple instances or have to re-sign after a WeChat update.
The source is on GitHub, Apache 2.0 license. Issues and PRs welcome.
That's it 👋
_EOF_
Multiple WeChat instances on macOS too much hassle? I used DeepSeek to write a one-click tool
- 本文作者:
- 程序设计实验室
- 版权声明:
- 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
相关文章
解决Mac刘海屏菜单栏图标显示不全,两款工具实测(含开源免费方案)
本文分享了MacBook Air M4用户遇到的菜单栏图标过多导致显示不全的问题,并提供了两种解决方案:收费软件Bartender 4(15美元)和开源免费工具Ice。作者详细介绍了Ice的安装方法(通过brew或手动下载)及使用体验,展示了其灵活的图标折叠、扩展菜单和自定义设置功能,认为其效果与收费版相当。文章旨在帮助用户优化MacOS菜单栏空间管理。
2025-08-26 · Mac · 约 1 分钟
Mac必备利器:高效工具、系统增强与应用推荐
本文推荐了一系列提升Mac使用效率的工具,涵盖截图、眼睛保护、快捷命令、终端、系统辅助、鼠标手势增强、系统增强、输入法、美化与个性化等方面,旨在帮助用户优化操作习惯,提升日常使用体验。
2025-04-10 · Mac · 约 1 分钟
StarBlog博客开发笔记(4):markdown博客批量导入
系列文章 基于.NetCore开发博客项目 StarBlog - (1) 为什么需要自己写一个博客? 基于.NetCore开发博客项目 StarBlog - (2) 环境准备和创建项目 基于.NetCore开发博客项目 StarBlog - (3) 模型设计 基于.NetCore开发博客项目 StarBlog - (4) markdown博客批量导入 ... 前言 上周介绍了博客的模型设计,现在模
2025-04-27 · StarBlog博客开发笔记 · 约 1 分钟
StarBlog博客开发笔记(1):项目介绍
前言 OK,我也来造轮子了 博客系统从一开始用WordPress,再到后来用hexo、hugo之类的静态博客生成放github托管,一直在折腾 折腾是为了更好解决问题,最终还是打算自己花时间搞一个好了 本系列文章将记录博客的开发过程~ 后端基于最新的.Net6和Asp.Net Core框架,遵循RESTFul接口规范,前端基于Vue+ElementUI开发,可作为 .Net Core 入门项目学习
2022-04-05 · StarBlog博客开发笔记 · 约 1 分钟
讨论
共 0 条加载评论中…