{"id":32052,"date":"2017-06-16T11:22:04","date_gmt":"2017-06-16T18:22:04","guid":{"rendered":"https:\/\/blog.xamarin.com\/?p=32052"},"modified":"2019-04-04T08:29:25","modified_gmt":"2019-04-04T15:29:25","slug":"easy-ios-app-provisioning-fastlane-visual-studio-mac","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/xamarin\/easy-ios-app-provisioning-fastlane-visual-studio-mac\/","title":{"rendered":"Easy iOS App Provisioning with Fastlane and Visual Studio for Mac"},"content":{"rendered":"<p>iOS developers know that app and device provisioning is a huge pain. Just to deploy an iOS app to a device for the first time, you must request a development certificate, generate a signing key, add a device in the Apple Developer Center, and create a development provisioning profile for the app that includes your device in the list of approved devices to deploy to. That was a mouthful.<\/p>\n<p>We wanted to make it as easy as possible for you to get started with iOS development by streamlining this key pain point of app and device provisioning. Visual Studio for Mac now integrates with the open source project <a href=\"https:\/\/fastlane.tools\/\">fastlane<\/a>, which was created to simplify the app provisioning process from app and device provisioning to team provisioning management. In this blog post, you&#8217;ll learn how to quickly provision a new device and app in less than five minutes with the click of a few buttons.<\/p>\n<h2>Easy Provisioning with Fastlane<\/h2>\n<p>The fastlane toolchain has been integrated into Visual Studio for Mac version 7.1. To access these features, simply <a href=\"https:\/\/developer.xamarin.com\/recipes\/cross-platform\/ide\/change_updates_channel\/#xamarinstudio\">change the updater channel<\/a> to Stable. <a href=\"https:\/\/developer.xamarin.com\/guides\/ios\/deployment,_testing,_and_metrics\/provisioning\/fastlane\/#Installation\">Install fastlane from GitHub<\/a> with HomeBrew, the installer script, or via Rubygems. To provision your apps, you&#8217;ll need to be a member of the <a href=\"https:\/\/developer.apple.com\/programs\/\">Apple Developer Program<\/a>.<\/p>\n<h3>File -&gt; New Project<\/h3>\n<p>The best time to provision apps is at creation, so we&#8217;ve integrated fastlane directly into our File -&gt; New Project wizard in order to ensure every app you create is properly provisioned. In Visual Studio for Mac, select <strong>File -&gt; New Project -&gt; iOS -&gt; Single View App<\/strong>. Click <strong>Add Team<\/strong>. <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/44\/2019\/03\/1.AddTeam.png\" alt=\"File -&gt; New Project dialog where you can now add an iOS developer team.\" width=\"721\" height=\"523.5\" class=\"aligncenter size-full wp-image-32090\" \/><\/p>\n<p>The Apple Developer Accounts tab within the Preferences window will appear. This is where you can manage all of your developer accounts across all of the apps you&#8217;re working on. Click the <strong>+<\/strong> icon to add your account. Enter your Apple ID and password to enable Fastlane to integrate with your iOS developer account.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/44\/2019\/03\/2.SignIn.png\" alt=\"Sign into your Apple Developer Account using fastlane from Visual Studio for Mac.\" width=\"768\" height=\"614\" class=\"aligncenter size-full wp-image-32092\" \/><\/p>\n<p>From this dialog, you can create certificates and manage provisioning profiles for all teams you&#8217;re a member of. Click <strong>OK<\/strong> and return to the File -&gt; New dialog. Select your team from the dropdown, click <strong>Next<\/strong>, and click <strong>Create<\/strong>.<\/p>\n<h3>Create a Signing Identity<\/h3>\n<p>Right-click the iOS app you&#8217;ve just created, and select <strong>Options -&gt; iOS Bundle Signing<\/strong>. The team you selected during the File -&gt; New Project wizard is automatically set as the default team. Next to the <strong>Signing Identity<\/strong> heading, click the dropdown, and select <strong>Create signing identity<\/strong>. This automatically creates a new signing identity for you and associates it with your Apple developer account.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/44\/2019\/03\/image.png\" alt=\"Generating a signing identity with fastlane and Visual Studio for Mac.\" width=\"722\" height=\"233\" class=\"aligncenter size-full wp-image-32117\" \/><\/p>\n<p>It&#8217;s worth noting that all setup up until this point only needs to be done once per Visual Studio for Mac installation.<\/p>\n<h3>Create a Provisioning Profile<\/h3>\n<p>Now that we have a signing identity, it&#8217;s time to create a provisioning profile for your app. In the <strong>iOS Bundle Signing<\/strong> tab, select the <strong>Provisioning Profile<\/strong> dropdown and click <strong>Create provisioning profile<\/strong>. In less than ten seconds, we have successfully provisioned our new app.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/44\/2019\/03\/Provitioning1.png\" alt=\"iOS app provisioning in Visual Studio for Mac.\" width=\"719\" height=\"103\" class=\"aligncenter size-full wp-image-32109\" \/><\/p>\n<h3>Provision a Device<\/h3>\n<p>To be able to deploy to a device, we must provision the device and &#8220;attach&#8221; it to the provisioning profile we just created. Normally, we would go to the Apple Developer Portal to do this, but Visual Studio for Mac provides a way to provision new devices directly within the IDE.<\/p>\n<p>Plug your device into your Mac via the Lightning to USB cable. If the device attached is not associated with the provisioning profile selected, Visual Studio for Mac will suggest you provision the device. Click <strong>Register<\/strong>, followed by <strong>Add<\/strong>, and Visual Studio for Mac will add the device to your Apple developer account and associate it with the selected provisioning profile.<\/p>\n<h3>In Action<\/h3>\n<p>For a full breakdown of provisioning profiles and to see the fastlane integration in action checkout <a href=\"http:\/\/xamarinshow.com\">The Xamarin Show<\/a> on Channel 9 with James and Oleg from the Xamarin team:<\/p>\n<p><iframe src=\"https:\/\/channel9.msdn.com\/Shows\/XamarinShow\/Episode-29-Simple-iOS-Provisioning-with-fastlane\/player\" width=\"640\" height=\"360\" allowFullScreen frameBorder=\"0\"><\/iframe><\/p>\n<h3>What&#8217;s Next?<\/h3>\n<p>In this blog post, we successfully generated a development provisioning profile for a new app. Publishing iOS apps (either Ad Hoc for testing or for release in the App Store) requires a separate distribution certificate and provisioning profile. Now in Visual Studio for Mac version 7.1, you can easily create distribution signing identities for use in your app publishing workflow without leaving the IDE: <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/44\/2019\/03\/Publishing-Workflow.png\" alt=\"Publishing workflow with Fastlane.\" width=\"836\" height=\"450\" class=\"aligncenter size-full wp-image-32119\" \/><\/p>\n<h2>Wrapping Up<\/h2>\n<p>Visual Studio for Mac&#8217;s Fastlane integration makes it super easy for you to provision apps and devices directly from the IDE with just a few clicks. For more information, read our documentation on <a href=\"https:\/\/developer.xamarin.com\/guides\/ios\/deployment,_testing,_and_metrics\/provisioning\/fastlane\/\">using the Fastlane tools with Xamarin<\/a>. In the future, we will be working to bring easy app and device provisioning to Visual Studio on Windows and continue to integrate additional features of Fastlane directly into the IDE.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>iOS developers know that app and device provisioning is a huge pain. Just to deploy an iOS app to a device for the first time, you must request a development certificate, generate a signing key, add a device in the Apple Developer Center, and create a development provisioning profile for the app that includes your [&hellip;]<\/p>\n","protected":false},"author":546,"featured_media":32119,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[2],"tags":[6],"class_list":["post-32052","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-developers","tag-ios"],"acf":[],"blog_post_summary":"<p>iOS developers know that app and device provisioning is a huge pain. Just to deploy an iOS app to a device for the first time, you must request a development certificate, generate a signing key, add a device in the Apple Developer Center, and create a development provisioning profile for the app that includes your [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/posts\/32052","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/users\/546"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/comments?post=32052"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/posts\/32052\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/media?parent=32052"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/categories?post=32052"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/tags?post=32052"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}