Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
2
Question by KupoMog · Aug 10, 2016 at 07:54 PM · android buildandroid sdkadb

adb install: connection reset by peer

I'm attempting to build an Android project and test it on my device. Usually, when I try to push the build to my device either through the Unity Build Settings menu (Build and Run option) or manually through the adb install command, I receive an error and the build fails:

 adb: error: failed to copy 'C:\Users\Path\To\Project\Temp\StagingArea\Package.apk' to '/data/local/tmp/Package.apk': no response: Connection reset by peer

I also see an stdout print in the log that shows the progress ticking upward. When the connection is reset and fails to build, the final percentage is anywhere between 0% - 99%. Here is a sample:

 stdout[
 [  0%] /data/local/tmp/Package.apk
 [  0%] /data/local/tmp/Package.apk
 [  0%] /data/local/tmp/Package.apk
 [  0%] /data/local/tmp/Package.apk
 [  1%] /data/local/tmp/Package.apk
 [  1%] /data/local/tmp/Package.apk
 [  1%] /data/local/tmp/Package.apk
 [  1%] /data/local/tmp/Package.apk
 [  2%] /data/local/tmp/Package.apk
 [  2%] /data/local/tmp/Package.apk
 ...
 [ 41%] /data/local/tmp/Package.apk

However, by disconnecting my device from my PC or rebuilding, I can sometimes (as in, very rarely) successfully push to the device.

Has anyone else encountered this "Connection reset by peer" issue when attempting to install via adb? The error message prompts me to check my Android SDK installation, though the build process will sometimes succeed. Here is the full error message, with the stdout portion truncated:

 Error building Player: CommandInvokationFailure: Unable to install APK to device. Please make sure the Android SDK is installed and is properly configured in the Editor. See the Console for more details. 
 C:/Android\platform-tools\adb.exe -s "64d32755" install -r "C:\Users\Path\To\Project\Temp\StagingArea\Package.apk"
 
 stderr[
 
 ]
 stdout[
 [  0%] /data/local/tmp/Package.apk
 [  0%] /data/local/tmp/Package.apk
 [  0%] /data/local/tmp/Package.apk
 [  0%] /data/local/tmp/Package.apk
 [  0%] /data/local/tmp/Package.apk
 [  0%] /data/local/tmp/Package.apk
 [  0%] /data/local/tmp/Package.apk
 [  0%] /data/local/tmp/Package.apk
 [  1%] /data/local/tmp/Package.apk
 [  1%] /data/local/tmp/Package.apk
 [  1%] /data/local/tmp/Package.apk
 [  1%] /data/local/tmp/Package.apk
 [  1%] /data/local/tmp/Package.apk
 [  1%] /data/local/tmp/Package.apk
 [  1%] /data/local/tmp/Package.apk
 [  1%] /data/local/tmp/Package.apk
 [  1%] /data/local/tmp/Package.apk
 [  2%] /data/local/tmp/Package.apk
 [  2%] /data/local/tmp/Package.apk
 ...
 [ 41%] /data/local/tmp/Package.apk
 adb: error: failed to copy 'C:\Users\Path\To\Project\Temp\StagingArea\Package.apk' to '/data/local/tmp/Package.apk': no response: Connection reset by peer
 ]
Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Habitablaba · Sep 04, 2016 at 07:06 AM 0
Share

I'm seeing this too. This started recently for me. Today, for example, I was able to push two builds to my device intermittently throughout the day. But for the most part, I was unable to push anything to my device due to this error.

I've updated my sdk, uninstalled and reinstalled my phone drivers on my computer, restarted the phone, restarted the computer, changed usb ports... pretty much all the things the internet says should be the definitive solution. Nothing works.

avatar image DotHyphon · Dec 14, 2016 at 05:05 PM 1
Share

I'm getting the exact same error for the first time today. Usually I have no issue but both doing it through Unity or the adb install command give me this error. I recently updated to unity 5.5 but besides that I haven't changed anything.

3 Replies

· Add your reply
  • Sort: 
avatar image
2

Answer by AVOlight · Nov 28, 2016 at 04:28 AM

switching to a raw USB port worked for me

I have a USB hub and switching ports on the hub didn't work but when I switched to a raw USB port on my PC it worked again

got the USB hub to work again by disconnecting its Power and USB cables for a few seconds

so if you don't have a USB hub i guess you could try a full power off, meaning after shut down removing all power sources for at least 30 secs

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image mgibney1992 · Sep 19, 2017 at 03:15 PM 0
Share

$$anonymous$$an, you saved me a lot of hassle. I had it in a USB hub, first time I tried after reading your post it worked. Thank you

avatar image
1

Answer by Liinnkk · May 20, 2017 at 08:48 AM

My smartphone is very unstable when it comes to USB connections, so even when I'm moving files from my computer to it, the connection often resets. It's annoying and , but the only way I found to get around this problem when building my game or profiling is to connect to my smartphone through wi-fi. You can do it easily this way:

  1. Open cmd

  2. Go to your Android SDK folder (if in Windows, type "cd C:\Users\YourUser\AppData\Local\Android\sdk\platform-tools").

  3. Type "adb tcpip 5555" (This command is pretty tricky if the next isn't working).

  4. Get your Smartphone's IP and type "adb connect ip" (eg. adb connect 192.168.0.12, note your smartphone MUST be on the same local network).

  5. If it works, a message will be shown telling you are "connected to ip" and the ip:5555 will be listed when you type "adb devices". Then, disconnect your smartphone from USB and Unity will attach to your smartphone through wifi.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image isaac_weisberg · Jun 05, 2017 at 01:38 AM 0
Share

Yeah, basically, this solution is the best not only for cases when plain usb debugging drops, but in general, ins$$anonymous$$d of using cables.

avatar image
0

Answer by xue_huashan · Apr 05, 2017 at 07:51 AM

Update Android SDK work for me

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

10 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Build Project to Android Error: Unable to start ADB server. 11 Answers

Export to android: CommandInvokationFailure: Failed to build apk. 1 Answer

Cannot install apk in android 8.0.0 (API level 26) 0 Answers

Can't install openJDK 1 Answer

When I change the target API from 29 to 30 in Unity 2019.41f1 and check it on the actual device, it crashes right after it starts. 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges