Friday, May 30, 2014

Building and deploying Adhoc iOS app with Xamarin and Visual Studio

Just spent 6 hours this week figure this out. It will help me in the future and may help you too.

I am at heart a Windows developer, working with Xamarin tools and iOS on and off since 2011.
I am not an expert (yet), therefore some of this may be partially correct in terms of name or concept, but I pretty sure it will help you.

I am assuming you already setup a Developer development configuration and therefore you can edit, compile and run you app on your iPhone or iPad (Should probably create a blog post about it, because I barely remember it, though I think it is the same idea of what I am about to describe, a little bit easier).

Distribution


There are 3 type of deployments (also called distribution)
  • Development
  • Adhoc
  • Store
For each distribution you need

On the Mac

  • A certificate registered on the mac with the tool called "Keychain"
    • Tab My Certificates
    • You can create the certificate from the Apple Portal (see link below)
  • A provisioning profile for each specific type of deployment and app
    • You can create the  provisioning profile from the Apple Portal (see link below)
    • You must have the device id of each device you want to test on, selected in your profile. 
      • I generally ask my friends to install the app called "UDID Tool" and email me their device ID, which I register in the Apple portal.
    • When you save your profile add to the filename at the end the type of deployment
      • Development, Adhoc, Store (This will help in the future)
    • XCODE Registration
      • Download the profile on your Mac and double click on it
        • This will register it in XCODE
      • Menu Windows -> Organizer
This link Publishing to the App Store should help. The first time you will not have your Adhoc certificate. The Apple web app will lead you to create one. Go slow it is confusing.

On Visual Studio

You already have your project in DEBUG configuration working.
Make sure your Visual Studio is connected on the mac to the Xamarin.iOS Build Host.
Now open the Properties dialog of your project and switch to the Ad-Hoc mode.
iOS Bundle Signing tab:
  • Select the Identity, which is your registered certificate on the Mac
  • Select the provisioning profile, which is your provisioning profile registered on the Mac for the deployment and the app


iOS IPA Options tab:
  • Make sure the check box "Build ad-hoc/enterprise package" is checked


iOS Application tab:
  • Set you app name
  • Set your identifier with the exact value you used in the provisioning profile
    • I use net.frederictorres.myappname
  • Set the version

Finaly Building The App

  • Click on the Visual Studio BUILD menu and select menu
    • Build Ad-Hoc IPA...
    • On the Mac a dialog may pop up asking you to approve
      • Select Always approve for the future
  • When this done successfully, in the Solution Explorer, Right Click on the app and select the menu
    • Show IPA File on Build Server
    • This will open a finder instance when your IPA is located

Installing on your device

  • Connect the device to the Mac, iTunes should pop up
    • Make sure iTunes is authorized for the device
    • Open the App tab in iTunes, you should see your app
    • Double click on the IPA file
      • It will appear in the UI with an Install button
      • Click the Install button and then the Apply button.

Version

  • Visual Studio 2013 Update 2
  • Xamarin 3.0.54.0

16 comments:

  1. I always like your blog post because you always comes with different ideas and information. I always shared your site post with my friends. Keep posting and i will follow you.
    mobile app development company usa

    ReplyDelete
  2. An interesting post! Thanks for sharing.

    ReplyDelete
  3. Hello my friend! I would like to tell you that this write-up is awesome, great written and include

    almost all important info. I would like to see a lot more articles like this.
    ios application development studio in USA

    ReplyDelete
  4. I’m really amazed with your posting skills as well as with the layout on your blog site. Is this a paid style or did you modify it yourself? Either way keep up the pleasant quality writing, it is rare to see a great site such as this one these days.
    ios application development studio

    ReplyDelete
  5. Hello Frederic, Thanks for the post.
    Do you know if can I create the IPA if on Plattform I have iPhoneSimulator? I developed an app for a company and they don't have on the Provisioning Profile any device. So when I try to build on Ad-Hoc I have the this error: The OutputPath property is not set for project xxx.iOS.csproj. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration='Ad-Hoc' Platform='iPhoneSimulator'.

    Thank you

    ReplyDelete
  6. This was so useful and informative. The article helped me to learn something new. iOS App Development Company in Chennai

    ReplyDelete
  7. Pretty article! I found some useful information in your blog, it was awesome to read, thanks for sharing this great content to my vision, keep sharing..

    Mobile App Development Company in Chennai
    Android app Development Company in Chennai
    ios app development Company in Chennai

    ReplyDelete
  8. It's interesting that many of the bloggers your tips helped to clarify a few things for me as well as giving.. very specific nice content. And tell people specific ways to live their lives.Sometimes you just have to yell at people and give them a good shake to get your point across.
    Mobile App Development Company
    Android app Development Company
    ios app development Company
    Mobile App Development Companies

    ReplyDelete
  9. It's really informative! Thanks for the great article.
    Hvantage Technologies is leading Mobile application development , and Web Development Company in USA offering various integrated IT Services including Ecommerce Solution, SEO Services & Digital Marketing Services.

    ReplyDelete
  10. Nice it seems to be good post... It will get readers engagement on the article since readers engagement plays an vital role in every blog.. i am expecting more updated posts from your hands.
    Mobile App Development Company
    Mobile App Development Company in India
    Android app Development Company
    ios app development Company
    Mobile App Development Companies

    ReplyDelete
  11. Thanks for posting useful information.You have provided an nice article, Thank you very much for this one. And i hope this will be useful for many people.. and i am waiting for your next post keep on updating these kinds of knowledgeable things...Really it was an awesome article...very interesting to read..
    please sharing like this information......
    Android training in chennai
    Ios training in chennai

    ReplyDelete
  12. You have provided an nice article, Thank you very much for this one. And i hope this will be useful for many people.. and i am waiting for your next post keep on updating these kinds of knowledgeable things...

    Mobile App Development Company
    Mobile App Development Company
    Mobile app Development Companies

    ReplyDelete
  13. These ways are very simple and very much useful, as a beginner level these helped me a lot thanks fore sharing these kinds of useful and knowledgeable information.
    Android App Development Company

    ReplyDelete
  14. You have provided an nice article, Thank you very much for this one. And i hope this will be useful for many people.. and i am waiting for your next post keep on updating these kinds of knowledgeable things...

    Android App Development Company

    ReplyDelete
  15. I just want to say that all the information you have given here is awesome...great and nice blog thanks sharing..Thank you very much for this one. And i hope this will be useful for many people.. and i am waiting for your next post keep on updating these kinds of knowledgeable things...
    Web Design Development Company
    Web design Company in Chennai
    Web development Company in Chennai

    ReplyDelete
  16. it is really amazing...thanks for sharing....provide more useful information...
    Mobile app development company

    ReplyDelete