我从Visual Studio 2015无法使用Xamarin Mac Agent连接到Mac [英] I can't connect to Mac with Xamarin Mac Agent from Visual Studio 2015

查看:2149
本文介绍了我从Visual Studio 2015无法使用Xamarin Mac Agent连接到Mac的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在用Xamarin继续我的冒险。



我正在使用便携式类库(PCL)开发Xamarin Forms应用程序。



我已经通过Android编译和调试了我的应用程序,但现在我有兴趣在iOS平台上运行应用程序进行测试。



我的PC和Mac之间的连接有问题。



我有安装了Xamarin工具的Visual Studio社区2015的PC(Windows 8.1)。



在我的Mac Mini中,我已经安装了OS X(v10.11.3),XCode(v7.2)和Xamarin Studio。我已经使用我的Xamarin帐号登录了。



在这两台机器中,我有相同的Xamarin版本。



我遵循了



此时登录工作。





然后,在解决方案中,我将iOS项目设置为启动项目。我清理解决方案,我再次构建并启动编译/调试过程(F5)。



在这一点上,输出检索一条消息:


1>连接到Mac服务器Macs-Mac-mini.local ...



1> C :\程序文件(x86)\MSBuild\Xamarin\iOS\Xamarin.iOS.Windows.After.targets(54,5):警告:无法使用现有的ssh密钥验证用户



1> C:\程序文件(x86)\MSBuild\Xamarin\iOS\Xamarin.iOS.Windows.After.targets(54,5):错误: User ='macmini


我已经使用了Putty(SSH客户端),无法连接到Address ='Macs-Mac-mini.local' )要检查我的用户/密码,如果我能够连接到Mac,并且我已经成功。



进入/Users/macmini2/.ssh/authorized_keys文件(Mac机器),每次使用Xamarin Mac Agent时,Visual Studio都会添加一个新的密钥条目(它同样重复)。 p>

我看到这个问题可能与ssh键有关。
为什么我有这个问题?我做错了什么?



我测试过的一个事情是直接在Mac中使用Xamarin Studio打开Xamarin项目,构建并运行模拟器。



我看过其他类似的问题,但我认为它没有相同的问题。



编辑:



当我尝试编译/调试时,有关错误的更具体的信息:

 无法使用现有的ssh密钥验证用户
Xamarin.Messaging.VisualStudio.MessagingAuthenticationException:无法使用现有的ssh密钥验证用户 - - > Renci.SshNet.Common.SshAuthenticationException:Permission denied(publickey)。
en Renci.SshNet.ClientAuthentication.Authenticate(IConnectionInfoInternal connectionInfo,ISession session)
en Renci.SshNet.ConnectionInfo.Authenticate(ISession会话)
en Renci.SshNet.Session.Connect()
en Renci.SshNet.BaseClient.Connect()
en Xamarin.Messaging.VisualStudio.MessagingService。< ConnectAsync> d__70.MoveNext()
--- Fin del seguimiento de la pila de la excepcióninterna ---

编辑2:



我修改了疑难解答Xamarin页面,具体来说它表示无法使用SSH密钥验证,请尝试使用凭据登录。



我已经运行:

  chmod og-w$ HOME
grep sshd / var / log / system.log> $ HOME / Desktop / sshd.log
cd桌面
cat sshd.log

该文件的内容是:

  Apr 18 09:23:28 Macs-Mac-mini sshd [769 ]:拒绝身份验证:目录/Users/macmini2/.ssh的所有权或模式不正确
Apr 18 09:25:27 Macs-Mac-mini com.apple.xpc.launchd [1](com.openssh.sshd .EE9A94ED - ???? -....- ???? - 77254934B300 [769]):服务退出异常代码:1
Apr 18 09:59:39 Macs-Mac-mini sshd [1036 ]:接受的键盘交互/ pam for macmini2从192.168.54.14端口60413 ssh2
Apr 18 09:59:39 Macs-Mac-mini sshd:macmini2 [priv] [1036]:USER_PROCESS:1040 ttys000

但现在我不知道我要做什么来解决它。

解决方案

我已经找到有关我的问题的解决方案。我已经完成了以下步骤:


  1. 在我的Windows中:我已经从%localappdata% \Xamarin\MonoTouch。

  2. 在Mac终端中:删除authorized_keys Mac文件(rm /Users/macmini2/.ssh/authorized_keys在我的案例)

  3. 在Mac终端中: chmod gw / Users / macmini2 /

  4. 在Mac终端中: / strong> chmod 700 /Users/macmini2/.ssh/

  5. 在Mac终端中:创建一个空文件:/Users/macmini2/.ssh/authorized_keys以vim为例)

  6. 在Mac终端中: chmod 600 /Users/macmini2/.ssh/authorized_keys

  7. 在Visual Studio上登录:​​使用Xamarin Mac Agent登录

  8. 在Visual Studio中使用[Debug] - [iPhoneSimulator] [iPhone 5 iOS 8.1]

  9. 最后,模拟器在Mac电脑上运行。

此链接帮助了我。


I'm continuing my adventure with Xamarin.

I'm developing an Xamarin Forms application with a Portable Class Libraries (PCL).

I have compiled and debugged my application by Android, but now, I'm interested to run the application in iOS to test in this platform.

I have a problem with the connection between my PC and the Mac.

I have a PC (Windows 8.1) with Visual Studio Community 2015 with Xamarin tools installed.

In my Mac Mini, I have installed OS X (v10.11.3), XCode (v7.2) and Xamarin Studio. I have logged in with my Xamarin account.

In the two machines I have the same Xamarin version.

I have followed the Xamarin walkthrough.

On Visual Studio I open the Xamarin Mac Agent. It finds my Mac Mini. Then it asks me the Mac credentials (user and password).

The login works at this point.

Then, in the solution, I set the iOS project as the startup project. I clean the solution, I build again and start the compile/debug process (F5).

In this point, the output retrieves a message:

1> Connecting to Mac server Macs-Mac-mini.local...

1>C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.iOS.Windows.After.targets(54,5): warning : Could not authenticate the user using the existing ssh keys

1>C:\Program Files (x86)\MSBuild\Xamarin\iOS\Xamarin.iOS.Windows.After.targets(54,5): error : Unable to connect to Address='Macs-Mac-mini.local' with User='macmini

I have used Putty (SSH Client) to check with my user/password if I'm able to connect to Mac, and I have had success.

Into /Users/macmini2/.ssh/authorized_keys file (Mac machine) each time that I use the Xamarin Mac Agent, Visual Studio adds a new key entry (it adds the same repeated).

I see that perhaps the problem is related with ssh keys. Why I have this problem? What am I doing wrong?

A thing that I have tested was openning the Xamarin project directly in Mac with Xamarin Studio, build it and run the simulator. It works.

I have seen other similar question, but I think that it doesn't have the same problem.

EDIT:

More specific information about the error when I try to compile/debug:

Could not authenticate the user using the existing ssh keys
Xamarin.Messaging.VisualStudio.MessagingAuthenticationException: Could not authenticate the user using the existing ssh keys ---> Renci.SshNet.Common.SshAuthenticationException: Permission denied (publickey).
   en Renci.SshNet.ClientAuthentication.Authenticate(IConnectionInfoInternal connectionInfo, ISession session)
   en Renci.SshNet.ConnectionInfo.Authenticate(ISession session)
   en Renci.SshNet.Session.Connect()
   en Renci.SshNet.BaseClient.Connect()
   en Xamarin.Messaging.VisualStudio.MessagingService.<ConnectAsync>d__70.MoveNext()
   --- Fin del seguimiento de la pila de la excepción interna ---

EDIT 2:

I have revised the troubleshooting Xamarin page, specifically that it says "Unable to authenticate with SSH keys. Please try to log in with credentials first".

I have run:

chmod og-w "$HOME"
grep sshd /var/log/system.log > "$HOME/Desktop/sshd.log"
cd Desktop
cat sshd.log

And the content of the file is:

Apr 18 09:23:28 Macs-Mac-mini sshd[769]: Authentication refused: bad ownership or modes for directory /Users/macmini2/.ssh
Apr 18 09:25:27 Macs-Mac-mini com.apple.xpc.launchd[1] (com.openssh.sshd.EE9A94ED-????-....-????-77254934B300[769]): Service exited with abnormal code: 1
Apr 18 09:59:39 Macs-Mac-mini sshd[1036]: Accepted keyboard-interactive/pam for macmini2 from 192.168.54.14 port 60413 ssh2
Apr 18 09:59:39 Macs-Mac-mini sshd: macmini2 [priv][1036]: USER_PROCESS: 1040 ttys000

But now I don't know what I have to do to solve it.

解决方案

I have found the solution about my problem. I have done the following steps:

  1. In my Windows: I have removed the content from "%localappdata%\Xamarin\MonoTouch."
  2. In Mac terminal: Remove the authorized_keys Mac file ("rm /Users/macmini2/.ssh/authorized_keys" in my case)
  3. In Mac terminal: chmod g-w /Users/macmini2/
  4. In Mac terminal: chmod 700 /Users/macmini2/.ssh/
  5. In Mac terminal: Create a empty file: /Users/macmini2/.ssh/authorized_keys (with vim, for example)
  6. In Mac terminal: chmod 600 /Users/macmini2/.ssh/authorized_keys
  7. On Visual Studio: Login with Xamarin Mac Agent
  8. On Visual Studio: Run the application with [Debug] - [iPhoneSimulator] - [iPhone 5 iOS 8.1]
  9. And finally, the simulator runs on Mac computer.

This link helped me.

这篇关于我从Visual Studio 2015无法使用Xamarin Mac Agent连接到Mac的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆