scrcpy connect to remote adb server problems - General Questions and Answers

I am using adb version 1.0.32 on an armv7l development board. In an attempt to use scrcpy to connect remotely to the adb I first set:
on the armv7l remote board:
adb kill-server
adb -a nodaemon server start
then from another terminal on the remote board try doing a "adb devices" to make sure it sees the connected android device but what happens is unexpected I get:
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
with no devices showing up. It is lighting off a completely new adb server and ignoring the fact that it is already running.
ps shows
1304 root 30184 S adb -a nodaemon server start
1315 root 20964 S adb -P 5037 fork-server server
If I don't have the first adb running and do "adb devices"
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
001e06481bc3 device
I tried this same scenario on my ubuntu 18.04 box with adb 1.0.32 and had no problem with "adb devices" launching an extra process:
ps only shows
xxx 18322 10891 0 16:49 pts/2 00:00:00 adb -a nodaemon server start
and adb devices shows:
List of devices attached
001e064809ac device
without the extra daemon getting launched.
This is causing scrcpy to not function properly when I am trying:
export ADB_SERVER_SOCKET=tcp:<ip of remote board>:5037
scrcpy --tunnel-host=<ip of remote board>
it returns :
scrcpy 1.23 <https://github.com/Genymobile/scrcpy>
INFO: Tunnel host/port is set, --force-adb-forward automatically enabled.
ERROR: Could not find any ADB device
ERROR: Server connection failed
naturally it couldn't find any devices because "adb devices" is not working properly on the remote board. Incidently I tried the same scenario with just the localhost and it works flawlessly.
The question is why is the same version adb not working on one platform vs another?

Related

Forwarding TCP/UDP? Is UDP possible? (using Android Device Bridge)

(Did I say Device bridge, oops. Android Debug Bridge)
So I'm trying to get some port forwarding happening - had a look at the forward function in the ADB; seems like it wont do UDP ports. Am I getting that right?
It says forward forwards socket connections (but isnt UDP a connectionless protocol?)
adb forward <local> <remote> check it below:
Code:
>adb
Android Debug Bridge version 1.0.25
-d - directs command to the only connected USB device
returns an error if more than one USB device is present.
-e - directs command to the only running emulator.
returns an error if more than one emulator is running.
-s <serial number> - directs command to the USB device or emulator with
the given serial number. Overrides ANDROID_SERIAL
envivornment variable.
-p <product name or path> - simple product name like 'sooner', or
a relative/absolute path to a product
out directory like 'out/target/product/sooner'.
If -p is not specified, the ANDROID_PRODUCT_OUT
environment variable is used, which must
be an absolute path.
devices - list all connected devices
connect <host>:<port> - connect to a device via TCP/IP
disconnect <host>:<port> - disconnect from a TCP/IP device
device commands:
adb push <local> <remote> - copy file/dir to device
adb pull <remote> <local> - copy file/dir from device
adb sync [ <directory> ] - copy host->device only if changed
(see 'adb help all')
adb shell - run remote shell interactively
adb shell <command> - run remote shell command
adb emu <command> - run emulator console command
adb logcat [ <filter-spec> ] - View device log
adb forward <local> <remote> - forward socket connections
forward specs are one of:
tcp:<port>
localabstract:<unix domain socket name>
localreserved:<unix domain socket name>
localfilesystem:<unix domain socket name>
dev:<character device name>
jdwp:<process pid> (remote only)
adb jdwp - list PIDs of processes hosting a JDWP transport
adb install [-l] [-r] <file> - push this package file to the device and install it
('-l' means forward-lock the app)
('-r' means reinstall the app, keeping its data)
adb uninstall [-k] <package> - remove this app package from the device
('-k' means keep the data and cache directories)
adb bugreport - return all information from the device
that should be included in a bug report.
adb help - show this help message
adb version - show version num
DATAOPTS:
(no option) - don't touch the data partition
-w - wipe the data partition
-d - flash the data partition
scripting:
adb wait-for-device - block until device is online
adb start-server - ensure that there is a server running
adb kill-server - kill the server if it is running
adb get-state - prints: offline | bootloader | device
adb get-serialno - prints: <serial-number>
adb status-window - continuously print device status for a specified device
adb remount - remounts the /system partition on the device read-write
adb reboot [bootloader|recovery] - reboots the device, optionally into the bootloader or recovery program
adb root - restarts the adbd daemon with root permissions
adb usb - restarts the adbd daemon listening on USB
adb tcpip <port> - restarts the adbd daemon listening on TCP on the specified port
networking:
adb ppp <tty> [parameters] - Run PPP over USB.
Note: you should not automatically start a PPP connection.
<tty> refers to the tty for PPP stream. Eg. dev:/dev/omap_csmi_tty1
[parameters] - Eg. defaultroute debug dump local notty usepeerdns
adb sync notes: adb sync [ <directory> ]
<localdir> can be interpreted in several ways:
- If <directory> is not specified, both /system and /data partitions will be updated.
- If it is "system" or "data", only the corresponding partition
is updated.
If ADP cant set up port forwarding on the g1, what other ways can I go about it without using ADB?
I have use this on my win machine for testing apps
redir - Vdm-Redirector
redir add udp:<host machine port>:<emulator listen port>
example:
redir add udp:4444:4444
This will then have the emulator "listen" on your local machine's port
4444 for UDP packets, and forward those to the emulator's adapter
on port 4444
found this in the android-developers mailing list before

[How To]ADB&ANDROID

Hi all,
Today i will tell you about ADB.
1. What's ADB?
ADB (Android Debug Bridge) is a versatile COMMAND LINE TOOL that lets you communicate with an emulator instance or connected Android-powered device. It is a client-server program that includes three components:
* A client, which runs on your development machine. You can invoke a client from a shell by issuing an adb command. Other Android tools such as the ADT plugin and DDMS also create adb clients.
*A server, which runs as a background process on your development machine. The server manages communication between the client and the adb daemon running on an emulator or device.
*A daemon, which runs as a background process on each emulator or device instance.
2. How Can i Get it?
For Windows...You can Download the Attachment...For Other OS you Have to Install SDK and After go to <SDK>\platform-tools to get the same file of Windows but now for Linux or Mac!
NOTE: SOMETIMES ADB DON'T WORK TO BE SURE IT WORK INPUT IN CMD adb devices (no caps) ---> If After "List of..." You Get a Code with Device is all Ok.
0123456789ABCDEF device
But if You don't Get the code you have to install HTC SYNC for Android....
And After Retry with "adb devices" and if you get the code you can Use Adb..
In my Opinion you can Put the folder in C:\Android and made a link on Desktop...
3. Command to Use ADB and Their Function:
Android Debug Bridge version 1.0.26
(**MOST USED**)
Code:
adb push <local> <remote> - copy file/dir to device
Code:
adb pull <remote> <local> - copy file/dir from device
Code:
adb sync [ <directory> ] - copy host->device only if changed (see 'adb help all')
Code:
adb shell - run remote shell interactively
Code:
adb shell <command> - run remote shell command
Code:
adb emu <command> - run emulator console command
Code:
adb logcat [ <filter-spec> ] - View device log
Code:
adb install [-l] [-r] <file> - push this package file to the device and install it
('-l' means forward-lock the app)
('-r' means reinstall the app, keeping its data)
Code:
adb uninstall [-k] <package> - remove this app package from the device
('-k' means keep the data and cache directories)
Code:
adb version - show version num
Code:
adb -w - wipe the data partition
Code:
adb -d - flash the data partition
Code:
adb wait-for-device - block until device is online
Code:
adb start-server - ensure that there is a server running
Code:
adb kill-server - kill the server if it is running
Code:
adb get-state - prints: offline | bootloader | device
Code:
adb get-product - prints: <product-id>
Code:
adb get-serialno - prints: <serial-number>
Code:
adb status-window - continuously print device status for a specified device
Code:
adb remount - remounts the /system partition on the device read-write
If You Need Help Ask Here.
I Hope This Thread will Be Usefull...

I can't get adb.exe to run.

Guys I cant run adb.exe (in c/android/android-sdk/platform-tools/adb)
When I clicking it's opening (I see some txts scrolling there) and after 2 sec adb window closed !
I instal java, motorola driver.
So I try another PC, but samething...
I just whant to use simple commands like a:
adb reboot bootloader
fastboot oem unlock
fastboot reboot
.....yes just want to root and unlock bootloader...
People can you tell me what im doing wrong ?
I post a video so you will see also.
http://www.youtube.com/watch?v=fhcKYwcHltA
Thank you for help. (I already know who will help me for sure thank you okantomi)
Best regards !
avetny said:
Guys I cant run adb.exe (in c/android/android-sdk/platform-tools/adb)
When I clicking it's opening (I see some txts scrolling there) and after 2 sec adb window closed !
I instal java, motorola driver.
So I try another PC, but samething...
I just whant to use simple commands like a:
adb reboot bootloader
fastboot oem unlock
fastboot reboot
.....yes just want to root and unlock bootloader...
People can you tell me what im doing wrong ?
I post a video so you will see also.
http://www.youtube.com/watch?v=fhcKYwcHltA
Thank you for help. (I already know who will help me for sure thank you okantomi)
Best regards !
Click to expand...
Click to collapse
Now you got me under your spell, lol.
I'm assuming that you're following this guide: http://forum.xda-developers.com/showthread.php?t=1249798
If so, go back over it, step by step. If you are still having problems, and if noone else jumps in, I'll come back later and try to help. I'm in transit right now.
I know you can do this...just take your time.
you don't use a adb.exe from the windows GUI. Its used in the terminal (cmd). That's why it goes away really fast when you try to click on it.
If you cd to the place where adb is and type in adb.exe you will get that same text window, but it will stay up. You can then read it and see the different commands that are included in adb. Do your research first. Learn how to use adb from any of the HUNDREDS of tutorials here on xda or google
okantomi said:
Now you got me under your spell, lol.
I'm assuming that you're following this guide: http://forum.xda-developers.com/showthread.php?t=1249798
If so, go back over it, step by step. If you are still having problems, and if noone else jumps in, I'll come back later and try to help. I'm in transit right now.
I know you can do this...just take your time.
Click to expand...
Click to collapse
thank you guys !!! thanks a lot I will try.
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\Petros>adb.exe
'adb.exe' is not recognized as an internal or external command,
operable program or batch file.
C:\Users\Petros>C:\android\android-sdk\platform-tools\adb
Android Debug Bridge version 1.0.26
-d - directs command to the only connected USB devic
e
returns an error if more than one USB device is
present.
-e - directs command to the only running emulator.
returns an error if more than one emulator is r
unning.
-s <serial number> - directs command to the USB device or emulator w
ith
the given serial number. Overrides ANDROID_SERI
AL
environment variable.
-p <product name or path> - simple product name like 'sooner', or
a relative/absolute path to a product
out directory like 'out/target/product/sooner'.
If -p is not specified, the ANDROID_PRODUCT_OUT
environment variable is used, which must
be an absolute path.
devices - list all connected devices
connect <host>[:<port>] - connect to a device via TCP/IP
Port 5555 is used by default if no port number
is specified.
disconnect [<host>[:<port>]] - disconnect from a TCP/IP device.
Port 5555 is used by default if no port number
is specified.
Using this ocmmand with no additional arguments
will disconnect from all connected TCP/IP devic
es.
device commands:
adb push <local> <remote> - copy file/dir to device
adb pull <remote> [<local>] - copy file/dir from device
adb sync [ <directory> ] - copy host->device only if changed
(-l means list but don't copy)
(see 'adb help all')
adb shell - run remote shell interactively
adb shell <command> - run remote shell command
adb emu <command> - run emulator console command
adb logcat [ <filter-spec> ] - View device log
adb forward <local> <remote> - forward socket connections
forward specs are one of:
tcp:<port>
localabstract:<unix domain socket name>
localreserved:<unix domain socket name>
localfilesystem:<unix domain socket name>
dev:<character device name>
jdwp:<process pid> (remote only)
adb jdwp - list PIDs of processes hosting a JDWP transport
adb install [-l] [-r] [-s] <file> - push this package file to the device and i
nstall it
('-l' means forward-lock the app)
('-r' means reinstall the app, keeping its data
)
('-s' means install on SD card instead of inter
nal storage)
adb uninstall [-k] <package> - remove this app package from the device
('-k' means keep the data and cache directories
)
adb bugreport - return all information from the device
that should be included in a bug report.
adb help - show this help message
adb version - show version num
DATAOPTS:
(no option) - don't touch the data partition
-w - wipe the data partition
-d - flash the data partition
scripting:
adb wait-for-device - block until device is online
adb start-server - ensure that there is a server running
adb kill-server - kill the server if it is running
adb get-state - prints: offline | bootloader | device
adb get-serialno - prints: <serial-number>
adb status-window - continuously print device status for a specifie
d device
adb remount - remounts the /system partition on the device re
ad-write
adb reboot [bootloader|recovery] - reboots the device, optionally into the boo
tloader or recovery program
adb reboot-bootloader - reboots the device into the bootloader
adb root - restarts the adbd daemon with root permissions
adb usb - restarts the adbd daemon listening on USB
adb tcpip <port> - restarts the adbd daemon listening on TCP on th
e specified port
networking:
adb ppp <tty> [parameters] - Run PPP over USB.
Note: you should not automatically start a PPP connection.
<tty> refers to the tty for PPP stream. Eg. dev:/dev/omap_csmi_tty1
[parameters] - Eg. defaultroute debug dump local notty usepeerdns
adb sync notes: adb sync [ <directory> ]
<localdir> can be interpreted in several ways:
- If <directory> is not specified, both /system and /data partitions will be u
pdated.
- If it is "system" or "data", only the corresponding partition
is updated.
environmental variables:
ADB_TRACE - Print debug information. A comma separated list
of the following values
1 or all, adb, sockets, packets, rwx, usb, sync
, sysdeps, transport, jdwp
ANDROID_SERIAL - The serial number to connect to. -s takes prior
ity over this if given.
ANDROID_LOG_TAGS - When used with the logcat option, only these de
bug tags are printed.
this is what I got
GOT IT !!! GOT IT GUYS
Thank u know im working on it !!! <3
best regards !!
okantomi said:
Now you got me under your spell, lol.
I'm assuming that you're following this guide: http://forum.xda-developers.com/showthread.php?t=1249798
If so, go back over it, step by step. If you are still having problems, and if noone else jumps in, I'll come back later and try to help. I'm in transit right now.
I know you can do this...just take your time.
Click to expand...
Click to collapse
Okantomi you know this command is working:
adb reboot bootloader,
but after when I type: fastboot oem unlock, he telling:
'fastboot' is not recognized an internal or external command, operable program or batch file.
guys I fixed !!!
avetny said:
guys I fixed !!!
Click to expand...
Click to collapse
Fantastic! I knew it!
Thanks to kenfly for his help in getting you on the right track.
okantomi said:
Fantastic! I knew it!
Thanks to kenfly for his help in getting you on the right track.
Click to expand...
Click to collapse
People like you making xda-developers.com much more nicely and friendly.
Thank you my friend.
Best regards!
adb not working
avetny said:
thank you guys !!! thanks a lot I will try.
Click to expand...
Click to collapse
Hi i got my adb.exe working
Just locate ur adb.exe and copy the path.
Example
cd C:\Program Files\Android\android-sdk\platform-tools
Press enter.
Then type adb.exe
Done ur in
Hope this helps

Used roach's new CWM recovery, now can't intall rom

So I used his new recovery and I had my zip files on my sd card... wiped everything and come to find out that it doesn't read external sd card. How can I mount the internal sdcard so I can put something on it?
You can use adb to push your files to either /sdard/ or /data/media (???)
gee one said:
You can use adb to push your files to either /sdard/ or /data/media (???)
Click to expand...
Click to collapse
Mind throwing me a walkthrough for adb? its been since july since I rooted and haven't used any of adb/nvflash stuff
bukithd said:
Mind throwing me a walkthrough for adb? its been since july since I rooted and haven't used any of adb/nvflash stuff
Click to expand...
Click to collapse
Do you have an SBK v1 TF to use NVFlash? (Serial # of your TF?)
This is a good thread to set up ADB
http://forum.xda-developers.com/showthread.php?t=1071584
Just hoping that you can get it working after the fact, is your USB debugging turn ON?
If you type adb, you'll get this:
Code:
Android Debug Bridge version 1.0.25
-d - directs command to the only connected USB device
returns an error if more than one USB device is present.
-e - directs command to the only running emulator.
returns an error if more than one emulator is running.
-s <serial number> - directs command to the USB device or emulator with
the given serial number. Overrides ANDROID_SERIAL
envivornment variable.
-p <product name or path> - simple product name like 'sooner', or
a relative/absolute path to a product
out directory like 'out/target/product/sooner'.
If -p is not specified, the ANDROID_PRODUCT_OUT
environment variable is used, which must
be an absolute path.
devices - list all connected devices
connect <host>:<port> - connect to a device via TCP/IP
disconnect <host>:<port> - disconnect from a TCP/IP device
device commands:
adb push <local> <remote> - copy file/dir to device
adb pull <remote> <local> - copy file/dir from device
adb sync [ <directory> ] - copy host->device only if changed
(see 'adb help all')
adb shell - run remote shell interactively
adb shell <command> - run remote shell command
adb emu <command> - run emulator console command
adb logcat [ <filter-spec> ] - View device log
adb forward <local> <remote> - forward socket connections
forward specs are one of:
tcp:<port>
localabstract:<unix domain socket name>
localreserved:<unix domain socket name>
localfilesystem:<unix domain socket name>
dev:<character device name>
jdwp:<process pid> (remote only)
adb jdwp - list PIDs of processes hosting a JDWP transport
adb install [-l] [-r] <file> - push this package file to the device and install it
('-l' means forward-lock the app)
('-r' means reinstall the app, keeping its data)
adb uninstall [-k] <package> - remove this app package from the device
('-k' means keep the data and cache directories)
adb bugreport - return all information from the device
that should be included in a bug report.
adb help - show this help message
adb version - show version num
DATAOPTS:
(no option) - don't touch the data partition
-w - wipe the data partition
-d - flash the data partition
scripting:
adb wait-for-device - block until device is online
adb start-server - ensure that there is a server running
adb kill-server - kill the server if it is running
adb get-state - prints: offline | bootloader | device
adb get-serialno - prints: <serial-number>
adb status-window - continuously print device status for a specified device
adb remount - remounts the /system partition on the device read-write
adb reboot [bootloader|recovery] - reboots the device, optionally into the bootloader or recovery program
adb root - restarts the adbd daemon with root permissions
adb usb - restarts the adbd daemon listening on USB
adb tcpip <port> - restarts the adbd daemon listening on TCP on the specified port
networking:
adb ppp <tty> [parameters] - Run PPP over USB.
Note: you should not automatically start a PPP connection.
<tty> refers to the tty for PPP stream. Eg. dev:/dev/omap_csmi_tty1
[parameters] - Eg. defaultroute debug dump local notty usepeerdns
adb sync notes: adb sync [ <directory> ]
<localdir> can be interpreted in several ways:
- If <directory> is not specified, both /system and /data partitions will be updated.
- If it is "system" or "data", only the corresponding partition
is updated.
You want to "push" your zip ie "adb push /your/rom.zip /sdcard/" or maybe the last argument is /data/media - I flash from the external sdcard, so take this for what it's worth. Good luck.
baseballfanz said:
Do you have an SBK v1 TF to use NVFlash? (Serial # of your TF?)
This is a good thread to set up ADB
http://forum.xda-developers.com/showthread.php?t=1071584
Just hoping that you can get it working after the fact, is your USB debugging turn ON?
Click to expand...
Click to collapse
I have an older tf B50 I'm pretty sure but I'll just do this through adb and be done with it. I need to learn something new anyways...
bukithd said:
I have an older tf B50 I'm pretty sure but I'll just do this through adb and be done with it. I need to learn something new anyways...
Click to expand...
Click to collapse
That's good you have a B50, it's NVFlash compatible.
Do what gee one posted and see if you can push the ROM file to internal.
bukithd said:
I have an older tf B50 I'm pretty sure but I'll just do this through adb and be done with it. I need to learn something new anyways...
Click to expand...
Click to collapse
screw it, I'm nvflashing prime so I don't have t deal with this all night

How to install .APK using Terminal Emulator

I wanna know how to install .APK files using Terminal Emulator.
I tried using this command:
Code:
$ su
# adb start-server
* daemon not running. starting it now on port 5038 *
* daemon started successfully *
# adb connect localhost:5038
connected to localhost:5038
# adb install /sdcard/apk.apk
error: device not found
- waiting for device -
Is this possible?

Categories

Resources