Skip to content
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

adb devices is not working straight after pairing #1

Open
SuperSandro2000 opened this issue Nov 6, 2022 · 10 comments
Open

adb devices is not working straight after pairing #1

SuperSandro2000 opened this issue Nov 6, 2022 · 10 comments

Comments

@SuperSandro2000
Copy link

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
Copy link

frech87 commented Dec 26, 2022

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

@saleehk
Copy link
Owner

saleehk commented Dec 28, 2022

@SuperSandro2000 does this adb pair not doing that?

@saleehk
Copy link
Owner

saleehk commented Dec 28, 2022

Can you share more context ?

@SuperSandro2000
Copy link
Author

SuperSandro2000 commented Dec 30, 2022

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
Copy link

vnt-83 commented Feb 27, 2023

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
Copy link

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

@zoutepopcorn
Copy link

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
Copy link

fiurthorn commented Sep 7, 2023

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
Copy link

ess debugging]->[Pai

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

@fiurthorn
Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants
@saleehk @zoutepopcorn @SuperSandro2000 @fiurthorn @vnt-83 @bibek-magar @frech87 and others