Reputation: 4308
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?
Upvotes: 5
Views: 12664
Reputation: 571
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.
Upvotes: 2
Reputation: 1203
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:
Upvotes: 3
Reputation: 14318
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
Upvotes: 0
Reputation: 401
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
$ adb shell pm uninstall --user 0 com.package.name
if the uninstall failed then maybe the application is device admin or device owner.
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
withoutadb shell
Update:
Let's suppose that the App was never installed on the device.
adb install myapp.apk
The command will succeed and the application will be installed.
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
Upvotes: 1
Reputation: 1002
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
Upvotes: 0