Adb install apk failure - android

my problem is about android and the adb commands. I'm working on a Nexus 5 and i want to install and apk with adb commands. So i start with adb devices, my mobile is detected by the computer so i go to the repertory where the apk is located and i launch adb install name.apk
It returns :
* daemon not running. starting it now on port 5038 *
* daemon started successfully *
error: device not found
- waiting for device -
The Nexus 5 is rooted, and usb debug is activated
adb devices give me some sort of serial number of the mobile

If adb devices gives you a list of devices, then you could try to take serial number of your device and call adb -s <serialNumber> install name.apk. Here is more options you could try.

If you are using Ubuntu try restarting the adb server by giving sudo permission.cd > adb location and do sudo ./adb kill-server and sudo ./adb start-server.

Related

Multiple devices issue in tcpip

I'm using termux in Android
I connect my using tcpip
I can't excute command reason show multiple devices connected
adb devices
List of devices attached
emulator-5554 device
adb allows multiple devices to be connected which will not allow to run the shell
you can try restarting the server using the following command and try again
adb kill-server
adb start-server
it worked for me some one already mentioned about the -s Serial number ( phone / emulator id )
adb -s SERIAL shell
so that will also be a good option to try
you can also try command line to connect with the target using
adb connect xxx.xxx.xxx.xxx:port
you may also try
adb disconnect
and retry
Good luck

linux android emulator not show in adb devices after restart adb server

I using android emulator in linux(Ubuntu16.04), The adb server seems not working normal.
root#ubuntu:~/santi/opengl# adb -P 15770 devices
List of devices attached
emulator-5770 device
root#ubuntu:~/santi/opengl# adb -P 15770 root
root#ubuntu:~/santi/opengl# adb -P 15770 kill-server
root#ubuntu:~/santi/opengl# adb -P 15770 devices
* daemon not running. starting it now on port 15770 *
* daemon started successfully *
List of devices attached
root#ubuntu:~/santi/opengl#
Thus the problem, when I restart adb server, the emulator not in adb devices again! Only if I restart the emulator, it shows again in adb devices.
The ADB version: Android Debug Bridge version 1.0.32
adb devices
adb root
adb kill-server
adb devices
Unbelievable! Above problem was caused by the emulator specified start port. As I start emulator with command:
emulator -avd template -gpu mesa -no-window -port 5680
The above port if > 5680, then device wont show after restart adb server, otherwise port <= 5680 it shows and definitely shows okay!

ADB over wifi/hotspot not working

i follow this guide on my non-rooted phone but not working>> How can I connect to Android with ADB over TCP?
Here is my Output
[stark]:~|$ adb kill-server
[stark]:~|$ adb tcpip 5555
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
[stark]:~|$ adb connect 192.168.43.1:5555
connected to 192.168.43.1:5555
[stark]:~|$ THEN I REMOVE USB^C
[stark]:~|$ adb shell
**error: device not found**
I tried many times but always getting error that device not Found
I have Android N, Current OS: Ubuntu, ADB version: 1.0.31
As you said, you have upgraded the phone from MM to N, therefore to get it working, you have to root it again. You can check whether your phone is rooted or not using any root checker app.
For me the problem started after upgrading android studio. Wifi Adb extension on android studio used to work just fine before upgrading . All the extensions attached below were working fine . I haven't rooted my phone at all. WIFI ADB EXTENSIONS

what is the adb command to put device in offline mode

Is there an adb command to put the device offline?I tried following but doesn't seem to work
COMMAND:-
adb devices offline
You can put a device in "offline" state by using push(or install) and reconnect commands:
1.push a file(or install a apk) to phone
adb -s [serial] push somefile /data/local/tmp
2.reconnect while push is still in progress
adb -s [serial] reconnect
SERIAL means serial number listed in the output of 'adb devices' command.
Repeat step 1 and 2, after a while, you can find this device is in offline state from output of "adb devices".
You can put this device in "device" state by using kill-server and start-server.
"reconnect" command is only supported by higher version of adb, 1.0.36 and later as far as I know.

Changing default port (i.e. 5037) on which adb server runs

I am a budding android developer and if there is no easy way of configuring the adb server to run on another port then the inflexibility of the tools will force me to quit android app development.
A web search did not return any solutions.
I also searched for '5037' in all files in android sdk directory but did not find a setting there.
Use the environment variable ANDROID_ADB_SERVER_PORT to select the port.
The following works 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
In another terminal I ran:
$ ANDROID_ADB_SERVER_PORT=6789 emulator ...
Back to original terminal:
$ ANDROID_ADB_SERVER_PORT=6789 adb devices
List of devices attached
emulator-5554 device
$ adb devices # ANDROID_ADB_SERVER_PORT was exported as 12345
List of devices attached
TA2070M5O6 device
I found this via the Jenkins Android Emulator Plugin as I noticed it was running adb on a different port.
With the latest adb version,
Use option -P (Note: Caps P)to start adb server in a specific port.
For Example, Try
$adb -P 5038 start-server
It will list the devices attached to this specific adb server. If the adb server is not running then it will start a new adb server with the given port number.
Hope it helps someone reading this post.
Thanks.
In Windows, go to Environment Variables – Add a new one called ANDROID_ADB_SERVER_PORT
and set it to whatever you want, I've set to 5038.
Should look like this:
Solved it for me.
There is another variable that supports this for connecting to a different machine's adb:
ADB_SERVER_SOCKET=tcp:some.other.host:1234 adb devices
To use it, you need to start adb on the other host with -a and probably background it too:
( adb -a -P 1234 nodaemon server & ) &

Categories

Resources