V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Rust2015
V2EX  ›  Java

IDEA 在 Mac 下如何用命令行打开:

  •  
  •   Rust2015 · 18 天前 · 2010 次点击

    如 vscode 那样,code . IDEA 能否像它那样,idea .

    我在网上看了很多资料,还是没有成功

    9 条回复    2024-10-01 13:47:56 +08:00
    Immortal
        1
    Immortal  
       18 天前
    工具->创建命令行启动器
    xinge666
        2
    xinge666  
       18 天前
    建议使用 Toolbox ,在工具里面可以生成 Shell 脚本
    xarthur
        3
    xarthur  
       18 天前
    /Applications/IntelliJ\ IDEA.app/Contents/MacOS/idea
    ysc3839
        4
    ysc3839  
       18 天前
    open IDEA.app ?
    vkillwucy
        5
    vkillwucy  
       18 天前 via Android
    生成 shell 后对应目录,idea .就好啦
    dozer47528
        6
    dozer47528  
       18 天前
    上面说的 2 个方法都行,但我还是习惯自己设置 alias

    if [ -d '/Applications/Visual Studio Code.app' ]; then
    alias vs="open -a '/Applications/Visual Studio Code.app'"
    fi
    if [ -d '/Applications/IntelliJ IDEA.app' ]; then
    alias idea="open -a '/Applications/IntelliJ IDEA.app'"
    fi
    if [ -d '/Applications/WebStorm.app' ]; then
    alias webstorm="open -a '/Applications/WebStorm.app'"
    fi
    if [ -d '/Applications/GoLand.app' ]; then
    alias goland="open -a '/Applications/GoLand.app'"
    fi
    yiqiao
        7
    yiqiao  
       18 天前
    phpstorm 是可以这样的,idea 应该也可以。
    ` alias phpstorm='open -a PhpStorm' `
    8355
        8
    8355  
       18 天前
    @xinge666 快清缓存,我控制不住了。
    z1645444
        9
    z1645444  
       17 天前
    官方的说法: https://www.jetbrains.com/help/idea/working-with-the-ide-features-from-command-line.html#arguments
    主要看 Launcher for a standalone instance 的部分,找到对应的系统

    如果是 macOS ,直接往对应 shell 的 dotfile 里加入 export PATH="/Applications/GoLand.app/Contents/MacOS:$PATH" 就好了,这里是以 GoLand 为例
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   5423 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 08:51 · PVG 16:51 · LAX 01:51 · JFK 04:51
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.