[Q] remote vnc through usb connection - General Questions and Answers

Search, can't find it. any direction pointing would be great.
I'm trying to remote control a phone that is connected to a host PC.
This works:
Plug in phone to USB
In command prompt run: adb forward tcp:5801 tcp 5801
Also in command prompt run: adb forward tcp:5901 tcp:5901
Make sure Droid VNC Server is started on the phone
In UltraVNC viewer, browse to "localhost:5901"
I can now remote control this from the host PC using a vnc client ( chicken of the VNC)
What I want is to do this from a remote PC connecting through the host to the phone's vnc server.
Limited knowledge on the adb part of this, so might be missing something obvious
Can this work, does adb open a normal tcp port on the host ??

Related

Remote you phone from Computer!

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!

[Q] How to have an Android Device access its USB host's shell?

Let's say I have a Linux server without peripherals so it can only be accessed over SSH, for example. Let's say I want to access it without wifi. I'd like to plug in my phone and then access the server's shell over USB. Is there an app for that or a way to do that with a terminal emulator?
UPDATE:
I found this: http://www.android-hilfe.de/samsung...orum/143084-how-ssh-verbindung-ueber-usb.html (german) which does the opposite of what I want to do.

samsung smart swith for ubuntu?

hello, i am usning ubuntu. is there any desktop software for managing my tablet, like samsung smart switch on windows for ubuntu?
Scrcpy, adb, vnc
d9867eb said:
hello, i am usning ubuntu. is there any desktop software for managing my tablet, like samsung smart switch on windows for ubuntu?
Click to expand...
Click to collapse
There are a lot of choices to choose from if you want to manage your tablet with Ubuntu. However, there are different methods for different programs and you get different functions out of each. I'll compile a quick list for you, but without a little more specificity, I don't know what you mean by "manage".
1) VirtualBox - You can always use VirtualBox to run Windows and use that to install Samsung Kies/Smart Manager/etc.
apt install virtualbox
2) ADB - (USB Debugging must be enabled). Android Debug Bridge is a command-line based program to control different things on your device. To start, go to Settings - About Phone. Depending on your version of android it could be in "Software" or something along those lines but find "Build Number" and tap on it until it says "Developer Settings enabled". Afterward, go back to Settings and find the Developer menu. Turn it on first (there should be a box/slider/something on the top or in the menu) and go to USB Debugging. If it is grey'ed out and you can not turn it on, try turning off and on the developer settings. Once USB Debugging is enabled plug your device into the computer. The phone will ask a question about trusting the computer, press yes. Now, launch a terminal and type "adb devices". As long as only one device is plugged into your computer, and as long as the device is listed as "device" and not "offline" "unauthorized" or something like that, you can issue it commands! For more info on ADB, just google adb commands. "adb shell" gives you direct access to the /bin/sh shell in android. From there you can run commands directly through your tablet. Last note on this: 'adb tcpip 5555' restarts the adbd program on the tablet to listen for connections over the LAN/WAN/whatever it is connected to. To connect from the computer, type "adb connect <ip>" where <ip> is the tablet's IP address.
apt install android-tools-adb
3) scrcpy: Scrcpy is a program, written in java, that will use adb to display the screen of your android device in Ubuntu/anything that runs java. You can also click/type through it, allowing you to control it remotely. A word of warning: I don't know why, but my first few times trying to install this program were a major fail. I eventually got it, and it works pretty good, but it wasn't easy.
google: scrcpy (it's a github link)
4) VNC: You can install something like a VNC (Virtual Network Client) server or RDP (Remote Desktop Procedure) server on the tablet, and connect to it with tight/tiger vnc. Note: Device may have to be rooted for this, and, from my experience, most VNC servers wont work right. However, this has worked for my Samsung tablet in the past (the screen it broken on it but the digi is okay. I cant use scrcpy because scrcpy requires Lollipop I think and it has Kit Kat). I think the app "DroidVNC Server" was what I used.
5) Check Play Store for "android remote manager"
6) nuntius/kali-rolling 0.2.0-5+b1 amd64
share notifications from Android phone or tablet via Bluetooth or LAN
NOTE: I didn't like this program, but feel free to give it a shot!
Hope this helps!

Craig's WiFI ADB connector

To all the Android app devs/geeks if you use Android Studio on windows then you need this...
1. Enable (root) adb wifi
This takes it from listening on a usb connection to listening on a tcpip connection port 5555
2. is to click on Start ADB
this then tells windows to connect over the air to your Android
Now run apps like you have a usb cable attached but over wifi instead! (Windows client is stored on your phone, copy it to windows after running the app... it stores adb on the client with it's own copy for extreme portability )
The windows client is stored in the apk, so the entire package includung adb will get you off and running...
https://play.google.com/store/apps/details?id=controller.adb.craigs.craigswifiadb
Do you know if there is any way to get the random port of the adb wi-fi connection from the PC?

[adb,scrcpy,vysor] What ports does Android 12 randomly set when Wi-Fi connecting via Wireless debugging adb "pair" or "connect" commands?

What ports does Android 12 randomly set when connecting wirelessly to adb via either the Wireless debugging "pair" or the "connect" adb PC commands?
Brief history:
While Android has forever been able to initially connect over TCP Port 5555 over USB first, and then the USB cable could have been disconnected to mirror Android over to the PC wirelessly on your LAN...
... As of Android 12, there are fantastic new "Developer options" for "Wireless debugging" which allow us to mirror Android over to any PC (Mac/Windows/Linux) without ever needing a USB cable ever again!
Brief background:
1. The wonderful screen mirroring tools (Vysor, Scrcpy, Sndcpy,etc.) connect using adb
2. We write scripts on the PC to mirror multiple devices onto the PC sans consoles
3. Each Android device has a random port assignment for adb "pair" & "connect" commands
C:\> adb connect 192.168.0.2:[RANDOM-PORT]​C:\> adb pair 192.168.0.2:[RANDOM-PORT] [RANDOM-PIN]​
We need a tool to TEST which random port Android 12 sets Developer options Wireless debugging to.
We have a variety of tools as described in this recent thread today:
(PSA) Using the new Android 12 TILE for 'Developer options' 'Wireless debugging' to establish adb connection over Wi-Fi without USB​
But those port-scanning tools take FOREVER to run on all possible ports.
Hence it behooves us to limit the port scan to just the ports Android 12 uses for Wireless debugging.
C:\> portqry -n 192.168.0.2 -r 30000:40000​C:\> netstat -ano -p tcp | findstr "92.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 92.168.0.2​etc.​
That is the reason I ask this very specific question:
What ports does Android 12 use for Developer options Wireless debugging?
I just came home and connected to scrcpy via adb over port 41703
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 slow as a lazy dog), but at least portqry.exe listed that port as "listening"...
c:\app\network\portqry\portqry -nr 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 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, once you know the IP address & port Android randomly set the new Android 12 Developer options Wireless debugging to, many basic network commands will tell you that port is being used by adb on that IP address, for example...
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
Where once you know the IP address, you can query the port.
C:\> netstat -ano -p tcp | findstr "192.168.0.2"
TCP 192.168.0.2:2392 192.168.0.2:41703 ESTABLISHED 1928
Click to expand...
Click to collapse
But... I knew the port ahead of time by looking on the phone to see what the random port the new Android 12 Developer options Wireless debugging had set the phone to.
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.
BTW a search shows EVERYONE has the same adb wi-fi needs!
ADB Wifi, how to specify port and have it fix
[Q] Is it possible to adb connect via wifi without configuring port on android?
Connect Android phone over Wi-Fi using ADB
adb over wi-fi
[TUT] ADB over WI-FI
How to add WiFi network over ADB without root?
[GUIDE] How to connect adb over wifi
ADB Via WiFi
Adb over wifi
ADB-Over-WiFi
[APP] ADB WiFi
[APP] [4.1+] [OPEN SOURCE] WiFi ADB (Kotlin)
ADB over WiFi missing from developer option
ADB Via WiFi doesn't work.
adb over wifi without root?
[TUTORIAL] ADB over WiFi / TCP
[Q] adb over wifi?? without root
[APP] ADB WiFi
Adb over wifi
how can i enable adb over wifi
ADB over wifi
[Q] ADB only over wIFI no USB
Adb over wifi
[Q] ADB over wifi, no USB to accept RSA key
[Q] Is it possible to adb connect via wifi without configuring port on android?
[PYTHON SCRIPT][WINDOWS]Start scrcpy over Wi-Fi
[APP][8.0.0+][ROOT] Start ADB Over Wi-Fi [Root]
UPDATE:
It's IMPORTANT to be able to know what the random port is from the PC (without needing to touch the Android phone at all).
Making use of a 2012 thread today...
How to make adb listen to tcpip 5555 after reboot​
@AlainCh2 came up with a third option:
1. The first option is to try to keep the random port static
2. The second option is to figure out what it is from the PC alone
However... In that ancient thread, a third option was described...
3. Try to SET the port over Wi-Fi (without USB!) from the PC
Which @AlainCh2 experimented with over here today in post #10.
This is the best I can do (but it's cheating)
a. Non-rooted Android 12 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
Once I already know the random port assignment, 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
View attachment 5677027
While that works perfectly, the problem is that I have to KNOW the port before any of that works.
My setup for scrcpy, 1 device:
1. Connect phone and PC to the same network.
2. Connect the phone to the PC via cable, execute command "scrcpy -d --tcpip" then scrcpy will setup the rest
scrcpy will set the port automatically to 5555 and try to establish a connection. No need to look for ports somewhere.
You may then disconnect the cable from PC. Just make sure you have a static IP for convenience. You don't need to enable wireless debugging for the port or anything. You just need to execute the steps above once every reboot. You may connect multiple devices. When executing the steps above, just make sure only one device is connected via cable at a time. You may then execute "scrcpy -s (ip)" or "scrcpy --tcpip=(ip)" to connect to one of the devices. If only one is connected wirelessly, "scrcpy -e" will do.
wildcatacu said:
My setup for scrcpy, 1 device:
1. Connect phone and PC to the same network.
2. Connect the phone to the PC via cable, execute command "scrcpy -d --tcpip" then scrcpy will setup the rest
scrcpy will set the port automatically to 5555 and try to establish a connection. No need to look for ports somewhere.
You may then disconnect the cable from PC. Just make sure you have a static IP for convenience. You don't need to enable wireless debugging for the port or anything. You just need to execute the steps above once every reboot. You may connect multiple devices. When executing the steps above, just make sure only one device is connected via cable at a time. You may then execute "scrcpy -s (ip)" or "scrcpy --tcpip=(ip)" to connect to one of the devices. If only one is connected wirelessly, "scrcpy -e" will do.
Click to expand...
Click to collapse
Nice, I can say it works
But I have to run scrcpy -d --tcpip only if I reboot tablet (in my case) or also if I restart pc?
If only the PC is restarted, there's no need to reconnect the android device via USB. To reconnect, you just need to run this command replacing the IP address (preferably set to static for convenience): scrcpy --tcpip=(Local IP Address). If you set your device's static IP to 192.168.1.24 for example, run the command: scrcpy --tcpip=192.168.1.24
As long as the Android device doesn't shut down or restart, you may reconnect to it anytime. PC can be shut down or restarted. The initial wired setup is only required on the Android device's first boot.

Categories

Resources