You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -45,6 +45,30 @@ Alternatively, it might be easier to save debug logs to a file instead:
45
45
46
46
(note that both long and short-form of the command-line arguments are demonstrated in the above examples)
47
47
48
+
### Launching Binary Ninja from the command line (CLI)
49
+
50
+
While it has always been possible to launch Binary Ninja from the command line (shell), passing file paths or URLs to open, as of 5.0, it is now possible to have some control over whether it will open in an already running instance of Binary Ninja, or in a new instance. (Previously, this would always start a new Binary Ninja application instance, unless a `binaryninja:` URL was found on the command line.)
51
+
52
+
Now in version 5.0 and later, unless the [`ui.files.commandLine.newInstance`](settings.md#ui.files.commandLine.newInstance) is set to `True` (which it currently is by default), running Binary Ninja from the command line will try to find a running instance in which to open any files or URLs passed on the command line, or activate the main window if no arguments are provided.
53
+
54
+
There are a few ways to affect this behavior:
55
+
1. Passing the `-n` or `--new-instance` command line argument will _always_ cause a new Binary Ninja application to be launched.
56
+
2. If the `BN_FORCE_NEW_INSTANCE` environment variable is set or if the [`ui.files.commandLine.newInstance`](settings.md#ui.files.commandLine.newInstance) setting is true, it will open a new instance _unless_ there are file or URL command line arguments, in which case it will still try to open in a running instance if possible.
57
+
3. If the `BN_FORCE_EXISTING_INSTANCE` environment variable is set, it will try to open in a running instance if possible, _unless_ the `-n` or `--new-instance` command line argument is passed. (This is mainly intended for development testing purposes and is documented here for completeness.)
58
+
59
+
Disabling [`ui.files.commandLine.newInstance`](settings.md#ui.files.commandLine.newInstance) has the following implications:
60
+
* For users whose workflow involves running Binary Ninja from a shell, just running `binaryninja` will try to activate a running instance, and if it does, return you to your shell. Otherwise it will launch a new instance of Binary Ninja.
61
+
* Running `binaryninja` with a file path (or paths), like `binaryninja /bin/ls /bin/cat`, will
62
+
1. Try to activate existing tabs for those files in a running instance, or failing that,
63
+
2. Try to open those files in new tabs in a running instance, or failing that,
64
+
3. Open those files in a new instance of Binary Ninja.
65
+
66
+
Finally, some things to note:
67
+
* The Binary Ninja executable you run must be the _exact same version_ (both edition and build number) in order to communicate with a running instance.
68
+
* If there are multiple instances of the same version of Binary Ninja already running, it is generally the first one launched that will be activated. If the first instance terminates, a new instance will open when run from the command line.
69
+
* A "forced new instance" of Binary Ninja will remain independent.
70
+
71
+
48
72
## Troubleshooting Plugins
49
73
50
74
While third party plugins are not officially supported, there are a number of troubleshooting tips that can help identify the cause. The most important is to enable debug logging as suggested in the previous section. This will often highlight problems with python paths or any other issues that prevent plugins from running.
0 commit comments