V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
pray123
V2EX  ›  macOS

求助 Mac OS 上如何设置或修改进程名称?

  •  
  •   pray123 · Jan 21, 2022 · 2523 views
    This topic created in 1557 days ago, the information mentioned may be changed or developed.

    试过在终端中给 python 、php 命令创建软链接执行脚本,仅在 ps 中更改进程名称,Activity Monitor 中仍显示原进程名( python 、php )。 网上搜索过多种方法尝试都失败... 也可能是太菜了 求大佬赐教更改运行时 Activity Monitor 中显示的进程名称简单方法

    xtinput
        1
    xtinput  
       Jan 21, 2022
    你这是闲的无聊吧,要改活动监视器那个进程名显示那就 hook 活动监视器的可执行程序吧
    pray123
        2
    pray123  
    OP
       Jan 21, 2022
    @xtinput 不是闲的,不想装监控软件但要开办公软件就必须运行该监控程序,想试试随便执行一个简单程序并修改进程名为监控程序名能不能运行办公软件。不熟悉 MacOS ,像在 win 下随便命名一个 xx.exe 执行任务管理器里头进程名就是 xx 。
    f64by
        3
    f64by  
       Jan 21, 2022
    复制一份 Python 可执行文件并改名,然后手动使用该可执行文件启动 Python 脚本
    leoleoasd
        4
    leoleoasd  
       Jan 21, 2022
    c 语言写一个无限等待的程序,编译后改名为那个监控程序的名字运行
    sky96111
        5
    sky96111  
       Jan 21, 2022 via Android
    刚刚在 Linux 用 cpp 试验了一下,编译好的文件直接改名是可以的,mac 是类 Unix 系统应该也一样
    xtinput
        6
    xtinput  
       Jan 21, 2022
    @pray123 用虚拟机
    xtinput
        7
    xtinput  
       Jan 21, 2022
    @pray123 把监控程序和办公软件丢虚拟机里隔离
    pray123
        8
    pray123  
    OP
       Jan 24, 2022
    @xtinput
    @f64by
    @leoleoasd
    @sky96111 感谢以上热心回复 v 友,采用可执行文件改名方式确实可行
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   6101 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 35ms · UTC 02:21 · PVG 10:21 · LAX 19:21 · JFK 22:21
    ♥ Do have faith in what you're doing.