Search code examples
androidandroid-studioadb

How to debug an app on Pixel 2


I am attempting to connect Android Studio to my Pixel 2 android phone.

Android Studio version :-

Android Studio 3.0.1
Build #AI-171.4443003, built on November 9, 2017
JRE: 1.8.0_152-release-915-b08 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Mac OS X 10.11.6

My Pixel 2 has Android 8.1.0 Build Number OPM1.171019.011

When I connect this device to Android Studio I get the following Event Log output:-

21/12/2017
07:54   Adb connection Error:EOF
07:54   Connection attempts: 1
07:54   Connection attempts: 2
07:54   Connection attempts: 3
07:54   Connection attempts: 4
07:55   Connection attempts: 5
07:55   Connection attempts: 6
07:55   Connection attempts: 7
07:55   Connection attempts: 8
07:55   Connection attempts: 9
07:55   Connection attempts: 10
07:55   Connection attempts: 11
07:55   * daemon not running; starting now at tcp:5037
07:55   ADB server didn't ACK
07:55   Full server startup log: /var/folders/jt/0vbjn9c967jbxl0d9p_x6z78783df6/T//adb.243381702.log
07:55   Server had pid: 1737
07:55   --- adb starting (pid 1737) ---
07:55   adb I 12-21 07:55:07  1737 83688 main.cpp:57] Android Debug Bridge version 1.0.39
07:55   adb I 12-21 07:55:07  1737 83688 main.cpp:57] Version 27.0.0-4455170
07:55   adb I 12-21 07:55:07  1737 83688 main.cpp:57] Installed as /Users/proutylf/Library/Android/sdk/platform-tools/adb
07:55   adb I 12-21 07:55:07  1737 83688 main.cpp:57] 
07:55   adb I 12-21 07:55:07  1737 83688 adb_auth_host.cpp:416] adb_auth_init...
07:55   adb I 12-21 07:55:07  1737 83688 adb_auth_host.cpp:174] read_key_file '/Users/proutylf/.android/adbkey'...
07:55   adb F 12-21 07:55:07  1737 83701 transport_usb.cpp:37] Check failed: usb_packet_size < 4096ULL (usb_packet_size=5120, 4096ULL=4096) 
07:55   * failed to start daemon
07:55   error: cannot connect to daemon
07:55   '/Users/proutylf/Library/Android/sdk/platform-tools/adb start-server' failed -- run manually if necessary
07:55   adb restart attempts: 1
07:55   Connection attempts: 12
07:55   * daemon not running; starting now at tcp:5037
07:55   ADB server didn't ACK
07:55   Full server startup log: /var/folders/jt/0vbjn9c967jbxl0d9p_x6z78783df6/T//adb.243381702.log
07:55   Server had pid: 1739

The log file contents are as follows:-

--- adb starting (pid 1727) ---
adb I 12-21 07:54:19  1727 81771 main.cpp:57] Android Debug Bridge version 1.0.39
adb I 12-21 07:54:19  1727 81771 main.cpp:57] Version 27.0.0-4455170
adb I 12-21 07:54:19  1727 81771 main.cpp:57] Installed as /Users/proutylf/Library/Android/sdk/platform-tools/adb
adb I 12-21 07:54:19  1727 81771 main.cpp:57] 
adb I 12-21 07:54:19  1727 81771 adb_auth_host.cpp:416] adb_auth_init...
adb I 12-21 07:54:19  1727 81771 adb_auth_host.cpp:174] read_key_file '/Users/proutylf/.android/adbkey'...
adb F 12-21 07:54:56  1727 83260 transport_usb.cpp:37] Check failed: usb_packet_size < 4096ULL (usb_packet_size=5120, 4096ULL=4096) 
--- adb starting (pid 1737) ---
adb I 12-21 07:55:07  1737 83688 main.cpp:57] Android Debug Bridge version 1.0.39
adb I 12-21 07:55:07  1737 83688 main.cpp:57] Version 27.0.0-4455170
adb I 12-21 07:55:07  1737 83688 main.cpp:57] Installed as /Users/proutylf/Library/Android/sdk/platform-tools/adb
adb I 12-21 07:55:07  1737 83688 main.cpp:57] 
adb I 12-21 07:55:07  1737 83688 adb_auth_host.cpp:416] adb_auth_init...
adb I 12-21 07:55:07  1737 83688 adb_auth_host.cpp:174] read_key_file '/Users/proutylf/.android/adbkey'...
adb F 12-21 07:55:07  1737 83701 transport_usb.cpp:37] Check failed: usb_packet_size < 4096ULL (usb_packet_size=5120, 4096ULL=4096) 
--- adb starting (pid 1739) ---
adb I 12-21 07:55:08  1739 83918 main.cpp:57] Android Debug Bridge version 1.0.39
adb I 12-21 07:55:08  1739 83918 main.cpp:57] Version 27.0.0-4455170
adb I 12-21 07:55:08  1739 83918 main.cpp:57] Installed as /Users/proutylf/Library/Android/sdk/platform-tools/adb
adb I 12-21 07:55:08  1739 83918 main.cpp:57] 
adb I 12-21 07:55:08  1739 83918 adb_auth_host.cpp:416] adb_auth_init...
adb I 12-21 07:55:08  1739 83918 adb_auth_host.cpp:174] read_key_file '/Users/proutylf/.android/adbkey'...
adb F 12-21 07:55:08  1739 83951 transport_usb.cpp:37] Check failed: usb_packet_size < 4096ULL (usb_packet_size=5120, 4096ULL=4096) 

I have buildToolsVersion '27.0.2' installed.

All my other Android devices connect ok to Android Studio including my Pixel XL which has identical Android version and build number as my Pixel 2.

How can I resolve this adb connection issue?

If it is of any help, my adb version is reporting as

Android Debug Bridge version 1.0.39
Version 27.0.0-4455170
Installed as /Users/proutylf/Library/Android/sdk/platform-tools/adb

Solution

  • What platform tools version are you on? I had the exact same error on my pixel 2. I had platform tools version 27.0.0. I downloaded a previous version and that worked for me. I found the answer here: Android Studio - ADB start server fails, adbkey check fails