Browse Source

README

master
boB Rudis 1 year ago
parent
commit
67d2eef167
No known key found for this signature in database GPG Key ID: 1D7529BE14E2BBA9
  1. 10
      README.md

10
README.md

@ -6,7 +6,7 @@ Apple M1/Apple Silicon/arm64 macOS can run x86_64 programs via Rosetta and most
Activity Monitor can show the architecture, but command line tools such as `ps` and `top` do not due to Apple hiding the details of the proper `sysctl()` incantations necessary to get this info.
Patrick Wardle reverse engineered Activity Monitor<https://www.patreon.com/posts/45121749> — and I slapped that hack together with some code from Sydney San Martin — https://gist.github.com/s4y/1173880/9ea0ed9b8a55c23f10ecb67ce288e09f08d9d1e5 — into a nascent, bare-bones command line utility `archinfo`.
Patrick Wardle reverse-engineered Activity Monitor <https://www.patreon.com/posts/45121749> — and I slapped that hack into a bare-bones command line utility `archinfo`.
It returns columnar output or JSON (via `--json`) — that will work nicely with `jq` — of running processes and their respective architectures.
@ -27,6 +27,14 @@ $ archinfo
...
```
```bash
$ archinfo --pid $(pgrep keyboardservicesd)
60298 x86_64 /usr/libexec/keyboardservicesd
$ archinfo --json --pid $(pgrep keyboardservicesd)
{"pid":60298,"arch":"x86_64","name":"/usr/libexec/keyboardservicesd"}
```
```
Rscript -e 'table(jsonlite::stream_in(textConnection(system("/usr/local/bin/archinfo --json", intern=TRUE)))$arch)'
##

Loading…
Cancel
Save