how can i sync and transfer to and fro my tp2 and mac book pro?
thanks guys
If you have snow leopard, its supposed to have activesync.
If you're still on an older OS, there is a ($40) program called missing sync.
What I did is went the totally free route and bounced contacts through google. First enable addressbook to sync to google, then have phone sync to google. I've only tried it with contacts, its supposed to be able to do email and calendar from google to phone as well.
OBEX push also works from my hackintosh to the phone, but not in reverse for files.
The sync app in sl doesn't work. Already tried. Nothing on mac works. I want to transfer files etc from tp2 to mac and nothing works.
Did you try the file transfer setting in the Bluetooth settings?
On the phone? I probably did but right now not sure exactly what you mean. Sorry.
Go to Bluetooth settings, expand on Advanced (+ arrow), click on File Transfer, choose a location to receive files. Set your phone to discoverable.
On Mac, click on Bluetooth icon in menu bar (usually top right), click on Browse Device, choose your phone from list, click ok.
On phone you'll be prompted to pair with Mac and enter a 4 digit passcode of your choice, do that. Mac will prompt for same passcode, enter same 4 digit passcode. Accept all communications from Mac on phone.
Now, on Mac, the Bluetooth File Exchange utility will display the contents of whatever folder (or memory card) you chose as your save folder. Drag and drop files to it or from it and that's it.
I might update later with screenshots when i have time.
I already paired and entered the code thingy. But did not know anything about a utility in the mac blue tooth menu. I only tried the transfer on phone and nothing happened on mac or the phone could not see mac to transfer. The active sync or whatever it is on the mac sees the phone but says it can't sync with it. So I'll look in the bluetooth menu. F it works this is cool.
How fast would it transfer music from my MacBook pro to the phone?
Thanks alot for telling me about the utility in the Bluetooth menu on mac.
While I don't own a Mac, I know my brother in law has had success with bluetooth for transfering files between my Vogue and his mac as well as the use of it for a personal area network.
Have you tried using the use as drive option when you connect it by usb? this (I would think as it just acts as a uSB key) should work as long as you have a memory card in your phone. It won't "sync" though.
Android - Remote your android phone via usb cable or wireless router from PC.
Phone must be ROOTED!
Download droid VNC server - http://goo.gl/hYLXp - install it.
Download android adb driver - http://goo.gl/faiJU
extract adb.zip driver to Local Disk C = C:\adb
Now, click start, click RUN, type CMD, - ENTER
type adb command - cd \ - ENTER, type adb.exe - ENTER.
type - adb forward tcp:5901 tcp:5901 - ENTER
type - adb forward tcp:5801 tcp:5801 - ENTER
Go back to you're phone and open/start droid VNC Server
Wireless Mode - Phone and Computer must be connected to the same router.
Follow instruction on the phone screen once you press start - Example http://192.168.1.2:5801/ <--- type this in your Computer browser = Enjoy!
USB Cable Mode - Disable data connection (flight mode). Start droid VNC Server, Follow instruction on the phone screen once you press start - Example http://localhost:5801/ <--- type this in your Computer browser.
Once you able to remote your phone from you computer browser, press phone menu and re-enable data connectivity (disable flight mode) = Enjoy!
Works on any phone or just droid and how to make it work on ubuntu.........?
Mr.Oug said:
Works on any phone or just droid and how to make it work on ubuntu.........?
Click to expand...
Click to collapse
Linux – Remote Desktop Viewer (use the command line). Remote Desktop Viewer is pre-installed in Ubuntu.
nice, I've already tried this, but it's not responsive enough
I try and is wonderful
Inviato dal mio GT-I9001 usando Tapatalk
I tried this on my Motorola Droid.
For Windows, I had some trouble getting it to work. Tight VNC works, RealVNC does not. You have to play with the colors and settings a little bit (it doesn't like compression).
Useful, but not useful enough for me to want to leave it running all the time....
little bit slow, but worth it
didnt work for me. Ultra VNC and TightVNC and I played with settings. Most I got was a black screen. VNC server thing is like stuck so I revoked permissions etc. Even rebooted to get it out for sure. Now did those adb commands just leave my ports exposed? how do I ensure they are closed? For me too, I got no keyboard to put a password for the server.
Update...Ok it works, but that VNC thing is buggy on my Nexus.. I don't see anything but a black screen. If I click in approximate location of where the buttons are to stop and start server i click the button on my nexus. So I got no display and I fiddled with the settings and cannot get it working from my pc with UltraVNC or Tightvnc.. Oh well.
I'd also would like to know about the adb commands opening ports on my phone. I want to make sure those are closed, so I'd appreciate a way to confirm that. It will be cool when/if I can vnc to my phone. Not sure why you would want to but regardless it would be fun to do.
I just use TeamViewer to connect droid to laptop, i leave my laptop at home on Wi-Fi signal all the time and connect to my laptop thatway i can browse and download torrents on a whim, access all my files and use ftp to transfer to phone i can access any kind of file on my phone because i installed Download All Files
Worked for me, defy+ and TightVNC on Ubuntu
Slow, but great!
I have a galaxy tab 2 7.0 wifi version with CM 10.1 on it. I have the ubee freedom stick from freedompop. I brought the otg usb dongle but the 4g stick is not working. It turns on and the middle blue light flash and then it turns off. Anyone got it to work?
joe.stay said:
I have a galaxy tab 2 7.0 wifi version with CM 10.1 on it. I have the ubee freedom stick from freedompop. I brought the otg usb dongle but the 4g stick is not working. It turns on and the middle blue light flash and then it turns off. Anyone got it to work?
Click to expand...
Click to collapse
Okay. Update. I got it to turn on and stay on with signal bars but internet doesn't work.
Yea i need help with this too. I want to get it working on my Galaxy S4.
BTW try this: http://forum.xda-developers.com/showthread.php?t=1921928
didnt work for me terminal said no such port or somthing
I tried that link but its a no go there.
Reply to your request for help
sharpknight said:
Yea i need help with this too. I want to get it working on my Galaxy S4.
BTW try this: http://forum.xda-developers.com/showthread.php?t=1921928
didnt work for me terminal said no such port or somthing
Click to expand...
Click to collapse
Hello Sharpknight,
Although I am not a developer maybe I can help. I'll share some of my learning's with you. The Freedompop dongle I have has a feature called "Diskless Install" It initially acts like a USB Memory Stick and downloads the drivers then it is supposed to switch automatically into the 3G/4G mode and then connects to the web. Every other time it is installed it is supposed to switch back into the Memory stick mode. In case you plug it into another computer.
By the way If you try something and it doesn't work you may wish to unplug and replug the dongle as it may be in the wrong mode? You may even want to try rebooting. That may change the mode on the dongle.
First I did not see if you had rooted your S4. You must root your device before my instructions will work. If it is rooted, plug in your dongle and wait for it to lock onto the signal. You should have two or more bars that indicate the signal is being recv'd by the dongle.
Next launch the terminal mode and enter super user mode by typing "su".
At the next prompt type netcfg (note the port eth0 maybe?)
It will list all of the Mac addresses, ports and the IP addresses connected. If you can match the mac address of your dongle with what is shown in the table it is seeing the dongle.
I am not sure it conflicts but I turn off the WIFI radio also. I read somewhere that it would display the dongle connection in the system WIFI control panel although my Acer never has.
If you can see the dongle in the netcfg listing the next thing you have to do is assign the IP addr. by following these steps:
type: Ifconfig eth0 192.168.1.12 ( Can be any IP address you choose (You can type: netcfg again to confirm the Dongle is seen by the Tablet)
type: dhcpcd eth0 ( Wait for lease to complete and next prompt.)
type: setprop net.dns1 8.8.8.8 (use any dns server - I used Google's free dns server or 8.8.4.4 also Google)
Launch your favorite browser and input 192.168.14.1 (for the FreedomPop PXU1964) for the URL or what ever URL is required by your device.
The FreedomPop setup screen should appear. Click on Network about center screen and it should show how many bytes transferred.
Click on the Advanced Link and insure it's set to NAT Mode.
I hope this helps - I will be out of internet range until Monday if you send me a note when I get back I'll reply if I see another post from you.
By the way I tried to reply to your post and it says you have turned off the reply via email in your profile.
Regards,
- Phil
PBates123 said:
Hello Sharpknight,
Although I am not a developer maybe I can help. I'll share some of my learning's with you. The Freedompop dongle I have has a feature called "Diskless Install" It initially acts like a USB Memory Stick and downloads the drivers then it is supposed to switch automatically into the 3G/4G mode and then connects to the web. Every other time it is installed it is supposed to switch back into the Memory stick mode. In case you plug it into another computer.
By the way If you try something and it doesn't work you may wish to unplug and replug the dongle as it may be in the wrong mode? You may even want to try rebooting. That may change the mode on the dongle.
First I did not see if you had rooted your S4. You must root your device before my instructions will work. If it is rooted, plug in your dongle and wait for it to lock onto the signal. You should have two or more bars that indicate the signal is being recv'd by the dongle.
Next launch the terminal mode and enter super user mode by typing "su".
At the next prompt type netcfg (note the port eth0 maybe?)
It will list all of the Mac addresses, ports and the IP addresses connected. If you can match the mac address of your dongle with what is shown in the table it is seeing the dongle.
I am not sure it conflicts but I turn off the WIFI radio also. I read somewhere that it would display the dongle connection in the system WIFI control panel although my Acer never has.
If you can see the dongle in the netcfg listing the next thing you have to do is assign the IP addr. by following these steps:
type: Ifconfig eth0 192.168.1.12 ( Can be any IP address you choose (You can type: netcfg again to confirm the Dongle is seen by the Tablet)
type: dhcpcd eth0 ( Wait for lease to complete and next prompt.)
type: setprop net.dns1 8.8.8.8 (use any dns server - I used Google's free dns server or 8.8.4.4 also Google)
Launch your favorite browser and input 192.168.14.1 (for the FreedomPop PXU1964) for the URL or what ever URL is required by your device.
The FreedomPop setup screen should appear. Click on Network about center screen and it should show how many bytes transferred.
Click on the Advanced Link and insure it's set to NAT Mode.
I hope this helps - I will be out of internet range until Monday if you send me a note when I get back I'll reply if I see another post from you.
By the way I tried to reply to your post and it says you have turned off the reply via email in your profile.
Regards,
- Phil
Click to expand...
Click to collapse
Those ^ directions work. Only thing you might have to do differently is set the USB stick to NAT mode via your PC. Log in to 192.168.14.1 via your PC browser and put it into NAT mode. Then use those instructions. Worked for me on the Galaxy S4. Thanks Phil.
Awesome - Glad it worked!!
sharpknight said:
Those ^ directions work. Only thing you might have to do differently is set the USB stick to NAT mode via your PC. Log in to 192.168.14.1 via your PC browser and put it into NAT mode. Then use those instructions. Worked for me on the Galaxy S4. Thanks Phil.
Click to expand...
Click to collapse
:good:
Not working with CM10 on Nook HD+
PBates123 said:
If you can see the dongle in the netcfg listing the next thing you have to do is assign the IP addr. by following these steps:
type: Ifconfig eth0 192.168.1.12 ( Can be any IP address you choose (You can type: netcfg again to confirm the Dongle is seen by the Tablet)
type: dhcpcd eth0 ( Wait for lease to complete and next prompt.)
type: setprop net.dns1 8.8.8.8 (use any dns server - I used Google's free dns server or 8.8.4.4 also Google)
Click to expand...
Click to collapse
So, what kernel module / driver is missing if I can light up the stick and see the bare USB device, but netcfg never sees an eth0 device?
I am running CyanogenMod 10.2 on a B&N Nook HD+ (but I tried CM10.1 with exactly the same results).
Thanks in advance...
FreedomPop Dongle w/ CyanogenMod on B&N NookHD+
wanderso said:
So, what kernel module / driver is missing if I can light up the stick and see the bare USB device, but netcfg never sees an eth0 device?
I am running CyanogenMod 10.2 on a B&N Nook HD+ (but I tried CM10.1 with exactly the same results).
Thanks in advance...
Click to expand...
Click to collapse
Hello Wanderso,
I was in Dripping Springs & Austin a week ago - for the week.....
Here is a couple of things. CyanogenMod 10.1 or 10.2 should have everything you need.
1. Plug your FreedomPop dongle into a PC or laptop first and follow the instructions with the unit to put it into NAT mode. Open a browser window and type 192.168.14.1 (if my memory is correct) and go from there.
By the way FreedomPop has a couple of dongles. I have never tried this procedure with the newer dongles. But there is no reason I know of that would stop this from working on those.
2. Next in my instructions I used eth0 (thats eth zero, but could be any available port eth1, eth2, or usb0 or usb1, ect)
Also remember that every other time the Dongle is plugged in it acts like a jump drive with a start-up program on it. So if it doesn't respond when you run your script or type it in, unplug it and re-plug it and try the script again. The second time it is installed it acts like the Radio dongle and not like a jump drive. Let me know if that helps.
Good luck! - Phil
Also for a little more history and maybe a few tips check out this thread toward the bottom I documented the steps I took to get my Acer A500 working it might also help.
http://forum.xda-developers.com/showthread.php?t=1921928
PBates123 said:
I was in Dripping Springs & Austin a week ago - for the week.....
Click to expand...
Click to collapse
Phil:
Hope you enjoyed your visit to Central Texas, but you missed the great weather we are having now, and ACL :good: but come back anytime...
I've tried your entire procedure, but the issue (I believe) is a issue in the CDC and/or RNDIS drivers on the Nook HD+ (Ovation). I need some diagnostic procedures to understand what the kernel is thinking when I plug in the stick. No "eth0" or "usb0" device shows up when i plug it in, even though it is connecting to the WiMax network (as indicated by the external lights on the stick). I have set the stick to NAT mode on a PC, and have tried to plug / unplug to get it to cycle through its boot modes.
Wanderso
FreedomPop Dongle w/ CyanogenMod on B&N NookHD+
wanderso said:
Phil:
Hope you enjoyed your visit to Central Texas, but you missed the great weather we are having now, and ACL :good: but come back anytime...
I've tried your entire procedure, but the issue (I believe) is a issue in the CDC and/or RNDIS drivers on the Nook HD+ (Ovation). I need some diagnostic procedures to understand what the kernel is thinking when I plug in the stick. No "eth0" or "usb0" device shows up when i plug it in, even though it is connecting to the WiMax network (as indicated by the external lights on the stick). I have set the stick to NAT mode on a PC, and have tried to plug / unplug to get it to cycle through its boot modes.
Wanderso
Click to expand...
Click to collapse
Thanx Wanderso not sure when the next time I'll be there is.
As I am not a developer I had to spend a lot of time researching to come up with the procedure I used. I did a quick google search and found this link among others that seemed to fit the issue your having. What puzzles me with this issue is that the device should be recognized as a USB Drive initially by your Nook HD+, and it doesn't seem to do so. OH! Just had a brain flash! One of the problems many tablets have is that these Dongles draw a lot of power, sometimes more than the ports on the tablets can supply due to the radio. Can you try a powered USB port extension to see if that helps?
Here is the link I ran across in the google search: http://stackoverflow.com/questions/12974114/detection-of-plugged-in-usb-device
Could you keep me in the loop as you have me intrigued and I like to see how to solve the problem. I'll keep looking and let you know if I find anything that may help you solve the problem.. We can solve this I'm sure! :good:
Regards,
- Phil
PS. I ran across a thread with what is suspiciously like the problem I refered to the USB ports draw down the voltage and caused connection problems. check it out:
http://bookclubs.barnesandnoble.com...ce-not-recognized-resolved/td-p/813686/page/2
This thread is more of a question.
Yesterday I was trying to accsess the internal SD card's files. I was having trouble mounting the drive to Ubuntu12.04 and found out that it is really difficult and a long prosess, so I thought of the idea of using its SD card as a Network Drive so i can acsess all of its files without plugging it in and mounting it. Is this possible?
brandrobbart said:
This thread is more of a question.
Yesterday I was trying to accsess the internal SD card's files. I was having trouble mounting the drive to Ubuntu12.04 and found out that it is really difficult and a long prosess, so I thought of the idea of using its SD card as a Network Drive so i can acsess all of its files without plugging it in and mounting it. Is this possible?
Click to expand...
Click to collapse
I use ubuntu 13.10 and it has a bit of trouble mounting it as well. If it's already plugged in and I try mounting it I usually get an error a couple of times before it will mount then it's fine. However if I unplug the cord and plug it back in, it will mount it no problems. I have tried using the USB port on my router for the same thing and it didn't want to recognize it. I haven't tried doing it wirelessly but I do know you could install an ftp server app on your shield and then R/W to the SD card that way, or you should be able to at least.
hexitnow said:
I use ubuntu 13.10 and it has a bit of trouble mounting it as well. If it's already plugged in and I try mounting it I usually get an error a couple of times before it will mount then it's fine. However if I unplug the cord and plug it back in, it will mount it no problems. I have tried using the USB port on my router for the same thing and it didn't want to recognize it. I haven't tried doing it wirelessly but I do know you could install an ftp server app on your shield and then R/W to the SD card that way, or you should be able to at least.
Click to expand...
Click to collapse
I have found an application that creates an FTP server on the shield, i just cant figure out a way to connect Ubuntu to that FTP server to acsess the SD card.
brandrobbart said:
I have found an application that creates an FTP server on the shield, i just cant figure out a way to connect Ubuntu to that FTP server to acsess the SD card.
Click to expand...
Click to collapse
You use the LAN IP of the shield. Connect to it through your web browser, or, which is a better option, download an FTP client to your computer and use that.
hexitnow said:
You use the LAN IP of the shield. Connect to it through your web browser, or, which is a better option, download an FTP client to your computer and use that.
Click to expand...
Click to collapse
I tried using FileZilla and connecting to my lan ip and it could not connect.
brandrobbart said:
I tried using FileZilla and connecting to my lan ip and it could not connect.
Click to expand...
Click to collapse
never used that client before so i cant say anything about it. Do you have the correct user and password entered and if not using do you have guest privileges set on the server? Using proper port?. There has to a better option then this, ill see if i can find anything.
hexitnow said:
never used that client before so i cant say anything about it. Do you have the correct user and password entered and if not using do you have guest privileges set on the server? Using proper port?. There has to a better option then this, ill see if i can find anything.
Click to expand...
Click to collapse
I typed in all the fields correctly, Filezilla would just not connect. I also tried going to the "connect to server" option on Ubuntu and set it to FTP server and that also could not connect.
This is a PSA for those who mirror their Android phone onto Windows each day that there is a wonderfully convenient new TILE for Wireless debugging.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Android Wireless-debugging tile
That new Wireless-Debugging tile replaces this sequence of commands:
Settings > Developer options > Wireless debugging = on
But a lot of things turn that 'Wireless debugging' switch off on you!
Boot turns W/L debug off
It's not easy to find that new TILE though, where I found it here.
Settings > Developer options > Quick settings developer tiles
Wireless debugging = on
Which gets automatically turned off whenever your Wi-Fi is turned off
(so you're constantly turning it back on if you have Wi-Fi not set to turn on automatically & if auto-reconnect is also off for privacy reasons).
Allow wireless debugging
In summary, this new "developer options tile" for 'wireless debugging" is a great time saver as it's required to mirror Android over Wi-Fi without USB.
ScrCpy vs Vysor PC mirror
--
The background is for privacy I have my home router set to not broadcast the SSID (so as to keep it out of databases which don't respect the "_nomap" opt-out naming conventions and to prevent most phones from uploading it even to the servers that do respect the opt out naming conventions) and therefore, it's required for privacy to also set my Android Wi-Fi radio to not broadcast that SSID when I'm away from that home router (i.e., Android Wi-Fi setting for that specific SSID is set to not auto-reconnect).
Because of those two privacy options (one on the router, the other on the phone), whenever my phone disconnects from Wi-Fi (e.g., if I drive down the driveway away from my home router), the Wi-Fi on the phone also turns off, which is exactly what I want to happen.
However, when I return home, the Wi-Fi on the phone has to be manually turned on, and so does 'Wireless debugging' in 'Developer options' because you need to be connected to a Wi-Fi access point and you need to have Wi-Fi Debugging turned on in order to establish a Wi-Fi adb connection over Windows to mirror the phone display, keyboard, mouse, and clipboard onto the PC (without ever needing to use a USB cable, even only momentarily).
Given that background, I was seeking a simpler way to turn on Androiud 'Wireless debugging', which turns out to be adding this 'Wireless debuggon = on/off' goggle tile to your Android swipe-down menu.
The use model is when you reboot the PC or when you return home, you swipe down on Android 12 to tap both the Wi-Fi and 'Wireless debugging' toggling tiles, and then you can mirror your phone onto your PC using the following adb commands on the phone and PC (listed in step-by-step order although there are many ways to accomplish the same task - this is only one of them)
(Phone) Swipe down & manually turn on Wi-Fi via the "Wi-Fi" TILE
(Phone) Longpress on that 'Wi-Fi' TILE to connect to a previously saved AP
(Phone) Tap to toggle the 'Wireless debugging' Android TILE on.
(PC) C:\> adb kill-server (optional, to set a known starting point)
(PC) C:\> ping 192.168.0.2 (optional, to check if you're on the LAN)
(PC) C:\> adb devices
(PC) C:\> vysor.exe (this will bring up the Vysor GUI to mirror Android)
Note prior to Android 11, to establish that adb connection over Wi-Fi, you first had to use a USB cable to set up tcpip on port 5555 and _then_ after establishing a link to adb, you could disconnect USB to use it on Wi-Fi.
C:\> ping 192.168.0.2 (optional to test you're on the LAN over Wi-Fi)
C:\> adb kill-server (optional to start at a known starting point)
C:\> adb tcpip 5555
C:\> adb connect 192.168.0.2:5555 (port is optional)
C:\> adb devices (optional to see what devices are connected over adb)
But the situation I'm describing does _not_ need to use that USB cable.
Great explanation THANKS!!!
One silly issue, where you can have a lead for me:
every time Wireless Debug reconnects it will change randomly IPort number
I use SCRCPY which is similar to VYSOR... but completely free...
it will not be able to reconnect not knowing what port to call, and having lost the previous one.
Using SCRCPY I'm mirroring two static androids on USB and that's fine,
but the issue is with the other two mobile androids ( main & backup ) that I have to connect wireless because they are moving with me.
This is part of the .BAT for my main cell> POCO F3
::Go wireless instead
:Wireless
ADB connect 10.0.1.103:38277
scrcpy.exe --window-x 1500 --window-y 45 -s 10.0.1.103:38277
Click to expand...
Click to collapse
This is POCO F3 W. D. screen with the ver changing port number
.... BAT results are the same with the wrong port and without a port number
By default without a Port Number,
it will try only the standard port:55555 and as per the previous Port:38227 it will not be authorized to use it !!!
Is there a way to set fixed that Port number?
I have to manually look at it and then change it in my .BAT.
Even a simpler roundabout that allows me to get back my androids automatically on the PC will be fine !!!
AlainCh2 said:
every time Wireless Debug reconnects it will change randomly IP port number
Click to expand...
Click to collapse
I know. I know. It happens to me also.
It's even worse in some ways in that BOTH ports change.
That is, every once in a while the random port changes for the adb "connect" command:
C:\> adb connect 192.168.0.2:12345
And, at the same time, the random port (which is a DIFFERENT port!) also changes for the adb "pair" command (as does the 6-digit PIN).
C:\> adb pair 192.168.0.2:54321 123456
Sometimes the port stays the same for days, sometimes it changes. I haven't tested yet what circumstances change that port, but I agree with you that it happens a lot.
AlainCh2 said:
I use SCRCPY which is similar to VYSOR... but completely free...
it will not be able to reconnect not knowing what port to call, and having lost the previous one.
Click to expand...
Click to collapse
I use both scrcpy and vysor (both of which are free, but vysor has some non-free stuff that I don't need).
Interestingly Vysor "says" it won't do pure wireless without paying for it but that isn't true - both scrcpy & vysor work completely wirelessly.
Vysor won't give you the good resolution without paying for it while scrcpy will give you better resolution all the time.
They're essentially the same (as far as I can tell anyway)... where I had to write a script to make scrcpy work without the console though (whereas vysor works without the console without modification).
Certainly Vysor is SLOWER than scrcpy on startup, where scrcpy is almost immediate and nothing needs to be put onto Android, but with Vysor, it MUST install some temporary vysor.apk each time you run it, but once they're both up and running, the speed is indistinguishable (as far as I can tell).
The one thing Vysor seems to do better than scrcpy is it seems to figure out better what port adb is currently on - but I don't know how Vysor does it - and - worse - Vysor doesn't do it correctly every time.
It's frustrating - which is why I AGREE with you that if we could somehow lock the port down on Android - that would solve the problem - or - if we could figure out using a Windows command what the current port is on Android - that would also solve the problem.
We need help from Windows/Android experts!
AlainCh2 said:
By default without a Port Number,
it will try only the standard port:55555 and as per the previous Port:38227 it will not be authorized to use it !!!
Click to expand...
Click to collapse
I'm with you about the port number having to be put into the batch file, where I have a batch file for scrcpy that no longer requires the port but I have to establish the adb connection first unfortunately.
AlainCh2 said:
Is there a way to set fixed that Port number?
I have to manually look at it and then change it in my .BAT.
Click to expand...
Click to collapse
I have the same problem that the port keeps changing.
I have the same question as you do, but I was approaching it from the OTHER angle.
That is, the batch file can ascertain what the port number is.
That's possible - but I don't know Windows well enough to be successful all the time. Sigh.
AlainCh2 said:
Even a simpler roundabout that allows me to get back my androids automatically on the PC will be fine !!!
Click to expand...
Click to collapse
I think there are two approaches to a solution.
1. Try to keep the port static, or,
2. Try to figure out the port (after the fact) in the batch file.
I've been working on the latter using these Windows commands.
C:\> netstat -ano -p tcp | findstr "192.168.0.2"
C:\> adb shell "ifconfig|grep -A 1 wlan0|tail -n 1|cut -f2 -d:|cut -f1 -d' '"
C:\> adb mdns services
C:\> nmap 192.168.0.2
But I need help in how to figure out the port from Windows.
Once we figure out the port, we can feed it to the batch files.
Wow, interesting!
Would I've been in my glorious years my brain would have helped a, lot.
Now I'll try to do my best.
Differences in our network management:
Cell side
>All my cell's IP are static by router
>All my cell have USB Debugging enabled
>All my cell have Wireless enabled :: Unless the phone disable it
LAN side
>My LAN is always on > All home is covered but 2mt of south balcony
>I lose Wireless When I leave Home :: When I go on South Balcony
__________________________________
My full script is quite simple and contain REM'd the debug instructions
Code:
::@echo on
@echo off
powershell -window hidden -command ""
:: Poco F3 - PF3s - M2012K11AG
:: --serial a7ff2388
:: --serial 10.0.1.103:38277 37751 39685 37293
cd /d "D:\D_\ScrCpy - ScreenCopy\"
:Top
::Start "trying a go on USB - WIRED"
scrcpy.exe --window-x 1500 --window-y 45 -s a7ff2388
:: Check if the wire is connected
:: if the exit code is >= 1, no phone on wire
if errorlevel 1 TimeOut /t 4 /nobreak
::Goto Top
::Go wireless instead
:Wireless
ADB connect 10.0.1.103:37293
scrcpy.exe --window-x 1500 --window-y 45 -s 10.0.1.103:37293
::::: I Must use as -SERIAL the IP and not the ADB serial "a7ff2388" >no reason given
::Exit
::Pause
::Back on Wire
Goto Top
Let's see what I've got so far:
#Port number
the number change every time :: IP Reconnect :: Wifi Reconnect :: no other reason
From you I get that ...
We can in some way divine the port number
With netstat / ipconfig using the fixed cell Ip
But so far it seems No cells are connected to the LAN
103 = PocoF3
109 = P9 Lite
110 = HonorW10
105 = N5T
065 = T365
for sure I'm doing something wrong using this command: "netstat -ano -p tcp"
I checked as well "netstat -ano -q"
For sure PF3s is now connected on USB to the PC, but also sure it should appear on LAN as well
The router see all of them
When I come back home, it seems that the cell have not reset the Wireless debugging
but that's not true !!!
When I enable it, it will assign a new port...
... will it announce on the network as "port OPEN xyyyzxx"
... or it will be used just LISTENING to check the connect request??
BTW : I never used the pairing method you use.
While I know that you can look at all the TCP connections related to your IP
I have a big doubt that W10 would see the full Lan IP_Ports from its own interface.
...
..... digging down on that.
.... Mumble ... mumble .. mumble...
YEEEESSSSSS!!!
My brain became sluggish but it still work - in a way
Netstat and IPConfig works only from inside to any outward connection/adapter,
and they cannot go looking out.
You have to use a different command "PORTQRY" to be downloaded from Microsoft itself:
"To view the TCP/UDP open port state of a remote host, type “portqry.exe –n [hostname/IP]” where [hostname/IP] is replaced with the hostname or IP address of the remote host. You can also specify to scan for a particular port using the “-e [port_number]” parameter, a particular range of ports using the “-r [start_range:end_range]” parameter, or a group of ports in a particular order using the “-o [port1, port2, port3]” parameter."
Last thing to do:
Learn how to use "portqry.exe"
____________________________________________
Here we go from my observations:
Assuming the random port being in the range 30k-44k, I need to check who's listening.
I get the identification string response > using the known port I checked in Android's PF3s settings.
But the process takes several minutes up to half an hour...
NP this is the first screenshot... just in case you read it before I'm back online.
#@#!!!!!
ok, it took 12 minutes to check 138 ports !!!
I tested that on a shorter range_
Seems I cannot delimit correctly the FINDSTR "xxxxxxxxxx"
It's a good night for me !!!
<2022-08-02 01:23:41>this post took 3hours 11minutes 33seconds - using a very large amount of my BRAIN<
:-D
Wow. That's a lot to digest. You did great work!
Really great work!
Thanks for all that work on behalf of me and you and everyone!
I will have to take HOURS to go through all the wonderful work you did, particularly in finding that "portqry.exe" command that maybe can tell us what port the Android phone recently switched to (since that's the root of the problem!).
BTW, regarding the "adb connect" versus "adb pair", I think the difference is just in encryption (connect apparently isn't encrypted), where if that's the case, it doesn't matter which you use otherwise.
However, I could be wrong, so I had asked a while ago here, but nobody answered the question unfortunately.
What's the difference between Windows/Android adb "connect" versus adb "pair" when mirroring Android 12 over Wi-Fi onto a Windows PC?
Since you posted your script, here is my scrcpy script which gets rid of the console (but adb has to already be connected for it to work without the port number - which is how I use it most myself).
Code:
@echo off
REM C:\app\editor\android\scrcpy\showwin.bat
REM adb mdns services
REM List of discovered mdns services
REM netstat -ano -p tcp | findstr "192.168.1.10"
REM TCP 192.168.1.27:15919 192.168.1.10:41913 ESTABLISHED 7904
REM
cd /d "c:\app\editor\android\scrcpy"
certutil -f -decode %~f0 showwin.exe>nul
REM Port 5555 was needed when you established adb connections over USB
REM And then you disconnected the USB cable to subsequently work on Wi-Fi
REM But as of Android 11 or 12, you can establish the connection over Wi-Fi
REM But that "Developer option" "Wireless debugging" port is assigned by Android!
REM So you have to get it on Android or on Windows to know what it is
REM adb connect 192.168.1.10:5555
REM You can get the current port from the following command
REM c:\> netstat -ano -p tcp | findstr "192.168.1.10"
REM
REM maybe we do NOT need this command after all???
REM adb connect 192.168.1.10:41913
:: now we hide console window
showwin.exe 0
REM scrcpy --always-on-top --tcpip=192.168.1.10:5555
REM Maybe we can then remove the IP:PORT after all???
REM scrcpy --always-on-top --tcpip=192.168.1.10:41913
REM We don't really need --always-on-top after all???
REM scrcpy --always-on-top
scrcpy
:: after scrcpy is closed we show console window again
showwin.exe 5
del showwin.exe
goto :eof
-----BEGIN CERTIFICATE-----
TVpgAQEAAAAEAAAA//8AAGABAAAAAAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAoAAAAA4fug4AtAnNIbgBTM0hTmljZSB0byBtZWV0IHNvbWVi
b2R5IHdobyBpcyBzdGlsbCB1c2luZyBET1MsDQpidXQgdGhpcyBwcm9ncmFtIHJl
cXVpcmVzIFdpbjMyLg0KJFBFAABMAQEAUHmlNgAAAAAAAAAA4AAPAQsBBQwAAgAA
AAAAAAAAAADIEAAAABAAAAAgAAAAAEAAABAAAAACAAAFAAAAAAAAAAQAAAAAAAAA
ACAAAAACAAAAAAAAAwAAAAAAEAAAEAAAAAAQAAAQAAAAAAAAEAAAAAAAAAAAAAAA
GBAAADwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAYAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAALnRleHQAAAAmAQAAABAAAAACAAAAAgAA
AAAAAAAAAAAAAAAAIAAA4AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABoEAAAAAAAAJQQAACmEAAA
uhAAAAAAAABgEAAAAAAAAAAAAABUEAAAABAAAIQQAAAAAAAAAAAAAHYQAAAIEAAA
AAAAAAAAAAAAAAAAAAAAAAAAAABVU0VSMzIuZGxsAABoEAAAAAAAAAAAU2hvd1dp
bmRvdwAAS0VSTkVMMzIuZGxsAACUEAAAphAAALoQAAAAAAAAAABHZXRDb21tYW5k
TGluZUEAAABHZXRDb25zb2xlV2luZG93AAAAAEV4aXRQcm9jZXNzAP8VCBBAADHS
SECAOAB0EYA4InUC99IJ0nXvgDggdepAMfa9BQAAAA+2EEAI0nQTgOowcvOA+gl3
7mv2CgHWMe3r5QntdAKJ7v8VDBBAAFZQ/xUAEEAAagD/FRAQQAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAA==
-----END CERTIFICATE-----
In addition, if you run any free WebDAV server, you can mount your entire Android phone (even most of the read-only root partition!) as a drive letter onto Windows without having to use FTPUse to do it.
C:\> net use Z: \\[email protected]\DavWWWRoot /USER:foo bar & net use Y: \\[email protected]\DavWWWRoot /USER:foo bar
I had to use TWO free webdav servers though... one for the internal sdcard and one for the external sdcard - each on a different port - as nobody solved the problem I posed a while ago over here asking how to do it with just one webdav server.
Can you mount BOTH Android internal & external storage onto Windows as a drive letter over Wi-Fi using a SINGLE WebDAV server?
AlainCh2 said:
Last thing to do:
Learn how to use "portqry.exe"
Click to expand...
Click to collapse
This morning I downloaded the Microsoft PortQry command where I place what I did below to help save time for others who can read this instead of doing it to get an idea of what it is & how it installs.
1. Googling, I found the canonical location of the Microsoft command.
PortQry Command Line Port Scanner Version 2.0<https://www.microsoft.com/en-us/download/details.aspx?id=17148>
2. I downloaded it (where I'm not sure if this URL is static or dynamic):
<https://download.microsoft.com/download/0/d/9/0d9d81cf-4ef2-4aa5-8cea-95a935ee09c9/PortQryV2.exe>Date: 20220802Name: PortQryV2.exeSize: 151112 bytes (147 KiB)SHA256: 6471C5190A99E3D1F337FCFEF1FC410E8D487B66E093F924700E186CBD398DC0
Doubleclicking on the file above asks to unzip it.
It wants to go by default into c:\PortQryV2Instead I put it where it belongs at c:\app\network\portqry (Note that I decide where things belong... not a billion different developers who don't have a common vision.)
Resulting in:
Date: 20220802Name: PortQry.exeSize: 143360 bytes (140 KiB)SHA256: FB6CEBADD49D202C8C7B5CDD641BD16AAC8258429E8FACE365A94BD32E253B00
Then I downloaded the port query user interface.
PortQryUI - User Interface for the PortQry Command Line Port Scanner<https://www.microsoft.com/en-us/download/details.aspx?id=24009><https://download.microsoft.com/download/3/f/4/3f4c6a54-65f0-4164-bdec-a3411ba24d3a/PortQryUI.exe>
Resulting in:
Date: 20220802Name: PortQryUI.exeSize: 217160 bytes (212 KiB)SHA256: D462DD1AD77B37E9E681F9A779550B3918AF4925EC6F3D0014E6880B69B98126
Doubleclicking on the file above asks to unzip it.
It wants to go by default into C:\PortQryUIInstead I put it where it belongs at C:\app\network\portqry (Note that I decide where things belong... not a billion different developers who don't have a common vision.)
Date: 20220802Name: portqueryui.exeSize: 70656 bytes (69 KiB)SHA256: DCD38075F8D594763A498FE884A85394DB66BB604A0A1E6E6AC823923ADD910D
I doubleclick portqueryui.exe and a GUI comes up & I type the IP address of the phone (sans port) and then the MS Port Query GUI runs a scan of the phone's IP address, which, let's face it, takes a very long time to complete (at least with the defaults it does).
BTW, I've noticed the ports used by adb seem to always be in the same range of 3#### and 4#### so maybe we can save some time by scanning only those ports as explained here.
How To: Mastering PortQry.exe<https://techgenix.com/portqry-howto/>Specifically:C:\> portqry -n 192.168.0.2 -r 30000:40000And, well, um, er... it takes FOREVER and reports a lot of "NOT LISTENING" lines which are useless to us for our purpose... so I see (belatedly) now why you needed the "find string" syntax to find just the ports that adb is using!If we knew more about adb, maybe we could query more specifically the type of ports adb uses (e.g., mdns services)?
AlainCh2 said:
Differences in our network management:
Cell side
>All my cell's IP are static by router
>All my cell have USB Debugging enabled
>All my cell have Wireless enabled :: Unless the phone disable it
LAN side
>My LAN is always on > All home is covered but 2mt of south balcony
>I lose Wireless When I leave Home :: When I go on South Balcony
Click to expand...
Click to collapse
As I explained over here a while ago, most of us do a bunch of things that provide us Wi-Fi privacy that we have to keep in mind, where what I do is somewhat similar to what you do, as shown below.
My home SSID/passphrase do not contain identifying words
So as to keep out of WPA2/PSK butterfly/rainbow hash tables
While at the same time they are as unique as I can make them
And I change them every once in a while for obvious reasons
Where the SSID has "_nomap" (it used to also have "_optout_")
But that doesn't stop WiGle/NetStumbler/Kismet/etc. uploads
And that doesn't stop passwerby from uploading to Google/Mozilla servers either!
Even as these well-behaved servers "say" they scrub this information
So that Google/Mozilla get it - but they don't publish it
Because you can be tracked if anyone knows your phone SSID
Simply by querying the public servers with any other known SSID
So I also turn off the broadcast of that SSID on my home router
Which means the cell phone has to remember the SSID
But the phone would "shout out" that SSID with AutoConnect
So I turn "AutoConnect=off" on the cell phone
So now, when I go down my driveway, it doesn't shout it out
In addition, I used to randomize the MAC by each SSID
Which meant that random BSSID was "reserved" on my router
And that the IP address was set to "static" on the phone
New in Android 12 Developer options, I can now randomize the phone's Wi-Fi MAC address on each and every connection
While still reserving the IP address on the home router
And, like you, every phone I get, the first thing I do is enable USB debugging (so I can recover from a smashed screen), yet, with Android 12, there's never a need for a USB cable anymore as everything it did is now rendered obsolete nowadays...
a. Many phones charge wirelessly nowadaysb. My phone is mirrored (sound/screen/keyboard/clipboard) over Wi-Fi to my PC (sndcpy,scrcpy,visor)c. My unrooted phone is mounted as a drive letter onto Windows (Z: for the internal sdcard and Y: for the external sdcard)And, of course, there are a few things which are forbidden on my phone:
a. There will never be a mothership tracking account (not Google, not Samsung, not my Bank, nothing)b. There will never be a way to pay for anything or to get money from anywherec. There will never be a log in to a mothership account (except, perhaps, email, when necessary)
And, most radios are turned off by default, and only turned on when necessary and then turned off again...
a. Uploads of other people's Wi-Fi to Google servers are always permanently turned off
b. The GPS radio is off by default & location accuracy is always off
c. The NFC radio is turned off by default
d. The Bluetooth radio is turned off by default
e. Developer options Wireless debugging is on by default (but it turns off when the AP is no longer connected when I leave my driveway)
The only radios left on, by default are:
a. The cellular radio
b. The cellular data radio
And I have a few cellular and cellular data aps monitoring when I'm out of cellular calling/data range (but this isn't a privacy thing per se).
GalaxyA325G said:
BTW, I've noticed the ports used by adb seem to always be in the same range of 3#### and 4#### so maybe we can save some time by scanning only those ports as explained here.
How To: Mastering PortQry.exe<https://techgenix.com/portqry-howto/>Specifically:C:\> portqry -n 192.168.0.2 -r 30000:40000And, well, um, er... it takes FOREVER and reports a lot of "NOT LISTENING" lines which are useless to us for our purpose... so I see (belatedly) now why you needed the "find string" syntax to find just the ports that adb is using!If we knew more about adb, maybe we could query more specifically the type of ports adb uses (e.g., mdns services)?
Click to expand...
Click to collapse
I suppose you missed the last part of my message after "learn how to use" it
Range:
I checked it from the past reconnections: ports 30xxx to 44xxx
TIME:
It took me 20 minutes to do 138 ports
>>>but maybe ... sending to log instead of using cache... can be faster
SEARCH:
I showed the found string as well
_______________________
I've got the string to look at >> "e): LIST"
_______________________
°-°
The most difficult task is now up to you:
How to pass the found record to ADB & SCRCPY
String found = VAR1
>> ADB CONNECT IP:"VAR1"
>> SCRCPY ..... -s IP:"VAR1"
°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
Big issue is the time needed to connect the cell to the PC
> for the first time after you get home
For me, reconnecting it's twice a week in a normal situation, 'cause I'm normally locked in bed...
...but I imagine you and other people are in a different situation.
For me, it would be no problem at all, if under 1 hour,
provided that the .Bat will wait for the PocoF3
> xxx.103 to appear in LAN, before starting to look for the port.
This is why:
After a foraging boot, I enter the LAN while I'm parking the car downstairs.
Both Car and Cell connect nearly at the same time.
It will take some time ....
to climb 19 steps and getting upstairs, enter the home, arrange all the goods, then do the chores at hand
.... as much as 20 to 40 minutes or more will pass before I finally go to the PC and lay back onto the bed.
(usually forgetting somewhere the phone till it will ring - or I need for an SMS confirmation code, for instance)
I would have to rise and search - no matter how I feel
>>> that's the reason it's so useful for me to have it wireless on PC <<<<<
Even if it takes a long time I wouldn't probably even notice it,
if I'm not going straight to the PC, and in that case, I plug the cell in USB.
It's after that I may forget again, rise and search. So now I maniacally do Port's manually.
( unless I forget to do it the first time - start again from tiles zero )
I just came home and connected to scrcpy via adb over port 41703
(which I knew was the port from looking at the phone, but I WISH I could figure out that port from Windows!)
C:\> adb connect 192.168.0.2:41703 && scrcpy
Click to expand...
Click to collapse
And then I ran the Microsoft port query command (which is as slow as a lazy dog), but at least portqry.exe listed that port as "listening"...
c:\app\network\portqry\portqry -n 192.168.0.2 -e 41703
Querying target system called:
192.168.0.2
Attempting to resolve IP address to a name...
Failed to resolve IP address to name
querying...
TCP port 41703 (unknown service): LISTENING
Click to expand...
Click to collapse
Of course, I cheated as I already knew the port was 41703 by looking at the phone by longpressing on the new Android 12 "Developer options Wireless debugging tile" (which saves a bunch of steps digging into Android Settings and then Developer options).
But assuming I didn't know the port, but only knew the range, this would work (but it's horribly slow).
c:\app\network\portqry\portqry -n 192.168.0.2 -r 41700:41705
TCP port 41700 (unknown service): NOT LISTENING
TCP port 41701 (unknown service): NOT LISTENING
TCP port 41702 (unknown service): NOT LISTENING
TCP port 41703 (unknown service): LISTENING
TCP port 41704 (unknown service): NOT LISTENING
TCP port 41705 (unknown service): NOT LISTENING
Click to expand...
Click to collapse
Of course, I cheated by giving the slow portqry command a small range, as it would have taken forever to give it the range of 30000 to 40000 which is, so far, the range that I've seen being used.
Hindsight is so 20/20 in that once you've cheated such that you know the "static" IP & "random" port that Android set the new Android 12 Developer options Wireless debugging to, many basic network commands will quickly tell you that specific IP address is being used.
This will instantly report the "static" IP address of the adb-connected phone on my Windows 10 PC:
C:\> adb shell "ifconfig|grep -A 1 wlan0|tail -n 1|cut -f2 -d:|cut -f1 -d' '"
192.168.0.2
Click to expand...
Click to collapse
And, more to the point, the basic networking commands can tell you the random port - if - for example - if you had connected to it using adb yesterday or a week ago and that random port assignment had not changed in the interim...
This will tell you the "static" IP address and the "random" port:
C:\> netstat -ano -p tcp | findstr "192.168.0.2"
TCP 192.168.0.2:2392 192.168.0.2:41703 ESTABLISHED 1928
Note I left in the extraneous report of another port (2392) which was in use for reasons unknown to me...
Click to expand...
Click to collapse
What we need, of course, is a way to narrow down the range of ports that adb will use, which, to that end, I opened this thread about:
[adb,scrcpy,vysor] What ports does Android 12 randomly set when Wi-Fi connecting via Wireless debugging adb "pair" or "connect" commands?
GalaxyA325G said:
Of course, I already knew the port was 41703 by looking at the phone by longpressing on the new Android 12 "Developer options Wireless debugging tile" (which saves a bunch of steps digging into Android Settings and then Developer options).
Click to expand...
Click to collapse
TILE:
If I tap it, I can enable the option.
If I long press it, nothing happens and the tiles disappear immediately
> strange, isn't it ?
GalaxyA325G said:
I think there are two approaches to a solution.
1. Try to keep the port static, or,
2. Try to figure out the port (after the fact) in the batch file.
Click to expand...
Click to collapse
I think we have another option here:
3. Set IN ANDROID ADB the port we want.
That can be done using an Android.Bat activated by the wifi connection event
..... and HERE WE GO with the android terminal string for the standard port:
>> adb -d shell setprop service.adb.tcp.port 55555
Referring to:
Is it possible to adb connect android via wifi without configuring port on android?
I can connect via wifi by typing these codes in android terminal - setprop service.adb.tcp.port 5555 stop adbd start adbd and connect ip:port on PC adb .. it is connected .. Is there any possibi...
android.stackexchange.com
____________________________________________________________________
The following under bash:
$ export ANDROID_ADB_SERVER_PORT=12345
$ adb start-server
* daemon not running. starting it now on port 12345 *
* daemon started successfully *
$ adb devices
List of devices attached
TA2070M5O6 device
$ ANDROID_ADB_SERVER_PORT=6789 adb devices
* daemon not running. starting it now on port 6789 *
* daemon started successfully *
List of devices attached
Refering to:
How to make adb listen to tcpip 5555 after reboot
I have to use adb over ssh. now, everything works fine but after a reboot i have to connect my device again over usb and set adb to listen to tcpip instead of usb. is ther a way to save those settings? This is how it works for now. After a...
forum.xda-developers.com
________________________Start testing ______________________
Poor results >> I don't know Linux or Android enough
>> Please Step-In
___________________Waiting you ______________
I'm reading this:
Android Debug Bridge (adb) | Android Studio | Android Developers
Find out about the Android Debug Bridge, a versatile command-line tool that lets you communicate with a device.
developer.android.com
And we got a hit on the first 20 lines !!!
>>>>>> I take a break... see you in 7-9 hours
AlainCh2 said:
TILE:
If I tap it, I can enable the option.
If I long press it, nothing happens and the tiles disappear immediately
strange, isn't it ?
Click to expand...
Click to collapse
That is strange indeed.
The reason it matters is that this brand new Android 12 Developer options Wireless debugging tile saves a LOT of time daily digging into the Android settings (because it takes you exactly where you need to be to find out what the current random port assignment is).
I guess we need a third person to test it as when I tap the new tile, it toggles from on to off and from off to on... but when I longpress it, I end up deep inside the Developer options Wireless debugging Activity (whether or not the tile was blue or white at the time that I longpressed it).
I even just now tested it for you with the Wi-Fi radio turned off, and again with the Wi-Fi radio turned on but with no access point being connected.
In summary, even though the Developer option for Wireless debugging won't work without BOTH the Wi-Fi radio being turned on AND the Wi-Fi being connected to an access point (mine being set to NOT auto-reconnect, for privacy reasons), longpressing on the Developer options Wireless debugging tile brought me, every time, to the Developer options Wireless debugging screen.
I'm on a Samsung Galaxy A32-5G, Android 12, non rooted.
Would someone else kindly test it for us to break the tie?
AlainCh2 said:
I think we have another option here:
3. Set IN ANDROID ADB the port we want.
Click to expand...
Click to collapse
I love the way you think!
Here are the possible solutions (thanks to you):
1. Keep the random port assignment static between adb connections
Or...
2. Determine the current random port assignment from the PC
Or...
3. Manually set the port assignment from the PC!
(Which is much like we used to do in the days of USB cable connections (where we would set it to 5555 and then disconnect once we set it to that static port).
I love how you think as you're trying to solve the same problem we all have, but you're using more tools to do it as you think outside the box by using all the methods available.
I will have to try this on the PC on the MSDOS command line (which is outside of Bash as I don't have Linux inside of the PC set up yet).
AlainCh2 said:
>> adb -d shell setprop service.adb.tcp.port 55555
Click to expand...
Click to collapse
I'll try to follow in your footsteps on the Windows 10 MSDOS command line (which requires a different style of environment variables)...
AlainCh2 said:
$ export ANDROID_ADB_SERVER_PORT=12345
Click to expand...
Click to collapse
This seems to be how to set Win10 user-specific environment variables...
C:\> setx [variable_name] "[variable_value]"
And this is how to set Win10 system-wide environment variables:
Win+R > cmd {Ctrl+Shift+Enter} <-- admin windowsetx [variable_name] "[variable_value]" /M
Which means I can use this in the MSDOS admin cmd window:
Win+R > cmd {Ctrl+Shift+Enter}setx ANDROID_ADB_SERVER_PORT "55555" /M
AlainCh2 said:
$ adb start-server
* daemon not running. starting it now on port 12345 *
* daemon started successfully *
$ adb devices
List of devices attached
TA2070M5O6 device
Click to expand...
Click to collapse
I think I'm with you only up to this point... starting with...
a. Android has Wi-Fi turned on
c. Android has the Wi-Fi connected to an access point
d. Android has Developer options Wireless debugging = on
e. Which reports a static IP & random port of 192.168.0.2:41269
And then running these commands in your footsteps...
1. Win+R > cmd {Ctrl+Shift+Enter}
2. adb kill-server
3. setx ANDROID_ADB_SERVER_PORT "55555" /M
SUCCESS: Specified value was saved.
4. adb start-server
* daemon not running; starting now at tcp:5037
* daemon started successfully
5. adb devices
List of devices attached
adb-SERIALNUMBER._adb-tls-connect._tcp. offline
6. set ANDROID_ADB_SERVER_PORT
Environment variable ANDROID_ADB_SERVER_PORT not defined
(funny... I thought I had already defined it, system wide... oh well... )
7. set ANDROID_ADB_SERVER_PORT=55555
8. set ANDROID_ADB_SERVER_PORT
ANDROID_ADB_SERVER_PORT=55555
Notice I'm with you up to this point so far...
AlainCh2 said:
$ ANDROID_ADB_SERVER_PORT=6789 adb devices
* daemon not running. starting it now on port 6789 *
* daemon started successfully *
List of devices attached
Click to expand...
Click to collapse
I don't (yet) understand what that command is doing so I can't even figure out how to reproduce it in the Windows 10 MSDOS batch command line.
AlainCh2 said:
View attachment 5676681
Click to expand...
Click to collapse
I remember seeing "setprop" stuff for adb when I had googled this, so we both need to look up what it does and what's the syntax.
AlainCh2 said:
>>>>>> I take a break... see you in 7-9 hours
Click to expand...
Click to collapse
I like how you think, which is that we "should" be able to set the port from WIndows that adb will connect to Android... but....
Remember all that "old" stuff predates Android 11 Developer options Wireless debugging (which is designed to use a random port assignment).
All that "old" stuff assumed a USB cable connection to the Android phone... which we aren't using....
... so what we have to do is figure out how to change that old stuff to get around the fact we can't talk to the phone unless we can figure out what port the phone is listening on...
This is the best I can do (but it's cheating)
a. Android has Wi-Fi turned on
c. Android has the Wi-Fi connected to an access point
d. Android has Developer options Wireless debugging = on
e. Which reports a static IP & random port of 192.168.0.2:41269
These commands ALWAYS work (but I had to cheat!)...
1. Win+R > cmd
2. adb kill-server
3. adb connect 192.168.0.2:41269
4. scrcpy --tcpip=192.168.0.2:41269
5. up pops the mirror of Android in the scrcpy GUI
While that works perfectly, the problem is that I have to KNOW the port before any of that works.
Hi,
as adb announces the service via MDNS, you can use the value of "persist.adb.wifi.guid" to connect.
output of avahi-discover under Ubuntu 20.04:
Code:
Service Type: _adb-tls-connect._tcp
Service Name: "value of persist.adb.wifi.guid"
Domain Name: local
Interface: eth0 IPv6
Address: Android.local/192.168.1.223:41465
TXT v = ADB_SECURE_SERVICE_VERSION
Or you can use "adb mdns services" to show all found devices in the network, see https://source.android.com/devices/automotive/virtualization/tools
Regards,
meiser
meiser said:
as adb announces the service via MDNS, you can use the value of "persist.adb.wifi.guid" to connect.
Click to expand...
Click to collapse
I don't know if I'm supposed to openly admit I have no clue what "mdns" even means, but I did use the "adb mdns services" command in post #3 above because I found it on the net when I had googled for how to tell which port adb is using.
C:\> netstat -ano -p tcp | findstr "192.168.0.2"
C:\> adb shell "ifconfig|grep -A 1 wlan0|tail -n 1|cut -f2 -d:|cut -f1 -d' '"
C:\> adb mdns services
C:\> nmap 192.168.0.2
Click to expand...
Click to collapse
The problem I had with using 'mdns' was that it sometimes gave me good port information and it sometimes did not (more often than not, it reported absolutely nothing useful) - yet - I haven't been able to figure out why - so I simply gave up on it a while ago.
Maybe I need to re-visit mdns because sometimes it gave what I wanted.
Googling, I find it's actually labeled mDNS, which now I only need to figure out what the "m" stands for since we're all familiar with DNS name-to-ipaddress lookups.
Googling some more, I find the "m" stands for "multicast" which still doesn't tell me a thing about what it is yet...
If you aren’t familiar, mDNS is a protocol defined by the Internet Engineering Task Force (IETF), the organization that oversees the technical standards that comprise the Internet. It stands for multicast domain name system, and it’s how hostnames are resolved on local networks without their own DNS server. The mDNS protocol is defined in full in the IETF’s RFC 6762 document, but the most relevant part is Section 5.1 – One-Shot Multicast DNS Queries, as it’s what Android’s DNS resolver implements.
Without getting too technical, mDNS basically makes it possible to connect to devices on a local network using human readable names, similar to how DNS makes it possible to connect to servers over the Internet using a human readable name.
Click to expand...
Click to collapse
What I'm guessing (at this point) is that Android will "announce" itself with a hostname of sorts using this "multicast DNS" protocol for the LAN, am I right?
Android, meanwhile, has offered support for mDNS service discovery since Android 4.1 Jelly Bean … but only for apps that implement the network service discovery (NSD) API. This means that Android users, for years now, haven’t been able to simply enter a hostname followed by .local into a web browser and have it be resolved to the IP address of a local device.
Click to expand...
Click to collapse
You mentioned "avahi" below... (which I also never heard of)...
meiser said:
output of avahi-discover under Ubuntu 20.04:
Code:
Service Type: _adb-tls-connect._tcp
Service Name: "value of persist.adb.wifi.guid"
Domain Name: local
Interface: eth0 IPv6
Address: Android.local/192.168.1.223:41465
TXT v = ADB_SECURE_SERVICE_VERSION
Click to expand...
Click to collapse
Now I see why you brought up "avahi" discover services...
Microsoft brought native support for mDNS to Windows with Windows 10 1703 in 2016, but prior to that, users could install Apple’s Bonjour Print Services tool to use the feature. Many Linux distros implement mDNS through the Avahi daemon. Apple, as the author of the protocol, of course has a native implementation in iOS and macOS.
Click to expand...
Click to collapse
The problem I've had with "adb mdns services" is sometimes it reports good information but other times it reports nothing.
meiser said:
Or you can use "adb mdns services" to show all found devices in the network, see https://source.android.com/devices/automotive/virtualization/tools
Click to expand...
Click to collapse
If we can figure out the circumstances as shown below where mDNS are in service, then the "adb mdns services" command might actually be useful to us to determine the Android 12 random port assignment.
1. Start with Android 12 & desktop PC connected to the LAN
2. Turn on Android Developer options Wireless debugging
3. Query Android for the wireless debugging port
The problem to resolve is...
a. When adb hasn't been run, mdns doesn't report anything
b. Even with adb connected, often mdns doesn't report anything
Yet...
c. Sometimes mdns DOES report the port address we seek
Why?
Screenshot: Notice we've been using "adb mdns services" for a while now but it rarely reports anything at all, let alone the random port assignment (but sometimes it does!).
GalaxyA325G said:
I love how you think as you're trying to solve the same problem we all have, but you're using more tools to do it as you think outside the box by using all the methods available.
Click to expand...
Click to collapse
That's what I did for a living in small companies like Olivetti, SIP/TelecomItalia, MCIWorldcom.
I'm a strange human being: I learned to program Assembler and PL1 in IBM, Gwbasic and COBOL on Mainframes, Honeywell OS, Digital PDP OS., and at last on Cisco routers
.... all by myself - and never worked programming ( but to better understand what was happening to my people)
______________________________________________
Sorry to say: you didn't got my lead correctly.
3: >android side
IF > we can run the equivalent of a ".BAT" file every time wifi connect
we can try setting the ADB port variable Android side,
making no assumptions on PC
But I don't know enough on that side,
nor do I know enough on Linux that's the Android base.
( I'm still curious - but brain is not agile anymore to learn fast to my liking)
AlainCh2 said:
That's what I did for a living in small companies like Olivetti, SIP/TelecomItalia, MCIWorldcom.
Click to expand...
Click to collapse
Yea, me too, where I worked in Silicon Valley startups for decades before retiring about 20 years ago...
AlainCh2 said:
I learned to program Assembler and PL1 in IBM, Gwbasic and COBOL on Mainframes, Honeywell OS, Digital PDP OS., and at last on Cisco routers
.... all by myself - and never worked programming ( but to better understand what was happening to my people)
Click to expand...
Click to collapse
Yup. I took Fortran (before there was a Fortran 77) on the IBM 1130 (as I recall) with tickertape just being phased out in favor of modern punch cards, and then moved on to PL/C (before there was a PL/1) and IBM Assembly Language and COBOL (which are just about the most divergent languages on the planet). Then the PDP 11, VAX/VMS, Masscomp, SunOS, Solaris, etc., until the PC grew up and I dropped all that 'nix stuff for Windows (and moved into management so I never did coding professionally - and I hate it - so I won't be doing it anytime soon).
But, like you, I do what I have to do in order to get the job done.
AlainCh2 said:
______________________________________________
Sorry to say: you didn't got my lead correctly.
Click to expand...
Click to collapse
Yeah. I'm Aspergers. I don't get anybody's jokes. Not just yours. But everyone's. Ask my wife and kids and grandkids.
On this thread I'm just trying to do what I am sure can be done, which is:
a. Run a PC command that queries the Android phone on the LAN
b. To spit out the random port Wireless debugging is set to
c. WITHOUT having initially connected USING that port in the first place!
It may not even be possible (since Android developers may have made it impossible for security reasons perhaps).
But until I find out that it's impossible - I'm assuming it's possible.
1. Sometimes we don't know which commands to use, and,
2. Sometimes we don't have the command syntax just yet... and,
3. Sometimes it is impossible (but that's rare, is it not?)
We just have to figure out which commands/syntax give us that missing port information.
GalaxyA325G said:
We just have to figure out which commands/syntax give us that missing port information.
Click to expand...
Click to collapse
Hehehe !! A parallel story, I'm younger but beaten bad by life: at 66, I'm pretty locked in a bed from 2017.
Had to stop working in 2015, and finally got anticipated retirement in 2019.
Asperger too.
( oh, and I mean we are not brother for sure - but magnetic communication exists)
3) >>I proposed a closed command program continuously running in Android.
It was not a Joke!
But maybe we can reach the same result from PC,
if we can access telnet console on android
AlainCh2 said:
I proposed a closed command program continuously running in Android.
It was not a Joke!
But maybe we can reach the same result from PC,
if we can access telnet console on android
Click to expand...
Click to collapse
I do very much like how you think... as you don't give up when encountering a technical hurdle - and - better yet - and nearer to my heart and soul - you - like I - assume naturally there will be a solution.
Maybe there is... hmmmmmmmm......
Along the line of your "closed command program" running on Android, I am testing this option I just found out of the open source local android debug bridge (ladb APK) which is designed to run adb on the Android phone in order to mimic the PC.
I'm hoping I can get the PC to communicate with that free open source ladb app which is said to have more privileges than does Termix on Android.
is there any app like LADB which can command phone through my phone with wireless debugging android 12 .I don't have any pc and LADB price is too high to afford.