macos-app-multi-instances
Skill3 starsChanged yesterdayMITView on GitHub
Run several simultaneous instances of one macOS app (e.g. two or three accounts logged into WeChat at once) by duplicating and re-signing its .app bundle. Use when an app refuses to open a second window and just refocuses the running one, when `open -n -a <App>` launches no new process, or when a second independent login session for the same app is needed without a second macOS user account or VM.
In this repository31 other files it gives its agents.
- affix-domainsSkill
- apple-designSkill
- apwcli-pairSkill
- ask-always-on-agentSkill
- asus-esc8000-firmware-upgradeSkill
- asus-esc8000-gpu-bios-tuningSkill
- build-stealth-rustdeskSkill
- chrome-cdp-setupSkill
- cua-macos-lume-sandboxSkill
- deploy-kimi-k26-on-rtx-pro-6000Skill
- deploy-kimi-k3-on-rtx-pro-6000Skill
- deploy-stealth-rustdeskSkill
- ghostty-terminfoSkill
- herdr-rename-hookSkill
- imsg-permissionsSkill
- llm-inference-benchmarkSkill
- lxd-docker-firewall-conflictSkill
- mac-mini-as-headless-serverSkill
- macos-smb-serverSkill
- mac-smb-automountSkill
- openclaw-diagnoseSkill
- paseo-profilesSkill
- private-fork-syncSkill
- refresh-claude-accountSkill
- ssh-claude-authSkill
- sync-claude-accountsSkill
- to-featuresSkill
- trusted-publishSkill
- ubuntu-lxd-gpu-serverSkill
- ubuntu-nvidia-gpu-enablementSkill
- ubuntu-zfs-mirror-installSkill
The file
Files
Run several instances of a macOS app
Duplicate and re-sign a macOS app bundle so each copy runs as a separate process the OS treats as a different app: its own sandbox container, its own login session, running alongside the original. Verified on WeChat 4.1.15 (Tencent, App Store, sandboxed): two accounts logged in at once, each in its own container, on 2026-10-25.
Facts every step rests on
open -n -ais not the fix. It forces a new launch request, but an app with its own single-instance IPC check (most chat/IM apps) just detects the sibling and refocuses it — no new process shows up inpgrep.- The container follows the bundle ID, not the code signature. A sandboxed app's data lives at
~/Library/Containers/<CFBundleIdentifier>/. Change the identifier in a copy and macOS hands it a fresh, empty container at launch. - A plain ad-hoc re-sign drops the sandbox.
codesign --force --deep --sign -keeps no entitlements, so the copy runs unsandboxed. WeChat still builds its data path under~/Library/Containers/<id>/, but other apps may not. - Keeping the sandbox needs care. An ad-hoc signature cannot carry
com.apple.application-identifierorcom.apple.developer.team-identifier; drop them. Keepcom.apple.security.application-groups, renamed to match the copy (5A4RE8SF68.com.tencent.xinWeChat→…xinWeChat2): sandboxed WeChat registers Mach services under that name and dies 1 s after launch (deny mach-register …MachPortRendezvousServer) without it. - The copy is a snapshot, not a mirror. It doesn't track vendor updates. Rebuild it from the updated original; the data stays in the container, so the login survives.
Use the script
scripts/multi_app.py does it all:
python3 <skill-dir>/scripts/multi_app.py # next copy: /Applications/WeChat2.app, then WeChat3.app, …
python3 <skill-dir>/scripts/multi_app.py /Applications/Foo.app
python3 <skill-dir>/scripts/multi_app.py --refresh # after the original updates: rebuild every copyEach copy N gets bundle ID <original>N, CFBundleName/CFBundleDisplayName <App>N (and <localized name>N in every *.lproj/InfoPlist.strings, which is what Finder, Spotlight and the Dock show: WeChat2, 微信2), and no Contents/PlugIns (the Share and FileProvider extensions would register twice under the original's IDs). The script signs it sandboxed first, launches it, and checks the main process is alive after 3 s; if not, it re-signs plain, launches again and says the copy runs without a sandbox. The copy is left running. --refresh skips a running copy, and warns when a once-sandboxed copy falls back to plain, since it then no longer sees its old data. python3 scripts/test_multi_app.py checks the numbering.
du -sh the original first: WeChat is about 700 MB per copy.
Verify
pgrep -fl 'MacOS/WeChat$' lists one process per instance. codesign -d --entitlements - --xml /Applications/WeChat2.app | plutil -p - shows app-sandbox and the renamed group. lsof -p <pid> of the copy's main process shows files only under ~/Library/Containers/<original>N. Log a second account into the copy; the original stays logged in.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

