I am using Android Studio 2.2.3. Everything is up to date.
Running "adb shell" on Terminal in Android Studio generates the following:
adb server is out of date. killing...
* daemon started successfully *
error: device not found
To reconnect the device, I have to run "adb kill-server" first.
This makes running shell commands impossible.
Could anyone offer a tip on how to fix this?
From Android Studio Terminal run
$ $ANDROID_HOME/platform-tools/adb shell
this ensures you will be using the same adb.
Related
Some time ago I had trouble with my Huawei P30 and ADB/Android Studio installing APKs. It turned out I was using outdated versions of the libraries/tools. Got it resolved and happily moved on.
Now that my phone has upgraded to Android 10, I'm facing an issue very similar to the one before, but I cannot seem to fix it the same way (by updating libraries). I've tried installing multiple version of each tool, doing a clean install of Android Studio and the Android related tools, but nothing seems to help.
Android Studio
The current behavior is that Android Studio generates the APK only to later get indefinitely stuck at the "installing" step. On some small percentage of tests it fails.
ADB
I've also tried installing the APK from the command line using adb, but I get mixed results.
$ adb version
Android Debug Bridge version 1.0.41
Version 30.0.4-6686687
While Android Studio is running, installing the app either ends up failing, or hanging indefinitely just like in Android Studio:
$ cd .../platform-tools
$ adb start-server
* daemon not running; starting now at tcp:5037
* daemon started successfully
$ adb install C:\...\example.apk
Performing Streamed Install
adb: failed to install C:\...\example.apk
$ adb install C:\...\example.apk
Performing Streamed Install
^^^ Hangs there forever
Now, here is where things get interesting, if I close Android Studio, installing the APK results in successful installations about 50% of the time (the other half it fails and restarts the phone connection):
$ cd .../platform-tools
$ adb kill-server
$ adb start-server
* daemon not running; starting now at tcp:5037
* daemon started successfully
$ adb install C:\...\example.apk
Performing Streamed Install
adb: failed to install C:\...\example.apk
$ adb kill-server
$ adb start-server
* daemon not running; starting now at tcp:5037
* daemon started successfully
$ adb install C:\...\example.apk
Performing Streamed Install
Success
$ adb kill-server
$ adb install C:\...\example.apk
* daemon not running; starting now at tcp:5037
* daemon started successfully
Performing Streamed Install
Success
$ adb kill-server
$ adb install C:\...\example.apk
* daemon not running; starting now at tcp:5037
* daemon started successfully
Perform
adb: failed to install C:\...\example.apk
I have no trouble performing other actions, like pushing files into the phone or uninstalling apps. So far the issue is only related to installing APKs:
$ adb shell pm uninstall com.example
Success
$ adb push C:\...\app-debug.apk /sdcard/APKs
C:\Dropbox...\app-debug.apk: 1 file pushed, 0 skipped. 15.2 MB/s (31131771 bytes in 1.956s)
Why is it that installing an app fails or succeeds as if flipping a coin? Could this be a driver issue? How could Android Studio be interfering with the success rate of running the adb tool separately?
Try to install your application with ./gradlew installDebug . It will probably give the reason of the failure
You can also make use of Android's Studio UI:
For me it would get stuck at: Performing Streamed Install forever.
What fixed it was the old-age answer: unplugging and replugging my USB cable into my phone and then trying again.
You can start by uninstalling the package if it exist on the device:
Check if the package name of your App exist
$ adb shell dumpsys package com.package.name
if it exist:
$ adb shell pm uninstall --user 0 com.package.name
if the uninstall failed then maybe the application is device admin or device owner.
if it does not exist:
Try changing the install flag of Android studio:
Run > Edit configurations > Install Flags
pm install --user 0
Note: the command is pm install --user 0 without adb shell
Update:
Let's suppose that the App was never installed on the device.
First install
adb install myapp.apk
The command will succeed and the application will be installed.
Second install
adb install myapp.apk
The command will fail as you already installed a package com.package.name
For the second time you install, you should uninstall first:
adb uninstall com.package.name
adb install myapp.apk
or force to reinstall:
adb install -r myapp.apk
Try disabled USB debugging mode and enabling it again on your phone. Sometimes it gets bugged and acts as if its disabled, when its set as enabled
try update adb to latest version
can fix: adb install xxx.apk stuck at Performing Streamed Install`
More detail can refer: android - Error: ADB exited with exit code 1 Performing Streamed Install - Stack Overflow
After reading many threads (1, 2, 3) and trying many solutions in SO regarding similar error, I still am unable to find a solution for this error.
$ adb devices
List of devices attached
adb server is out of date. killing...
cannot bind 'tcp:5037': Address already in use
ADB server didn't ACK
* failed to start daemon *
error:
error:
I have Genymotion 2.7.2, have provided explicit sdk path under Genymotion -> adb -> Android SDK, using adb version 1.0.32.
open task manager and find adb.exe and kill it, then restart your eclipse and
type adb kill-server in your cmd (if you are using windows)
for other OS type killall adb
It used to work fine, but today after I connected my Android phone to my machine, and run adb devices, I got the following error:
* daemon not running. starting it now on port 5037 *
cannot bind 'tcp:5037': Address already in use
ADB server didn't ACK
* failed to start daemon *
error: cannot connect to daemon: Operation timed out
How to solve this problem? (I am using a MacBook)
Try with following commands
Find port details by List Open Files lsof command.
sudo lsof -i :5037 and find PID and kill it.
kill -9 <pid here>
Example: kill -9 4363
Then start adb server. adb devices command.
Kill the Adb server and restart.
adb kill-server
adb start-server
I managed to solve this problem on MacBook by first running the following command to list the process which is using port 5037
lsof -n -i4TCP:5037 | grep LISTEN
Then, I kill it:
kill -9 <PID>
Then, adb devices works!
Android Studio Terminal
$ adb devices
List of devices attached
adb server is out of date. killing...
cannot bind 'tcp:5037': Address already in use
ADB server didn't ACK
* failed to start daemon *
error:
error:
OS Terminal
$ adb devices
List of devices attached
adb server is out of date. killing...
* daemon started successfully *
Finally test again at the IDE terminal
$ adb devices
List of devices attached
GL
it is clear that Address already in use. busybox netstat -antp to check who is using the port.
I've fixed the problem by updating the Android SDK.
android update sdk --no-ui
Additionally, I've updated the Platform Tools to the newest version.
If this doesn't work, redownload android sdk.
wget http://dl.google.com/android/android-sdk_r24.2-linux.tgz
tar -xvf android-sdk_r24.2-linux.tgz cd android-sdk-linux/tools
install all sdk packages
./android update sdk --no-ui
I tried it at the OS Terminal, worked.
Try on the OS terminal first
Running the following command at the OS bash helped solve the issue:
sudo adb start-server
I ran adb kill command and then it started working fine
adb kill-server
adb start-server
I'm using the emulator by command-line for our continuous integration server for our android application. With that approach we can test all Android Versions automatically. For the automatic installation and testing we are using the property "dev.bootcomplete", which is provided by the android emulator. Unfortunately we don't get it always. After a newly created emulator we are retrieving it, but when the emulator is several times used it do'nt throw it again...
Has Anybody an idea?
Commands/ results:
[user#mob_ci ~]$ adb shell getprop dev.bootcomplete
error: device offline
[user#mob_ci ~]$ adb shell getprop dev.bootcomplete
1
I use hudson as a ci server, for hudson there is a android plugin which manages the emulator, it even creates the emulator for you if you want.
I would either check if "error: device offline" happens and then run
adb kill-server
adb start-server
or
shutdown the emulator after each build, as it's not necessary that the emulator runs all the time or do the tests run all the time ?
hope this helps :)
hi i am a new app developer, when i was trying to run my app the following occured...
[2011-02-24 09:33:35 - FirstImage] Android Launch!
[2011-02-24 09:33:35 - FirstImage] The connection to adb is down, and a severe error has occured.
[2011-02-24 09:33:35 - FirstImage] You must restart adb and Eclipse.
[2011-02-24 09:33:35 - FirstImage] Please ensure that adb is correctly located at 'C:\android-sdk-windows\tools\adb.exe' and can be executed.
The adb is located in "C:\android-sdk-windows\tools\"
i tried "adb start-server" in run command but no use, is there any way to solve the issue.
Try killing the Android Debug Bridge (adb) by just running the command adb kill-server and then adb start-server on your command prompt.
Also ensure that if you have updated your SDK then path of adb may be android-sdk-windows\platform-tools in your new sdk. So just try copying that file in the android-sdk-windows\tools directory.