You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
2.8 KiB

7 years ago
7 years ago
  1. # Xamarin iOS Build
  2. Follow these steps to create a VSTS build for your eShopOnContainers app (iOS)
  3. **Note**: This document assumes basic knowledge about creating builds and configuring external VSTS connections
  4. ## Creating the build
  5. Despite the _"Get Sources"_ task there are three tasks more in the build:
  6. 1. Build Xamarin iOS Project
  7. 2. Copy generated packages
  8. 3. Publish the build artifact.
  9. ![iOS Build Steps](images/ios-build.png)
  10. Let's discuss each of them.
  11. ### Build the project
  12. Add a "Xamarin iOS" task with following configuration:
  13. 1. `eShopOnContainers-iOS.sln` in "Solution". This solution has been created ex professo for the build.
  14. 2. Ensure that the "Create App Package" checkbox is enabled
  15. **About signing & Provisioning section**
  16. In order to deploy your app to a physical device you must sign it using a certificate with a provisioning profile. Refer to [this blog
  17. post of the Xamarin team](https://blog.xamarin.com/continuous-integration-for-ios-apps-with-visual-studio-team-services/) for more info.
  18. Basically you have three options for setting the certificate (p12 file) and the provisioning profile:
  19. 1. Use MacInCloud VSTS agent and setup the p12 file and provisioning profile in the setup [https://blogs.msdn.microsoft.com/visualstudioalm/2015/11/18/macincloud-visual-studio-team-services-build-and-improvements-to-ios-build-support/](https://blogs.msdn.microsoft.com/visualstudioalm/2015/11/18/macincloud-visual-studio-team-services-build-and-improvements-to-ios-build-support/)
  20. 2. Use a custom mac machine with the certificate and provisioning profile installed. In this case you don't have to do anything else.
  21. 3. Have the p12 file and the provisioning profile reachable on somewhere
  22. If you choose option 3, you need to download the certificate and the provisioning profile into the build agent (using a previous build task).
  23. Once downloaded two files, you have to specify the location of both in the "Signing & Provisioning Section".
  24. ![iOS Build Step 1](images/ios-build-step1.png)
  25. ### Copy generated files to output folder
  26. Add a "Copy files" task with following configuration:
  27. 1. `src/Mobile/eShopOnContainers/eShopOnContainers.iOS/bin/iPhone/$(BuildConfiguration)` in "Source Folder"
  28. 2. `**/*.ipa` in "Contents"
  29. 3. `$(Build.ArtifactStagingDirectory)` in "Target Folder"
  30. 4. Ensure that "Clean Target folder" (under "Advanced" section) is checked
  31. This way we copy the generated IPA in the _Build.ArtifactStagingDirectory_ folder (and remove any previous IPA generated by a previous build).
  32. ![iOS Build Step 2](images/ios-build-step2.png)
  33. ### Publishing build artifact
  34. Add a "Publish Build Artifacts" task, with following configuration:
  35. 1. `$(Build.ArtifactStagingDirectory)` in "Path to publish"
  36. 2. `drop` in "Artifact Name"
  37. 3. `Server` in "Artifact Type"
  38. ![Android Build Step 3](images/ios-build-step3.png)