14

My Environment:

OS: Ubuntu 14.04.3 LTS(Linux)
Android Phone: Sony Xperia(E2003) android version 4.4.4
IDE: Android Studio


Debugging on Sony phones used to work for me, it suddenly is not working now. When running in debug mode the execution does not stop at break points.. Without any change debugging works Samsung phones.

Debugging mode is enabled and I can see the device from adb devices command.

adb devies command output:
enter image description here

Usb debugging connection status:
enter image description here

The problem is weird I have many Sony Phones and all of them are not working now, so I guessed the problem is with my system but my team mates are also facing same problem.

Logcat is working, I see logs from user interaction.

The Debugger tab shows this message and hangs forever:

Connecting to the target VM, address: 'localhost:8601', transport: 'socket'

Update:
I have checked the answer here but my devices do not have sdcards so not working for me.

I tried to connect to the target VM manually by clicking the ff icon but the debugger gets disconnected immediately.

enter image description here

Following the steps here I cant change usb connection mode. The selected option is missing on my phone. enter image description here

Community
  • 1
  • 1
dsharew
  • 10,377
  • 6
  • 49
  • 75

1 Answers1

4

I have similar problems under Ubuntu with several devices. Usually, I just change the USB connection mode from MTP (Media Transfer Mode) to PTP (Camera Mode) to solve these kind of issues. I also suggest to change the USB cable, just to exclude extra variables.

bonnyz
  • 13,458
  • 5
  • 46
  • 70
  • sorry how do you change from MTP to PTP, I cant get the option. – dsharew Nov 06 '15 at 09:26
  • @DegenSharew which options do you have when you tap on the usb connection notification? – bonnyz Nov 06 '15 at 09:29
  • No option, but on samsung and techno phones touching the notification takes me to different screen for choosing d/t options – dsharew Nov 06 '15 at 09:31
  • 1
    @DegenSharew try to reach the USB options from the Settings (not from the notification) – bonnyz Nov 06 '15 at 09:32
  • I went to `XperiaConnectivity -> Usb connectivity` But still I dont see any option there. – dsharew Nov 06 '15 at 09:43
  • @DegenSharew As desribed here: http://support.bell.ca/Mobility/Smartphones_and_mobile_internet/Sony-Xperia-Z1.how_to_change_the_usb_connection_options_on_my you should have some options.. I don't own this phone, I can't make a check.. – bonnyz Nov 06 '15 at 09:48
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/94413/discussion-between-degen-sharew-and-bonnyz). – dsharew Nov 06 '15 at 09:56
  • Following the steps I cant perform step 5, the option is missing. I updated my question to check the pic. – dsharew Nov 06 '15 at 09:57
  • @DegenSharew Do you have an sdcard plugged on the phone? If not, try to add one and the option should appears – bonnyz Nov 06 '15 at 10:03
  • @dsharew were you able to figure this out? How to change to PTP ? – abdul Nov 09 '17 at 11:26