5

I'm having this error:

$ adb push F:\skylixwork\CollagePhoto\app\build\outputs\apk\app-debug.apk
/data/local/tmp/com.collagephoto java.io.IOException: An existing connection was forcibly closed by the remote host
Error while Installing APK

Installation failed with message INSTALL_CANCELED_BY_USER. It is possible that this issue is resolved by uninstalling an existing version of the apk if it is present, and then re-installing.

WARNING: Uninstalling will remove the application data!

Do you want to uninstall the existing application?

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Jaymin Bhadani
  • 868
  • 5
  • 10
  • 25

5 Answers5

21

Works !

  1. enable developer mode - In your phone, go to Settings, About phone and click on MIUI version 7 times. You’ll see a pop up which says you are a developer now.

  2. Go back to Settings, Additional settings, Developer options and enable USB Debugging.

  3. Connect your phone to your PC/Mac and on the phone authorize your computer

  4. go back to Developer options, scroll down to find Turn on MIUI optimization and disable it. Your phone will be rebooted

  5. I solved my issue this way.

Axay Prajapati
  • 791
  • 5
  • 20
11

I found the answer for my question.

solution :- (1)

enable developer mode - In your phone, go to Settings, About phone and click on MIUI version 7 times. You’ll see a pop up which says you are a developer now.

Go back to Settings, Additional settings, Developer options and enable USB Debugging.

Connect your phone to your PC/Mac and on the phone authorize your computer

go back to Developer options, scroll down to find Turn on MIUI optimization and disable it. Your phone will be rebooted

solution :- (2)

enable developer mode - In your phone, go to Settings, About phone and click on MIUI version 7 times. You’ll see a pop up which says you are a developer now.

Go back to Settings, Additional settings, Developer options and enable USB Debugging.

Connect your phone to your PC/Mac and on the phone authorize your computer.

go back to Developer options, scroll down to find Install via USB: and just turn on it.

enter image description here

Jaymin Bhadani
  • 868
  • 5
  • 10
  • 25
2

I'm using xiaomi redmi note 4x and after Turning on install via USB, Turning off MIUI optimization is the main objective from developer option to run app via USB! This works for me

joy oares
  • 155
  • 2
  • 11
1

I will suggest to check update of adb version. Aslo check the your Run Apps on a Hardware Device

For more information refer this solution ADB connection

Try above solutions. hope it will work

Community
  • 1
  • 1
Nitin Karande
  • 1,280
  • 14
  • 33
1

1 adb devices check your device is ok

2 reboot your devices

3 adb install -r F:\skylixwork\CollagePhoto\app\build\outputs\apk\app-debug.apk

jeffery
  • 11
  • 2
  • no its not working for me error:- adb install -r F:\skylixwork\CollagePhoto\app\build\outputs\apk\app-debug.apk [100%] /data/local/tmp/app-debug.apk pkg: /data/local/tmp/app-debug.apk Failure [INSTALL_CANCELED_BY_USER] – Jaymin Bhadani Nov 25 '16 at 07:27