-
-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: manually start companion since idb connect cannot do it #20
Conversation
lib/tools/system-commands.js
Outdated
@@ -72,9 +74,44 @@ systemCallMethods.connect = async function connect (opts = {}) { | |||
} | |||
} | |||
|
|||
let port = DEFAULT_COMPANION_PORT; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does it work if the companion is already running?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It works insofar as it kills the running companion.
try { | ||
try { | ||
await tpExec(IDB_EXECUTABLE, ['connect', this.udid]); | ||
await tpExec(IDB_EXECUTABLE, ['connect', 'localhost', port]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
does it also listen on ipv6 (in case localhost is resolved to :::1)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea about that. If it did for connections managed by idb
then I imagine it does this way, too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I mean if netstat output shows the companion is only listening ipv4 then it is better to explicitly put 127.0.0.1
as the address
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like it does
$ netstat -an -ptcp | grep LISTEN
tcp46 0 0 *.10882 *.* LISTEN
...
063d47c
to
980c6fc
Compare
Letting
idb connect
do the heavy lifting of starting the companion itself does not work. It almost always results in an error likeSo start the companion and then connect to the port it starts on.
This also skips the tests for "describe device" since the underlying command does not support the JSON flag, and parsing the output is the task of another PR