Cordova visual studio ios agent configuration - ios

I am trying to test my Cordova application in iOS, I followed all the steps that included in https://msdn.microsoft.com/library/dn757054.aspx#ios
When configuring Visual Studio -->tools-->options--->tools for Apache Cordova, I get this error :
An error occurred trying to acquire certificate from [Host].
I have an Apple developer ID, and I am already logged in in Xcode.

I solved this issue by placing the IP address of the host in the Host field, rather than the host name.

Be sure after doing all of this to also type remotebuild on the command line of the mac to prepare it to receive the build from your pc :-) ... Think of it like bluetooth pairing..

Replace host name using IP address MacBook and try again.
If this does not work then following are steps to reset remotebuild:
first stop server using following command:
cntrl + c
Execute following command to reset remotebuild certificates:
remotebuild certificates reset
Run following to command to regenerate remotebuild server:
remotebuild certificates generate
here, new secure pin number will be generated.
Following command to start remotebuild:
remotebuild
now try again, make sure 'Enable remote iOS processing' is true and 'Secure mode' is true and valid secure number is added.

Related

Unable to connect Visual Studio to remotebuild on El Capitan VM

I have a Cordova-Ionic application on Visual Studio (Microsoft Visual Studio Community 2015, Version 14.0.25123.00 Update 2). I am able to run the app on my android phone and all is good. I want to test the app by also running it on an iPhone/iOS simulator.
I have OS X El Capitan (version 10.11.6) running as a VM on virtual box. I have been following this guide (https://taco.visualstudio.com/en-us/docs/ios-guide/) to try to test the app on apple devices. I have installed version 0.12.9 Node.js and Xcode Version 8 Beta 4. I have also installed xcode command line tools, remote agent, homebrew. I have tried running 'remotebuild test' in a terminal and it executes successfully, ending with 'taco-remote test passed.' However, this is where the problems start.
To attempt to use secure remotebuild, i run 'remotebuild certificates reset' and then 'remotebuild certificates generate' in the terminal. I see
host: noyolks-iMac.local
port: 3000
PIN: 121422
I then run 'remotebuild'. On visual studios on my windows machine, I then go to tools -> options -> tools for apache cordova -> iOS configuration. I set 'Enable remote iOS processing' to 'true', 'host' to 'noyolks-iMac.local', 'port' to '3000', 'secure mode' to 'true', 'security pin' to '121422'. However, when i press ok, i see the following error popup 'Unable to connect to remote iOS build server. Underlying exception: The remote name could not be resolved: 'noyolks-imac.local''.
I try using the IP instead in place of the host name as suggested in the guide. On OS X, i go system preferences -> network. I then see '10.0.2.15' under IP address. I go back to my windows machine. I try '10.0.2.15' in place of the 'host'. When i press ok, i see the following error popup 'An error occurred trying to acquire certificate from https://10.0.2.15.'.
Please note, I ensured that all the above was done within the 10 minutes window before the security pin expires.
Following the guide, I then tried to start the remote agent without secure mode. I run 'remotebuild --secure false'. Once again on visual studio on my windows machine, i try host 'noyolks-imac.local' first (with 'port' to '3000', 'enable remote iOS processing' to 'true', 'secure mode' to 'false') and i get the error popup 'Unable to connect to remote iOS build server. Underlying exception: The remote name could not be resolved: 'noyolks-imac.local''.
Once again, running without secure mode, i instead use the ip address in place of the host '10.0.2.15'. I get the error popup 'Unable to connect to remote iOS build server. Underlying exception: Unable to connect to the remote server'.
I have also tried a similar procedure using a friends mac book pro and have not been able to get this to work. Any help would be appreciated and please do feel free to ask for any other information you might need.
Thanks.
I'm an idiot. The problem was that I couldnt even ping my El Capitan VM. Changing the network adapter settings in virtualbox to 'bridged adapter' solved this.

Visual studio remote iOS agent configuration error while building cordova app on iOS

I want to connect to Remote Agent on Mac. I have npm, node.js installed. I have also remotebuild installed and it spits out the remotebuild certificate. I have Xcode installed and active too. But Once I try to connect from VS 2015 Tools for Apache Cordova and input the certificate info I get the following error:
An error occured to acquire certificate from https://(ip address).
I also tried using unsecure mode and just IP address. When I run remote test on ios terminal i get the following code:
Warning:
No server modules selected. Defaulting to configuration "modules":
{"taco-remote": { "mountPath": "cordova"} } Remote build server
listening on [https] port 3000 Please view/edit server configuration
at /Users/Bp0_0n/.taco_home/RemoteBuild.config. You many need to run
'remotebuild saveconfig' to generate it. You will have to restart the
server if you update the server configurations.
I am unable to figure out what is exactly needed to be done? Can any one help me?

Visual Studio Cordova OS X or IOS Remote connection

I am using Visual Studio Cordova to build IOS app remote build or debug feature.
I tried to connect remote server with secure and non secure method and getting different error.
First i generated certificate and use Host IP(Mac IP), security PIN and IOS device Support Folder details in Visual Studio > Tools > Tool for Apache Cordova > IOS Configuration.
Mac IP = got from ifconfig can be see in attached image.
Security PIN = Genrated by command "remotebuild certificates generate"
ISO Device Folder = 192.168.169.130\Applications\Xcode.app\Contents\Developer\Platforms\iPhoneOS.platform\DeviceSupport.
when tried with secure method. Image Attached
when tried with secure false method. Image Attached
started the server by remotebuild. Image Attached
RemoteBuild test passed. Image Attached
First, please ensure you've followed the steps mentioned in http://taco.visualstudio.com/en-us/docs/ios-guide/
And ensure the remotebuild is started on you Mac.
Second, ensure you can successfully ping the ip of your Mac using ping 192.168.x.x
And from the IPs provided, you may run into the issue mentioned in "Did you receive an error that relates to your certificate?".
To fix the certificates error: In secure mode, you have not set up certificates correctly. On the Mac, you can re-set up your certificates. Close remotebuild using Ctrl + C. Enter on the command line:
remotebuild certificates reset (When prompted, type Y and then type Enter)
remotebuild certificates generate
Then enter the new pin in VS and connect.

Visual Studio remotebuild for iOS fails with Error: self signed certificate in certificate chain

I have a Mac mini configured as the remotebuild server. Remote building my cordova app to the Mac was working ok in secure mode for a while but I was suddenly greeted with a Error: self signed certificate in certificate chain.
I've followed several suggestions of running the commands,
remotebuild certificates reset
remotebuild certificates generate
then updating the pin accordingly in Visual Studio to no avail. I can build successfully when running in non-secure mode.
remotebuild --secure-mode false
I've also tried cleaning my solution in VS2015, nuking the certs folder on the Mac and re-installing remotebuild. It may be worth noting that something in the build process was constantly corrupting the remote_ios.json file so I was having to keep removing that file to build every other time as explained here.
Any ideas on how to get around this error or why it would suddenly be a point of failure?
This "self signed certificate in certificate chain" error can happen if remotebuild generates a certificate under one identity (hostname / ip address) and is accessed via another one. The client will look at the certificate and find that it doesn't match what it expected, and so it does not trust the server. My guess is that it began failing for you due to a change in your network architecture.
If you know the identity that other machines will attempt to use, for example if they will use some.buildserver.local, then you can instruct remotebuild to generate a certificate using that identity via remotebuild --hostname="some.buildserver.local" --secure=true saveconfig && remotebuild certificates reset && remotebuild certificates generate.
Once you have created new certificates that should match client expectations, if you reconfigure them then they should accept the server's certificate.
Also apart from those I did restart my client computer as well.

Visual Studio 2015 for Cordova - Can't build for iOS

I have successfully built my project for Android but during building for iOS I get an error:
The remote build server denied the build request, because the client
certificate is invalid or has expired. To build your project, you must
generate and configure a security PIN. See
http://go.microsoft.com/fwlink/?LinkID=511904
I have generated a new pin (after doing a resetServerCert, followed by a generateClientCert), as described in the link above, I reinstalled the remotebuild tool, but all to no avail. It also doesn't matter if I just try to build or build/deploy to a local device.
I also tried building without pin, but that doesn't work either:
Cannot POST
/build/tasks?command=build&vcordova=5.1.1&cfg=debug&options=--device
I am close to releasing my app, but the issues above have set me back a couple of days.
Any suggestions?
From your comment that VS is trying to POST //build/tasks?command=build&vcordova it looks like it isn't configured properly: That empty URL segment should be "cordova", and that is discovered when you configure VS to talk to the remote agent in tools -> options.
If you go to Tools -> Options -> Tools for Apache Cordova -> Remote Agent Configuration and reconfigure your settings (Either disabling secure mode on the mac server, or generating a new pin to use) then VS should be able to connect.
I finally got my first successful build after going through this page: https://github.com/Microsoft/cordova-docs/blob/master/known-issues/known-issues-ios.md
The issue was that I first had vs-mda-remote installed and then changed to remotebuild. You have to follow these steps in this situation:
generate and use a new PIN
If you are not using secure mode, turn secure mode on
Turn secure mode off again to cause VS to reinitalize

Resources