macOS: open can start a second copy of an app that was just launched
Mantenedores costumam responder em até 1 dia
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Facilidade para iniciantes
- 45/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Ativa
- Stack de tecnologia
- typescript
- Domínio
- cli, mobile-dev
Direção de pesquisa
Start by tracing the macOS open command and its helper that selects an NSRunningApplication; the issue does not name their file paths or tests. Reproduce the quick relaunch case, then inspect how the command launches by bundle ID and how the helper chooses a process. Done means an already running app can be targeted without starting a duplicate or confusing two copies with the same bundle ID.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Summary
On macOS, agent-device open <bundleId> --platform macos can start a second copy of an app that is already running, then drive whichever copy NSRunningApplication.runningApplications(withBundleIdentifier:).first returns.
Repro
- Launch an app yourself (e.g. a dev build started by a supervisor process with custom launch arguments).
- Within ~0.5–0.75 s, run
agent-device open <bundleId> --platform macos. psshows two processes for the bundle: the original (with its arguments) and a new one with ppid 1 and no arguments.
Cause: open runs /usr/bin/open [-g] -b <bundleId> without first checking for a running instance. A process that was just spawned isn't listed by LaunchServices yet (lsappinfo lists it ~0.5–0.75 s later), so open -b launches a new copy. If you wait until lsappinfo find bundleid=<id> pid=<pid> returns the process, open attaches and only one copy remains (3/3 runs).
Proposal
- Before calling
open -b, check for a running instance of the bundle (NSRunningApplication orlsappinfo) and attach to it instead of launching. - Offer an explicit target, e.g.
--pid <pid>or an app path, so a caller that launched the app itself can attach to that exact process. - In the macOS helper, resolve the target by pid when one is known, rather than
.first, so two copies with the same bundle id can't be confused.
Context: Stim's stim macos launches dev builds this way; we're adding a LaunchServices wait on our side, but the attach behavior would make open safe for any caller.
- Linguagem predominante
- TypeScript
- Estrelas
- 5k
- Forks
- 334
- Merge médio
- 12h 29min
- PRs com merge (30d)
- 663
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Sem modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de callstack/agent-device
-
`devices` reports a phantom Android emulator named after the emulator's crashdata INFO bannerTalvez já em andamento @airowe assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
callstack/agent-device#3716 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
callstack/agent-device#1869 ·
Mantenedores costumam responder em até 1 dia
-
backlog refactor
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 8/100
callstack/agent-device#3759 ·
Mantenedores costumam responder em até 1 dia
-
backlog enhancement needs-triage
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 8/100
callstack/agent-device#3758 ·
Mantenedores costumam responder em até 1 dia
-
enhancement ready-for-agent
Dificuldade 5/5 Mais de uma semana Facilidade para iniciantes 15/100
callstack/agent-device#3757 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de callstack/agent-device
Issues semelhantes
-
`cf complete zsh >> .zshrc` fails on vanilla zshTalvez livre de novo Um pull request para esta issue foi fechado sem ser mesclado. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 75/100
cloudflare/cf#340 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
-
Rename Madson cameraAberta
Dificuldade 2/5 Menos de uma hora Facilidade para iniciantes 75/100
StoDevX/AAO-React-Native#8785 ·
Mantenedores costumam responder em até 1 dia
-
Broken links in the docsAberta
Dificuldade 1/5 Menos de uma hora Facilidade para iniciantes 75/100
-
bnv-manager-v2: accept_invite creates the Mailcow domain admin before the commitTalvez já em andamento @myOmikron assumiu hoje. Abertabug ready-for-agent
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100