Search code examples
iosvisual-studiobuildvisual-studio-cordova

How to build an iOS application using Visual Studio Tools for Apache Cordova and Xcode 8


This if question for those, who know what I am doing wrong and help for those experiencing the same issue.

I use Visual Studio 2015 on Win10 and Visual Studio Tools for Apache Cordova. I have Xcode 8 on my Mac. When setting up my projects, I follow this guide - https://taco.visualstudio.com/en-us/docs/ios-guide/. I also use a the hook available here - https://dpogue.ca/articles/cordova-xcode8.html. At this moment I am building ad-hoc application (I do believe store distribution type of application will be another issue).

Although I do all the steps mentioned in the lineked documents my builds fails with message "No suitable provisioning file found ..."(yes, I downloaded all necessary provisionig file under Acount dialog using my Xcode installation).

I found this solution - after the first build I open the project on Mac using Xcode (the project file is located under Macintosh HD/Users/MYNAME/.taco_home/remotebuilds/taco-remote/builds/BUILDNUMBER/cordovaApp/platforms/ios). I don't change anything, I only choose Build option from the Xcode menu. The project is build successfuly and since that, I am able to build the project from Visual Studio any time I need. Am I doing anything wrong? I think the compilation directly in Xcode shouldn't be necessary.

P.S. I just found, that new provisioning profile apears on my Mac, once it builds it - it's named "iOS Team Provisioning Profile: APP_ID". Probably, it's somehow related to the issue.


Solution

  • Finally I found the solution when building the app for app-store. It's necessary to specify provisionig file ID in your build.json. file. It's necessary to add this section INCLUDING the provisioningProfile key.

    "release": { "developmentTeam": "XXXXXXXXXXX", "codeSignIdentity": "iPhone Distribution", "provisioningProfile": "XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX", "packageType": "app-store" }

    The ID is name of the provisioning file, which is stored on Mac in ~/Library/MobileDevice/Provisioning Profiles/

    More info can be found How to build and upload a correctly signed iOS app to App Store and https://cordova.apache.org/docs/en/latest/guide/platforms/ios/