Cordova Build Windows 10 App on Mac OS X - macos

Hi there I hope this question wasn't answered anywhere else on SO, but 4h spent on research is enough for today.
My simple question is, if it's possible to build a Windows10 App with cordova on Mac OS X (10.12). Why I want to do such kind of thingy is that I just set up jenkins for some of our projects and we are working with Xamarin, Cordava and native ones, I wanted to configure jenkins for each of them to automate iOS, Android and Windows builds. Everything is working so far, but when I try to build windows cordova app it fails with the following message:
cordova build windows --release
Error: spawn ENOTDIR
I watched the logs and recognized at some point cordova is trying to find MsBuildToolsPath in Registry with:
reg query ...
which is acceptable not working on Mac OS. So I tried to build with msbuild directly:
msbuild /p:Platform=AnyCPU /p:Configuration=Release CordovaApp.sln
Which throws following error:
MSB4226: The imported project
"/Library/Frameworks/Mono.framework/Versions/5.0.1/lib/mono/xbuild/Microsoft/VisualStudio/v15.0/JavaScript/Microsoft.VisualStudio.WJProject.Default.props"
was not found. Also, tried to find
"Microsoft/VisualStudio/v15.0/JavaScript/Microsoft.VisualStudio.WJProject.Default.props"
in the fallback search path(s) for $(MSBuildExtensionsPath32) -
"/Library/Frameworks/Mono.framework/External/xbuild/" . These search
paths are defined in
"/Library/Frameworks/Mono.framework/Versions/5.0.1/lib/mono/msbuild/15.0/bin/MSBuild.dll.config".
Confirm that the path in the declaration is correct, and that
the file exists on disk in one of the search paths.
I followed the path and the files cordova is looking for are not existent, but I found nothing on how to install the Javascript Tools on Mac OS without re/installing Visual Studio.
I am not into cordova so excuse me if this question is not worth wasting your time, but if anybody could help me to get this last platform build succeeding with Jenkins I would really appreciate.

If you're talking about Windows 10 UWP apps the answer is no. See the question also linked in the comments and the documentation on Visual Studio 2017 for Mac Platform here:
Visual Studio for Mac does not support Windows client projects like
Windows Forms, WPF, or UWP.
Possible solutions:
Set up your Mac with Windows 10: Microsoft suggests using Bootcamp, Parallels or a virtual machine with VMware or VirtualBox to run Windows 10 and be able to develop UWP apps on you Mac.
Use a build service: Depending on your requirements, you may consider using a build service. Most popular service might be https://build.phonegap.com/. It does support building UWP apps. You can see their plans here.

Related

Can you publish a Windows 10 (Universal) app from PhoneGap on Mac?

I am looking to develop a Windows 10 Universal app based in HTML, CSS, and JavaScript for use on Microsoft Surface tablets primarily. I have found information that says it can be done on this page, but at the very bottom of the page it says it is in beta. However, I can't seem to find anything more than that post. No updates, or documentation or anything. Does anyone know if you can do this from the PhoneGap app on Mac OS?
If not, I guess the next best option it to do it on a Windows machine using Visual Studio 2017 and Cordova?
Any information anyone has on this subject would be helpful.
Thanks!
No, I am pretty sure you can't build UWP apps on macOS. The reason is quite similar as the reason you cannot build iOS apps on Windows - you could build the JS portion of your code, but the problem is the fact that UWP build tools and SDKs are OS specific and unless Microsoft specifically ports them to macOS, they cannot work there.
You could use Parallels and run Windows as second OS, or use a build server to build the app in the cloud. Visual Studio App Center is a very good solution for you purpose as it allows you to configure a full build pipeline including UWP, iOS and Android builds.
You can actually develop a UWP app using phoneGap on Mac if you are building it using web technologies. (HTML, CSS, Javascript) But you can not build/publish the app on Mac, but if you have a Creative Cloud account, you can use Phone Gap Build to upload it to the service and have it built there.

Building Xamarin iOS on Mac fails using msbuild with mono_os_mutex_lock (succeeds from VS for Mac)

Background
I'm trying a new route for building my xamarin projects with my CI. I have a new project which successfully builds on the PC through VS connected to a Mac. It also successfully builds on the Mac using Visual Studio for Mac.
The problem
It fails when I try to build from the command-line (terminal) using msbuild with the error:
mono_os_mutex_lock: pthread_mutex_lock failed with "Invalid Argument" (11)
The Research
I've scoured the internet and found some recent issues with this error that were indicated as being resolved in Mono 5.0.1 (which I have), such as:
peverify fails on FSharp.Core.dll with mono_os_mutex_lock: pthread_mutex_lock failure
peverify is broken again
One other I can't remember or find now (but had no useful information, and might have pointed back to the above links)
Other Notes
I have other builds using the vsts build agent that continue to work, although they are using the VSTS Xamarin and Android build tasks. I'm wondering if I'm missing some environment settings or something else. I do not currently have a scaled down project that can be tested. I'm up to date when I check in VS for Mac on all the Xamarin bits.

Compile OSX app on Windows with Xamarin

I have a Xamarin Mac app I've been handed to make some changes. I've got everything working correctly as far as Windows Visual Studio Xamarin connecting to Mac Xamarin -- the Mac ssh agent works and whatnot.
However, how do I compile the app? When I build it on Windows, it generates an .exe file. Is something supposed to be generated on the Mac side, too? Or do I take that .exe file and somehow package it into an OSX app?
I was trying to stay in my Windows environment to do the coding and building as much as possible.
Thank you.
You will need to compile/package/debug it on macOS.
The build process is performed locally on Windows, generating IL assemblies that cannot be used for running or debugging apps, and it doesn't create application bundles.
re: https://developer.xamarin.com/releases/vs/xamarin.vs_4/xamarin.vs_4.2/#Xamarin.Mac_minimum_support.
macOS Apps
Mac apps can be opened and compiled in Visual Studio to check for errors, however to debug or create a working executable the project must currently be built on a Mac. This limited support for Mac projects allows for easier code sharing in Visual Studio between iOS, Android, Windows, and Mac apps.
re: https://developer.xamarin.com/guides/cross-platform/windows/visual-studio/#macOS_Apps

Error when try to deploy in windows phone

I am developing an app with Ionic framework and I need the application in windows phone. When I try to deploy the application with Visual Studio 2015 I get this error the following error:
Installation of the application failed. There are pending operations
in the deployment queue windows phone
I'm searching for solutions but look like if no one have this problem.
Thanks.
The requirements for developing hybrid applications (Android and Windows SDK) in VS 2015 are as following:
Install Apache Cordova.
Download and point to location of Ant.
Download Android SDK and point to the SDK folder path.
Install Windows App Development Tools.
Install Git and point to this path.
Install Common Tools and SDKs.
All of these can be done from the setup. See this page. Additionally, if you have installed them outside of the setup (excluding common tools), you can point to the path from Tools > Options > Tools for Apache Cordova > Environment variables.
Look at this configuration guide to learn more.
Well, I never find an answer to solve this problem so I start a new cordova project from Visual Studio and then I migrate all the application to this new project. This works really fine and now the app is running correctly in windows phone. I highly recommend do this, because the project created from Visual Studio is now the base to the other platforms.

build ios app with visual studio using xamarin, without mac build host

I am a new user to xamarin.
I installed Xamarin.IOS on visual studio. When i create a new project and want to build it, vs says that you should select a "mac build host".
Is it necessary for building ios application?
May I do that in a simulator? because I don't have a Mac machine.
Thank you very much.
You must have a Mac to act either as a build host or your primary development machine in order to build an iOS app. The iOS build process relies on the Apple iOS SDK and tools that are ONLY available from Apple on OS X.
If you are completely refused any idea of buying Mac here the solution. In my case I use next tools:
Windows 8.1 x64
Visual Studio 2015 Update 3 (Xamarin inside)
VMWare Workstation 12
Inside VMWare Workstation:
OS X 10.11 El Capitan
XCode 7.1 (Xamarin's developers recommend 7.3)
Xamarin Community 6.0.1
General advice is to use latest versions and updates of all tools.
Install El Capitan as it described here.
On VM install latest XCode (you probably need Apple ID for it) and iOS part of Xamarin Studio. If Xamarin Installer generates error on downloading JDK 7 then download and install it before Xamarin Studio
Enable Remote Login in MacOS settings and allow access for your user
Configure VM network as NAT and make port forwarding for port 22
Run Visual Studio on Windows and create iOS project.
Connect to Mac using IP 127.0.0.1 and type your Mac's username and password
Select appropriate iOS emulator in Visual Studio and run.
Here the proof pic
Regarding this topic I've tried many approaches. I spent too many hours trying to install hackintosh on a VM on my MS Windows 10 system... I tried a lot of receipts... I could install it free times but I couldn't reboot it none of the tries. ##£%&!!!!
Before this anoying "R&D" I searched for a cheap second hand Mac and I also searched after but without getting good results...
Today I want to share my next step with you all before starting with it because I guess (I hope indeed) is going to be the solution for my next 4-6 months to do iOS developments with xamarin using VS on a Windows machine without owning a Mac, use a Mac hosting already prepared for dev purposes:
https://www.macincloud.com/checkout/managed.html
For setting up Xamarin iOS with Windows and Visual Studio, you'll need to have MAC to run / test the application in the simulator.
Please review the limitation here http://developer.xamarin.com/guides/ios/getting_started/installation/windows/
You can either install MAC OS X in your windows PC using VM Ware and setup MAC OS

Resources