saleehk / adb-wifi

49 stars 4 forks source link

adb devices is not working straight after pairing #1

Open SuperSandro2000 opened 1 year ago

SuperSandro2000 commented 1 year ago

After pairing the adb devices daemon is started but the device is not appearing there. I still need to run adb connect 10.20.30.40:37890. Could this be automated?

PS Thanks for this! wireless adb stops the pairing process so fast that it was a real hazzle to type in the port and code fast enough.

frech87 commented 1 year ago

Hi, great job. And then how to connect to device without using ip:port? Connect via _adb-tls-connect hostname

saleehk commented 1 year ago

@SuperSandro2000 does this adb pair not doing that?

saleehk commented 1 year ago

Can you share more context ?

SuperSandro2000 commented 1 year ago

does this adb pair not doing that?

no, you need to run adb connect IP:PORT afterwards otherwise it does not appear under `´adb devices`` but the qr code is currently not working for me. The spinner on my device just spins indefinitely

vnt-83 commented 1 year ago

Can I express my thoughts?

The function called connect (which calls exec adb pair) should be renamed to pair. And a new function called connect should be added (which calls exec adb connect).

And then in function startDiscover:

pair(item)
connect(item)
fiurthorn commented 1 year ago

But you have to use the connection port to connect, not the pairing port.

zoutepopcorn commented 1 year ago

Maybe we can do this:

const portscanner = require('portscanner')
const {exec} = require("child_process");

portscanner.findAPortInUse(36000, 49999, '192.7.1.1', (error, port) => {
    console.log('AVAILABLE PORT AT: ' + port)
    exec(`adb connect 192.7.1.1:${port}`, (error, stdout, stderr) => {
        if(!error) {
            console.log("connected")
        } else {
            console.log("oopsie")
        }
    });
})

But it can be slow. Or entering first 2 digits of the port?

fiurthorn commented 1 year ago

why not use the port from the android device? it is displayed right next to the qr code button.

function main() {
  console.log(
    "[Developer options]->[Wireless debugging]->[Pair device with QR code]"
  );
  if (process.argv.length < 3) {
    console.log("Usage: adb-wifi <port>");
    return;
  }
  showQR();
  startDiscover();
}
bibek-magar commented 6 months ago
ess debugging]->[Pai

did you solved it same for me... spinner is not stopping

fiurthorn commented 6 months ago

@bibek-magar https://github.com/fiurthorn/adb-wifi

AngelKrak commented 6 days ago

You can try checking if the same issue occurs with this project to fix it: https://www.npmjs.com/package/adb-qc