android-file-transfer-linux icon indicating copy to clipboard operation
android-file-transfer-linux copied to clipboard

Does not detect Samsung S6 under OS X 10.10.5

Open ribtoks opened this issue 7 years ago • 15 comments

Steps to repro:

  • download&install your app
  • connect phone over USB (with USB debugging on, usb configuration set to MTP)
  • open your app

it says "No MTP devices found"

ribtoks avatar Jul 08 '17 07:07 ribtoks

Could you please provide aft-mtp-cli -v output?

whoozle avatar Jul 08 '17 23:07 whoozle

@whoozle Thanks for fast response. Both with and without phone connected, this tool produces the following output:

Device::Find(*_interface)->USBInterfaceOpen(_interface): error 0xe00002c5
Device::Find(*_interface)->USBInterfaceOpen(_interface): error 0xe00002c5
Device::Find(*_interface)->USBInterfaceOpen(_interface): error 0xe00002c5
no mtp device found

ribtoks avatar Jul 09 '17 09:07 ribtoks

0xe00002c5 is kIOReturnExclusiveAccess, do you have any other mtp application installed? What version of MacOSX do you have? Are you able to build macOSX build yourself?

whoozle avatar Jul 09 '17 11:07 whoozle

I have had an ordinary Android File Transfer app installed, but I uninstalled it prior to trying your tool. No, I haven't tried to build macOS build myself yet. OS X version is 10.10.5, as specified in the issue title.

ribtoks avatar Jul 09 '17 15:07 ribtoks

thanks to @d1vanov, we have daily builds for MacOSX now! Could you please try the latest master and see if it's still an issue. Then, I'll add more debug in verbose mode. In fact, having few devices opened is fine, it can be other devices, not necessarily mtp ones.

There's lsusb equivalent for MacOSX,

ioreg -p IOUSB -l -w 0

Could you please send here its output, removing anything but your phone (or whole output if your don't mind)

whoozle avatar Jan 19 '18 21:01 whoozle

added more debug in 23a9812294107f424677bacdda99d8e8383735b8

whoozle avatar Jan 19 '18 22:01 whoozle

I'm having the same problem, with a Google Pixel. As with the official Android File Transfer, there's a small chance that it will work if I've just rebooted my MacBook, but otherwise it fails.

On current nightly:

$ aft-mtp-cli --version
continuous-1-g169b0d5

No MTP device found:

$ aft-mtp-cli -v
probing device 05ac:8007
probing device 05ac:8290
Device usb interface: 0:0, index: 0, enpoints: 1
languages[4]:
00000000: 04 03 09 04                                     ....

descriptor[255]:
00000000: 09 02 14 01 06 01 00 e0 00 09 04 00 00 01 03 01 ................
00000010: 01 00 09 21 11 01 00 01 22 38 00 07 05 85 03 08 ...!...."8......
00000020: 00 0a 09 04 01 00 01 03 01 02 00 09 21 11 01 00 ............!...
00000030: 01 22 34 00 07 05 86 03 08 00 0a 08 0b 02 04 ff ."4.............
00000040: 01 01 00 09 04 02 00 03 ff 01 01 00 07 05 81 03 ................
00000050: 10 00 01 07 05 82 02 40 00 01 07 05 02 02 40 00 .......@......@.
00000060: 01 09 04 03 00 02 e0 01 01 00 07 05 83 01 00 00 ................
00000070: 01 07 05 03 01 00 00 01 09 04 03 01 02 e0 01 01 ................
00000080: 00 07 05 83 01 09 00 01 07 05 03 01 09 00 01 09 ................
00000090: 04 03 02 02 e0 01 01 00 07 05 83 01 11 00 01 07 ................
000000a0: 05 03 01 11 00 01 09 04 03 03 02 e0 01 01 00 07 ................
000000b0: 05 83 01 19 00 01 07 05 03 01 19 00 01 09 04 03 ................
000000c0: 04 02 e0 01 01 00 07 05 83 01 21 00 01 07 05 03 ..........!.....
000000d0: 01 21 00 01 09 04 03 05 02 e0 01 01 00 07 05 83 .!..............
000000e0: 01 31 00 01 07 05 03 01 31 00 01 09 04 04 00 02 .1......1.......
000000f0: ff ff ff 00 07 05 84 02 20 00 01 07 05 04 02    ........ ......

interface name[4]:
00000000: 04 03 09 04                                     ....

Device usb interface: 0:1, index: 1, enpoints: 1
languages[4]:
00000000: 04 03 09 04                                     ....

descriptor[255]:
00000000: 09 02 14 01 06 01 00 e0 00 09 04 00 00 01 03 01 ................
00000010: 01 00 09 21 11 01 00 01 22 38 00 07 05 85 03 08 ...!...."8......
00000020: 00 0a 09 04 01 00 01 03 01 02 00 09 21 11 01 00 ............!...
00000030: 01 22 34 00 07 05 86 03 08 00 0a 08 0b 02 04 ff ."4.............
00000040: 01 01 00 09 04 02 00 03 ff 01 01 00 07 05 81 03 ................
00000050: 10 00 01 07 05 82 02 40 00 01 07 05 02 02 40 00 .......@......@.
00000060: 01 09 04 03 00 02 e0 01 01 00 07 05 83 01 00 00 ................
00000070: 01 07 05 03 01 00 00 01 09 04 03 01 02 e0 01 01 ................
00000080: 00 07 05 83 01 09 00 01 07 05 03 01 09 00 01 09 ................
00000090: 04 03 02 02 e0 01 01 00 07 05 83 01 11 00 01 07 ................
000000a0: 05 03 01 11 00 01 09 04 03 03 02 e0 01 01 00 07 ................
000000b0: 05 83 01 19 00 01 07 05 03 01 19 00 01 09 04 03 ................
000000c0: 04 02 e0 01 01 00 07 05 83 01 21 00 01 07 05 03 ..........!.....
000000d0: 01 21 00 01 09 04 03 05 02 e0 01 01 00 07 05 83 .!..............
000000e0: 01 31 00 01 07 05 03 01 31 00 01 09 04 04 00 02 .1......1.......
000000f0: ff ff ff 00 07 05 84 02 20 00 01 07 05 04 02    ........ ......

interface name[4]:
00000000: 04 03 09 04                                     ....

Device::Find failed:(*_interface)->USBInterfaceOpen(_interface): error 0xe00002c5
probing device 18d1:4ee1
Device::Find failed:(*_interface)->USBInterfaceOpen(_interface): error 0xe00002c5
no mtp device found

But Pixel is definitely connected:

$ ioreg -p IOUSB -l -w 0
+-o Root  <class IORegistryEntry, id 0x100000100, retain 15>
  | {
  |   […omitted…]
  | }
  | 
  +-o AppleUSBXHCI Root Hub Simulation@14000000  <class AppleUSBRootHubDevice, id 0x100000346, registered, matched, active, busy 0 (7 ms), retain 13>
    | {
    |   […omitted…]
    | }
    | 
    +-o Bluetooth USB Host Controller@14300000  <class AppleUSBDevice, id 0x10000040f, registered, matched, active, busy 0 (16 ms), retain 26>
    |   {
    |   […omitted…]
    |   }
    |   
    +-o Pixel@14100000  <class AppleUSBDevice, id 0x100000bd9, registered, matched, active, busy 0 (13 ms), retain 17>
        {
          "sessionID" = 7312509225833
          "iManufacturer" = 1
          "bNumConfigurations" = 1
          "idProduct" = 20193
          "bcdDevice" = 792
          "Bus Power Available" = 250
          "USB Address" = 16
          "bMaxPacketSize0" = 64
          "iProduct" = 2
          "iSerialNumber" = 3
          "bDeviceClass" = 0
          "Built-In" = No
          "locationID" = 336592896
          "bDeviceSubClass" = 0
          "bcdUSB" = 512
          "USB Product Name" = "Pixel"
          "PortNum" = 1
          "non-removable" = "no"
          "IOCFPlugInTypes" = {"9dc7b780-9ec0-11d4-a54f-000a27052861"="IOUSBFamily.kext/Contents/PlugIns/IOUSBLib.bundle"}
          "bDeviceProtocol" = 0
          "IOUserClientClass" = "IOUSBDeviceUserClientV2"
          "IOPowerManagement" = {"DevicePowerState"=0,"CurrentPowerState"=4,"CapabilityFlags"=32768,"MaxPowerState"=4,"DriverPowerState"=4}
          "kUSBCurrentConfiguration" = 1
          "Device Speed" = 2
          "USB Vendor Name" = "Google"
          "idVendor" = 6353
          "IOGeneralInterest" = "IOCommand is not serializable"
          "USB Serial Number" = "FA6BT0302860"
          "IOClassNameOverride" = "IOUSBDevice"
        }

I assume the root cause of the problem is the same as whatever causes (the official) Android File Transfer to be basically useless on macOS, but though Googling turns up a lot of complaints about how useless AFT is, no one seems to have been able to work out why.

cpcallen avatar May 15 '19 12:05 cpcallen

Additional info: using System Monitor, I quit the USBAgent process started by launchd, and after that aft-mtp-cli and aft-mtp-mount worked properly.

USBAgent didn't restart until I unplugged the phone. After plugging it back in things continued to work fine even though USBAgent was still running.

Edited to add: but unfortunately, on a subsequent occasion, quitting USBAgent was not sufficient to fix the problem. This is very frustrating: I don't want to have to reboot my computer to connect to my phone, especially if rebooting doesn't always do the trick!

Edit 2: I note that I am able to access files on the device via MTP using iMovie, even when aft-mtp-mount fails. Quitting iMovie does not solve the problem. Presumably there is some process holding open the device, but what process that might be is not obvious.

cpcallen avatar May 15 '19 13:05 cpcallen

0xe00002c5 is exclusive access error, it's definitely some other process keeping interface open. Try passing -C to mtp-aft-cli and see how it goes.

whoozle avatar May 18 '19 17:05 whoozle

Output from aft-mtp-cli -C:

$ aft-mtp-cli -C
Device::Find failed:no interface descriptor found
Device::Find failed:(*interface)->GetPipeProperties(interface, idx, &direction, &number, &transferType, &maxPacketSize, &interval): error 0xe00002cd
no mtp device found

cpcallen avatar May 28 '19 14:05 cpcallen

Oh, ironically the program that was preventing it from working today (and which I bet has been the main culprit for quite a long time) is Google Backup & Sync, which of course has an option to automatically upload photos on attached USB devices to Google Photos, and which seems to keep Android devices open even when this option is totally disabled in settings… sigh.

cpcallen avatar May 28 '19 14:05 cpcallen

Have a similar issue, but with a different phone on 10.14.6. It used to work, and I am pretty sure macOS update broken it. Worked from 10.14.4 afaik.

Sometimes I am able to connect, just by hitting ignore multiple times when the message pops up. It lists the folders, but download from the phone doesn't work.

$ aft-mtp-cli -v
IOCreatePlugInInterfaceForService(desc, kIOUSBDeviceUserClientTypeID, kIOCFPlugInInterfaceID, &plugInInterface, &score): error 0xe00002be
probing device 05ac:8007
probing device 05ac:025a
Device::Find failed:(*_interface)->USBInterfaceOpen(_interface): error 0xe00002c5
probing device 0a5c:4500
Device::Find failed:(*_interface)->USBInterfaceOpen(_interface): error 0xe00002c5
probing device 174c:55aa
Device::Find failed:(*_interface)->USBInterfaceOpen(_interface): error 0xe00002c5
probing device 2a70:9011
Device usb interface: 0:0, index: 0, enpoints: 3
languages[4]:
00000000: 04 03 09 04                                     ....

descriptor[85]:
00000000: 09 02 55 00 03 01 04 80 fa 09 04 00 00 03 ff ff ..U.............
00000010: 00 05 07 05 81 02 00 02 00 07 05 01 02 00 02 00 ................
00000020: 07 05 82 03 1c 00 06 09 04 01 00 02 08 06 50 06 ..............P.
00000030: 07 05 83 02 00 02 00 07 05 02 02 00 02 01 09 04 ................
00000040: 02 00 02 ff 42 01 08 07 05 03 02 00 02 00 07 05 ....B...........
00000050: 84 02 00 02 00                                  .....

interface name[8]:
00000000: 08 03 4d 00 54 00 50 00                         ..M.T.P.

selected storage 65537  Internal shared storage
android file transfer for linux version continuous
OnePlus ONEPLUS A5010 1.0
extensions: microsoft.com: 1.0; android.com: 1.0;
supported op codes: 1001 1002 1003 1004 1005 1006 1007 1008 1009 100a 100b 100c 100d 1014 1015 1016 1017 101b 9801 9802 9803 9804 9805 9810 9811 95c1 95c2 95c3 95c4 95c5
supported properties: d401 d402 5003 5001
$ ioreg -p IOUSB -l -w 0
+-o Root  <class IORegistryEntry, id 0x100000100, retain 15>
  | {
  || ...
  | }
  |
  +-o AppleUSBXHCI Root Hub Simulation@14000000  <class AppleUSBRootHubDevice, id 0x10000030f, registered, matched, active, busy 0 (2 ms), retain 21>
    | {
    || ...
    | }
    |
    +-o BRCM20702 Hub@14300000  <class AppleUSBDevice, id 0x100000349, registered, matched, active, busy 0 (362 ms), retain 21>
    | | {
    | |   "sessionID" = 1317169207
    | |   "iManufacturer" = 1
    | |   "bNumConfigurations" = 1
    | |   "idProduct" = 17664
    | |   "bcdDevice" = 256
    | |   "Bus Power Available" = 250
    | |   "USB Address" = 4
    | |   "bMaxPacketSize0" = 8
    | |   "iProduct" = 2
    | |   "iSerialNumber" = 0
    | |   "bDeviceClass" = 9
    | |   "Built-In" = Yes
    | |   "locationID" = 338690048
    | |   "bDeviceSubClass" = 0
    | |   "bcdUSB" = 512
    | |   "USB Product Name" = "BRCM20702 Hub"
    | |   "PortNum" = 3
    | |   "non-removable" = "yes"
    | |   "IOCFPlugInTypes" = {"9dc7b780-9ec0-11d4-a54f-000a27052861"="IOUSBFamily.kext/Contents/PlugIns/IOUSBLib.bundle"}
    | |   "bDeviceProtocol" = 0
    | |   "IOUserClientClass" = "IOUSBDeviceUserClientV2"
    | |   "IOPowerManagement" = {"DevicePowerState"=2,"CurrentPowerState"=3,"CapabilityFlags"=65536,"MaxPowerState"=4,"DriverPowerState"=3}
    | |   "kUSBCurrentConfiguration" = 1
    | |   "Device Speed" = 1
    | |   "USB Vendor Name" = "Apple Inc."
    | |   "idVendor" = 2652
    | |   "IOGeneralInterest" = "IOCommand is not serializable"
    | |   "IOClassNameOverride" = "IOUSBDevice"
    | | }
    | |
    | +-o Bluetooth USB Host Controller@14330000  <class AppleUSBDevice, id 0x100000381, registered, matched, active, busy 0 (1 ms), retain 17>
    |     {
    || ...
    |     }
    |
    +-o OnePlus@14200000  <class AppleUSBDevice, id 0x10000e651, registered, matched, active, busy 0 (5 ms), retain 28>
        {
          "sessionID" = 463698885804326
          "iManufacturer" = 1
          "bNumConfigurations" = 1
          "idProduct" = 36881
          "bcdDevice" = 1028
          "Bus Power Available" = 250
          "USB Address" = 28
          "bMaxPacketSize0" = 64
          "iProduct" = 2
          "iSerialNumber" = 3
          "bDeviceClass" = 0
          "Built-In" = No
          "locationID" = 337641472
          "bDeviceSubClass" = 0
          "bcdUSB" = 512
          "USB Product Name" = "OnePlus"
          "PortNum" = 2
          "non-removable" = "no"
          "IOCFPlugInTypes" = {"9dc7b780-9ec0-11d4-a54f-000a27052861"="IOUSBFamily.kext/Contents/PlugIns/IOUSBLib.bundle"}
          "bDeviceProtocol" = 0
          "IOUserClientClass" = "IOUSBDeviceUserClientV2"
          "IOPowerManagement" = {"DevicePowerState"=0,"CurrentPowerState"=3,"CapabilityFlags"=65536,"MaxPowerState"=4,"DriverPowerState"=3}
          "kUSBCurrentConfiguration" = 1
          "Device Speed" = 2
          "USB Vendor Name" = "OnePlus"
          "idVendor" = 10864
          "IOGeneralInterest" = "IOCommand is not serializable"
          "USB Serial Number" = "b3eab58"
          "IOClassNameOverride" = "IOUSBDevice"
        }

This app is much better than the official android file transfer and doesn't autolaunch when it wants too 👍

Probably best to change the title, as I don't think it has anything to do with specific phones and it is happening with other OS versions.

dmlemos avatar Dec 10 '19 22:12 dmlemos

Sorry for the late update, but some time ago I've refreshed macosx build stuff and generated plist for the newer versions. Could you recheck please?

whoozle avatar Dec 29 '20 00:12 whoozle

I've just tried v4.2 (I was unable to try anything newer due to #264), but it appears to be completely broken: when I double-click on the Android File Transfer for Linux app, it appears briefly in the dock before disappearing immediately. No error message is displayed. This happens regardless of whether Backup and Sync from Google is open.

When I run the binary directly:

$ /Applications/Android\ File\ Transfer\ for\ Linux.app/Contents/MacOS/android-file-transfer 
upload worker started
current text color value:  0 , guessed theme:  "light"
scan
probing device...
probing device...
probing device...
Device::Find failed: (*plugInInterface)->QueryInterface(plugInInterface, CFUUIDGetUUIDBytes(kIOUSBInterfaceInterfaceID), (LPVOID *) &usbInterface): error 0x80000004
probing device...
Device::Find failed: (*plugInInterface)->QueryInterface(plugInInterface, CFUUIDGetUUIDBytes(kIOUSBInterfaceInterfaceID), (LPVOID *) &usbInterface): error 0x80000004
probing device...
Device::Find failed: (*plugInInterface)->QueryInterface(plugInInterface, CFUUIDGetUUIDBytes(kIOUSBInterfaceInterfaceID), (LPVOID *) &usbInterface): error 0x80000004
probing device...
Device::Find failed: (*plugInInterface)->QueryInterface(plugInInterface, CFUUIDGetUUIDBytes(kIOUSBInterfaceInterfaceID), (LPVOID *) &usbInterface): error 0x80000004
probing device...
probing device...
Device::Find failed: (*plugInInterface)->QueryInterface(plugInInterface, CFUUIDGetUUIDBytes(kIOUSBInterfaceInterfaceID), (LPVOID *) &usbInterface): error 0x80000004

Output from aft-mtp-cli:

$ aft-mtp-cli -v
probing device 05ac:8007
USBDeviceOpen failed: error 0xe00002c5
descriptor->TryOpen() failed
probing device 05ac:8006
USBDeviceOpen failed: error 0xe00002c5
descriptor->TryOpen() failed
probing device 05ac:8290
configurations: 1
Device::Find failed:(*plugInInterface)->QueryInterface(plugInInterface, CFUUIDGetUUIDBytes(kIOUSBInterfaceInterfaceID), (LPVOID *) &usbInterface): error 0x80000004
probing device 05ac:9127
configurations: 1
Device::Find failed:(*plugInInterface)->QueryInterface(plugInInterface, CFUUIDGetUUIDBytes(kIOUSBInterfaceInterfaceID), (LPVOID *) &usbInterface): error 0x80000004
probing device 05ac:1107
configurations: 1
Device::Find failed:(*plugInInterface)->QueryInterface(plugInInterface, CFUUIDGetUUIDBytes(kIOUSBInterfaceInterfaceID), (LPVOID *) &usbInterface): error 0x80000004
probing device 05ac:9227
configurations: 1
Device::Find failed:(*plugInInterface)->QueryInterface(plugInInterface, CFUUIDGetUUIDBytes(kIOUSBInterfaceInterfaceID), (LPVOID *) &usbInterface): error 0x80000004
probing device 05ac:1112
USBDeviceOpen failed: error 0xe00002c5
descriptor->TryOpen() failed
probing device 18d1:4ee1
configurations: 1
Device::Find failed:(*plugInInterface)->QueryInterface(plugInInterface, CFUUIDGetUUIDBytes(kIOUSBInterfaceInterfaceID), (LPVOID *) &usbInterface): error 0x80000004
device not found (filter = ''

I am able to access my phone (a Google Pixel 1) without difficulty using Google's Android File Transfer app, provided Backup & Sync is not running, so it's not an issue with the phone or the connection.

I am still on macOS 10.13.6.

cpcallen avatar Feb 10 '21 23:02 cpcallen

Same problem on macOS 10.13.6. Resolved by building the project locally, now working flawlessy. Maybe is connected with the libUSB issue.

scondratev avatar Nov 04 '21 15:11 scondratev