Home > Uncategorized > Submitting my first Mac OS X app to the mac app store using #Xamarin

Submitting my first Mac OS X app to the mac app store using #Xamarin

Writing an app is one thing, but publicising and selling it is where the real upside is for a developer. I recently discovered that Xamarin allows you to develop Mac desktop apps. Which got me interested, since I’m a seasoned .NET developer, and thought that it seemed easier than learning objective C (although I should…).

I’ve written plenty of PhoneGap (Cordova) apps, which are basically HTML apps, and I thought that I could really easily port a phone gap app across to objective C, once I could embed a WebView (WebBrowser control) into an Mac OS X app. So, kicking off Xamarin studio, I created a basic Cocoa app, and opened the XIB in Xcode, dropped in a webView, and set its auto-resizing  to fill the window. then ctrl-dragged it as an outlet into MainWindow.h

Back to Xamarin Studio, I copied the www folder from the Phonegap project, and set it’s build action to content, I then added the code:

public override void AwakeFromNib ()
        {
            base.AwakeFromNib ();
            // https://github.com/xamarin/macsamples/blob/master/SkinnableApp/MainWindowController.cs
            var htmlPath = Path.Combine (NSBundle.MainBundle.ResourcePath, www/index.html);
            webBrowser.MainFrame.LoadRequest(new NSUrlRequest (new NSUrl (htmlPath)));
        }

which just opens the index.html from the www folder, and loads it into the browser.

I went into Developer.apple.com member centre, and set up a cert, app identifier, and provisioning profile, then into iTunes Connect and set up the app with the same bundle identifier

I clicked on the project > options > Mac application – entered the bundle identifier, pressed enabled entitlements and app sandboxing, set the icon* (By generating an icns file). Then under options > Mac Signing – selected an identity, and then selected custom entitlements as Entitlements.plist.

Editing the Info.Plist file in TextWrangler I had to manually add the keys

<key>MonoBundleExecutable</key>
<string>{ProjectName}.exe</string>
<key>CFBundleExecutable</key>
<string>{ProjectName}</string>

Where {ProjectName} is the name of the project – not literally that string! – This avoids error ITMS-90259 which gives an Invalid Binary error on iTunes connect

I then changed it to release mode, selected Build > Archive for Publishing

Using terminal, I navigated to the output folder, and ran

chmod -R a+rX *

This got rid of an earlier submission error where it was complaining that only the root user had access to certain files.

I then switched to Xcode organiser and submit to app store, selected my provisioning profile, and unchecked “include app symbols”, and submitted. – Once it said uploaded successfully, then I went back into iTunes Connect, selected the build, and filled in the rest of the information, including screenshots. No Icon necessary, it takes it from the Binary, then pressed submit for review….

It’ll probably get rejected, since it’s a very simple game, but lets keep our fingers crossed! 🙂

Screen Shot 2015-06-28 at 05.40.46

Advertisement
Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: