在Mac上通过命令行打开STS的多个实例吗?

时间:2018-10-23 19:08:16

标签: spring eclipse macos spring-tool-suite sts-springsourcetoolsuite

我试图通过命令行args使多个版本的STS从它们自己的工作空间开始,并尝试使用this作为参考。

结果为:

$open -a ~/Applications/STS.app --args -clean
FSPathMakeRef(/Users/xxx/Applications/STS.app) failed with error -43.

STS的可执行文件在哪里?

我在MacOS High Sierra v.10.13.6

据我所知,STS最初以spring-tool-suite-3.9.3.RELEASE-e4.7.3-macosx-cocoa-x86_64.dmg的形式下载并以这种方式安装。

我读到在Mac上可以右键单击.app和我尝试过的“显示包内容”:

enter image description here

但是仍然无法从命令行访问它:

$ls -la ~/Applications/STS.app/Contents
ls: /Users/simeonleyzerzon/Applications/STS.app/Contents: No such file or directory

根据@ greg-449的评论,我现在正在尝试打开STS并将其指向另一个工作区位置:

$ open -a /Applications/STS.app -data /temp
open: invalid option -- d
Usage: open [-e] [-t] [-f] [-W] [-R] [-n] [-g] [-h] [-s <partial SDK name>][-b <bundle identifier>] [-a <application>] [filenames] [--args arguments]
Help: Open opens files from a shell.
      By default, opens each file using the default application for that file.
      If the file is in the form of a URL, the file will be opened as a URL.
Options:
      -a                Opens with the specified application.
      -b                Opens with the specified application bundle identifier.
      -e                Opens with TextEdit.
      -t                Opens with default text editor.
      -f                Reads input from standard input and opens with TextEdit.
      -F  --fresh       Launches the app fresh, that is, without restoring windows. Saved persistent state is lost, excluding Untitled documents.
      -R, --reveal      Selects in the Finder instead of opening.
      -W, --wait-apps   Blocks until the used applications are closed (even if they were already running).
          --args        All remaining arguments are passed in argv to the application's main() function instead of opened.
      -n, --new         Open a new instance of the application even if one is already running.
      -j, --hide        Launches the app hidden.
      -g, --background  Does not bring the application to the foreground.
      -h, --header      Searches header file locations for headers matching the given filenames, and opens them.
      -s                For -h, the SDK to use; if supplied, only SDKs whose names contain the argument value are searched.
                        Otherwise the highest versioned SDK in each platform is used.

1 个答案:

答案 0 :(得分:1)

应用程序为import matplotlib.pyplot as plt data = [ {'1': [(2000, 2000), (2050, 2000), (2050, 2100)], '2': [(1500, 1500), (1550, 1500), (1550, 1600)], '3': [(1700, 1700), (1750, 1700), (1750, 1850)], }, {'1': [(4000, 2000), (5000, 2000), (6000, 2010)], '2': [(4500, 1500), (4505, 1500), (3505, 1510)], '3': [(4700, 1700), (6705, 1700), (5705, 1710)], }, {'1': [(3300, 1000), (4080, 4000), (4000, 5010)], '2': [(3500, 3200), (3505, 2750), (2505, 1910)], '3': [(3700, 2600), (4705, 4100), (3705, 1310)], } ] fig, ax = plt.subplots() plots = {k: ax.plot([], [])[0] for d in data for k in d.keys()} current_frame = 0 max_frames = len(data) def on_click(event): print('Event') global current_frame current_frame = (current_frame + 1) % max_frames d = data[current_frame] [plots[k].set_data(list(zip(*v))) for k, v in d.items()] ax.relim() ax.autoscale() fig.canvas.draw_idle() fig.canvas.mpl_connect('button_press_event', on_click) plt.show() -在根文件系统中,不在您的主目录中,因此没有/Applications

就这样:

~

对于您的ls -la /Applications/STS.app/Contents 命令,您缺少open选项,该选项告诉打开其余的命令行用于该应用程序:

--args