4

Sorry in advance if this is a duplicate, I couldn't find a solution to this exact problem posted anywhere.

I'm using Unity on macOS and I am trying to build for Android. I'm running into an issue where my development phone (it's a Galaxy A5 2017) will start charging my MacBook when I plug it in and will not show up as an adb device.

What I've done so far is:

  • Enable USB debugging on my phone
  • Install android-sdk and android-platform-tools through homebrew
  • Install openjdk@8 through homebrew (this resolved an issue where the sdk required java 8)
  • Attempt to switch the USB mode on the phone from 'Charge connected device' to 'Transfer files'
  • Switch USB ports

Trying to switch USB modes on the phone does not seem to work, it will close the dialog when selecting 'Transfer files' but when I check in the notification shade it will still be set to 'Charge connected device'. I also tried checking if the phone showed up over adb, but unfortunately adb devices returns an empty list.

Potentially useful information: I have built this exact Unity project to this exact phone successfully from my Windows desktop with this USB C to C cable, but I need to be able to do this from my MacBook.

I am using:

  • Unity 2021.1.4f
  • macOS Big Sur 11.4
  • Android 8.0.0

My question is, how can I prevent my phone from trying to charge the Mac? How can I get it to show up as an adb device so I can build to it from Unity?

Edit: alecxs suggested another question as a possible solution but this did not work for me either. In USB debugging, the USB mode is still set to MTP file transfer when this issue occurs. Changing it to something else and back unfortunately does not resolve the issue.

Edit 2: looks like this is a problem with macOS. I came across this article that mentioned for Samsung phones you need to use Smart Switch. I downloaded it for macOS, but it warned me that until further notice they do not support Big Sur as their system extension has not been approved. There is a temporary workaround mentioned in the warning here, but it is a bit involved, requiring you to disable SIP. For now this seems like the only solution. Since I know the root of the issue, I will mark this question as solved.

3
  • 1
    May be this is the way to tell you how Apple thinks of Android? "As power bank they might be usable but as smartphone they are not comparable to our unmatched iPhone", sorry SCNR. To be serious when it works with a Windows PC but not with a MAC then most likely the device is not the problem and you need an expert in MAC configuration...
    – Robert
    Commented May 26, 2021 at 18:07
  • Does this answer your question? Plugging phone into laptop charges laptop instead of phone
    – alecxs
    Commented May 26, 2021 at 23:01
  • @alecxs Thanks for the suggestion, I tried checking the USB setting in the Debugging Options but it was already set to MTP while the phone is plugged in, and changing it to something else and back doesn't seem to work either. Commented May 27, 2021 at 14:43

1 Answer 1

1

I believe I've found the issue, I added an edit to the original post. Looks like this is a problem with macOS. I came across this article that mentioned for Samsung phones you need to use Smart Switch. I downloaded it for macOS, but it warned me that until further notice they do not support Big Sur as their system extension has not been approved. There is a temporary workaround mentioned in the warning that can be found here, but it is a bit involved, requiring you to disable SIP. For now this seems like the only solution until Apple approves the extension.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .