macosxamarinzshmacos-catalinabroker

Broker Problem with connect to Mac from Visual Studio 2019 Xamarin.iOS


After updated mac OS to Catalina 10.15.4 and XCode 11.4 and VS 2019 16.5.1
I can't pairing to mac from VS, there is getting the error in VS:
"An error occurred while trying to start Broker ...".

Info at log file:
"Broker could not be installed.
A connection is established to "192.168.233.1" ...
Server changes from ConnectingState to DisconnectingState to 192.168.233.1 (192.168.233.1).
Disconnecting from 192.168.233.1 ...
Server changes from DisconnectingState to DisconnectedState to 192.168.233.1 (192.168.233.1).
Connection to "192.168.233.1" is established.
An error occurred while trying to start Broker ...
Client vs - No packet has been sent in 30 seconds.
Sending Ping to Server to maintain Keep Alive"

I think the problem with connecting to macOS, because
Apple replaced bash with zsh as the default shell in macOS Catalina.

I tried to do next steps to resolve it:
1) Remove XMA folder on Mac and Windows:
On MacOs: open "$HOME/Library/Caches/Xamarin"
On Win: %localappdata%\Temp\Xamarin\XMA

2) I accepted XCode agreement on MacOS:

sudo xcodebuild -license accept

3) Then I tried connect to MacOS and I got the error:
"An unexpected error occurred while checking the SSH configuration "192.168.233.1". An item with the same key has already been added."

I fix it by deleted the hosts.key file in this directory:

 %LOCALAPPDATA%\Xamarin\MonoTouch

And again I got the same error: "An error occurred while trying to start Broker ..."

4) I checked ping with Mac ping 192.168.233.1 - works ,

ssh username@192.168.233.1 

This command gave the message:
"The default interactive shell is now zsh. To update your account to use zsh, please run chsh -s /bin/zsh. For more details, please visit https://support.apple.com/kb/HT208050."

Please give any advice how to fix problem with Broker to pair Visual Studio to MacOS with Catalina.


Solution

  • I found the solution:

    1. Copy the content from id_rsa.pub, it location here:

      %LOCALAPPDATA%\Xamarin\MonoTouch\

    2. Paste it into mac ~/.ssh/authorized_keys in a New Line.

    3. Download the attached scp.zip binary to Download folder on Mac and decompress it.

    4. Need temporarily disable the System Integrity Protection (SIP):

    1. When Mac will restart, executed in the Terminal next commands:

      sudo mount -uw /

    Backup old SCP:

    sudo cp /usr/bin/scp /usr/bin/scp.bak
    

    Replace SCP:

    sudo cp ~/Downloads/scp /usr/bin/scp
    

    Try now connection and it should work.

    1. Re-enable SIP after installation:
      Reboot into Recovery Mode again (āŒ˜+R at system chime).
      Open a Terminal and enter:
      csrutil enable

      Reboot