Signing Qt applications for Mac OS X 10.9.5 and 10.10

I have written previously about signing Qt applications for Mac OS X. It all worked fine until I upgraded to Mac OS X 10.9.5, which broke my signing script. Those Apple chaps do love to break stuff. Grrr.

The problem appears to be that the directory structure of the app bundle has changed and the Qt4 macdeployqt command does not conform to the new layout (I believe this is also the case for Qt5). Oh joy. I managed to work out how to get it working again after a bit of digging around. The good news is that Apple have also made the codesign command easier with a --deep option to traverse and sign the whole bundle in a single command. About time.

So here is the basic process to build and sign your Qt .app on the latest versions of Mac OS X:

# deploy Qt frameworks into .app bundle
$QTDIR/bin/macdeployqt .app -verbose=1
# optionally delete unwanted framework and plugin folders, e.g.:
# rm -f -r <your_app>.app/Contents/Frameworks/QtDeclarative.framework
# rm -f -r <your_app>.app/Contents/PlugIns/sqldrivers
# correct .app bundle structure
python rebundle.py $QTDIR <your_app>.app
# sign .app bundle (including frameworks and plugins)
codesign --deep --force --verify --verbose --sign "Developer ID Application: " .app
# the 2 lines below are just for verification/diagnostics
otool -L <your_app>.app/Contents/MacOS/<your_app>
codesign --verify --verbose=4 <your_app>.app

(Sorry about the small font, but I wanted to avoid confusing line wraps).

I then invoke DropDmg to create a .dmg image file complete with licence and background image. This is all stuck it all in a bash script, which I can pretty much forget about it (until Apple break something else).

In the above rebundle.py is a Python script  written by some public spirited individual that can be downloaded from github (thank you, ‘kingcheez’). Note that you can just find and replace all the ‘5’ characters in the script by ‘4’ if you are still using Qt4.

The first time I ran my script I ended up with a whopping 50MB .app file. It turns out that the cp -r commands in my script don’t preserve symbolic links. So you end up with 3 copies of each framework library. You can avoid this by using cp -R instead.

On the subject of signing for Mac, Apple recently sent out an email stating:

Signatures created with OS X Mountain Lion 10.8.5 or earlier (v1 signatures) will be obsoleted and Gatekeeper will no longer recognize them. Users may receive a Gatekeeper warning and will need to exempt your app to continue using it. To ensure your apps will run without warning on updated versions of OS X, they must be signed on OS X Mavericks 10.9 or later (v2 signatures). … Apps signed with v2 signatures will work on older versions of OS X.

So you are going to have to start signing using 10.9, whether you like it or not.

** Update **

The Python script has gone from github. There was no licensing information or contact information in the script and it was published on the web. So I am assuming it was intended to be public domain (please contact me if you know otherwise). I have put a copy here. You can just find and replace ‘4’ with ‘5’ if you are using Qt 5.

“Wrong Way” Corrigan

While on holiday in Ireland I came across the wonderful story of “Wrong Way” Corrigan. Here is a summary from history.com :

Eleven years earlier, American Charles A. Lindbergh had become an international celebrity with his solo nonstop flight across the Atlantic. Corrigan was among the mechanics who had worked on Lindbergh’s Spirit of St. Louis aircraft, but that mere footnote in the history of flight was not enough for the Texas-born aviator. In 1938, he bought a 1929 Curtiss Robin aircraft off a trash heap, rebuilt it, and modified it for long-distance flight. In July 1938, Corrigan piloted the single-engine plane nonstop from California to New York. Although the transcontinental flight was far from unprecedented, Corrigan received national attention simply because the press was amazed that his rattletrap aircraft had survived the journey.

Almost immediately after arriving in New York, he filed plans for a transatlantic flight, but aviation authorities deemed it a suicide flight, and he was promptly denied. Instead, they would allow Corrigan to fly back to the West Coast, and on July 17 he took off from Floyd Bennett field, ostentatiously pointed west. However, a few minutes later, he made a 180-degree turn and vanished into a cloud bank to the puzzlement of a few onlookers.

Twenty-eight hours later, Corrigan landed his plane in Dublin, Ireland, stepped out of his plane, and exclaimed, “Just got in from New York. Where am I?” He claimed that he lost his direction in the clouds and that his compass had malfunctioned. The authorities didn’t buy the story and suspended his license, but Corrigan stuck to it to the amusement of the public on both sides of the Atlantic. By the time “Wrong Way” Corrigan and his crated plane returned to New York by ship, his license suspension had been lifted, he was a national celebrity, and a mob of autograph seekers met him on the gangway.

Sometimes it is better to hope for forgiveness than to ask for permission.

2 Million Hits!

This blog just passed 2 million hits since I started back in the dim and distant Internet past of 2007 with How much money will my software make (and what has that got to do with aliens)?. Wow.

I haven’t been posting much recently, but I haven’t given up either.  Watch this space. Until then, here are the top 10 blog posts to date:

Post Hits
The software awards scam 265,427
Lessons learned from 13 failed software
products
82,088
10 things non-technical users don’t
understand about your software
78,561
Your harddrive *will* fail – it’s just a
question of when
54,775
Where I program 53,910
If you aren’t embarrassed by v1.0 you didn’t
release it early enough
41,531
SWREG customers beware 36,691
The 1% fallacy 35,327
The world’s fastest Rubik cube solver is
made from Lego!
30,662
The brutal truth about marketing your
software product
29,104

Are you wasting your AdWords budget on in-app ads?

2 out of the last 3 AdWords campaigns I have looked at for consulting customers were spending substantial amounts of money on worthless in-app ads, without even realising it. Feast your eyes on the following:

in-app placement ads$1,071.04 spent on clicks from a single game app, that resulted in 0 trials of the software product being advertised. Hardly surprising given that it was a B2B app that cost around $1000. On further investigation this company was spending a substantial percentage of its AdWords budget on completely useless clicks from in-app ads. Ouch.

And this is from a different AdWords account for another B2B software company:

in-app display ads

Many of the apps in the iOS and Android app stores are now funded by in-app advertising. The creator of the infamous Flappy Bird game claimed to be making tens of thousands of dollars per day like this.

Flappy Bird In-App ads

(Note that the ad shown in the screenshot is not related to either of the two companies I mentioned above).

At least the ad is well away from the ‘play’ button. Some, less scrupulous, app makers place the ad in such a way that it is easy to accidentally click on it.

Who would want to pay for in-app ads, knowing that most of the traffic will be accidental clicks from frustrated gamers (many of them children) just trying to get to the next screen? If you run ads on the Google display (content) network, it might be YOU. Google started showing display ads in apps some time ago and it seems that all existing display campaigns were automatically opted in. Worse still, the apps they are advertising in appear to have no relevance at all to your content campaign keywords.

App makers get some money, the public gets free apps and Google makes mega bucks. The advertiser is financing the whole thing and getting (in many cases) nothing in return. But don’t feel too smug. If you have a display campaign that you aren’t carefully monitoring, you might also be throwing away money. To find out:

  • Log in adwords.google.com.
  • Click on All online campaigns.
  • Choose a sensible time frame, e.g. the last 6 months.
  • Click on the Display network tab.
  • Click on Placements.
  • Click on the Cost column to order from highest to lowest cost.
  • Look down the Placement column for entries that start with Mobile App.

Adwords display placements report

While you are there, it is also worth checking the relevance to your product of the other sites you are running display ads on.

Hopefully no horror story awaits you. If it does, you can exclude the offending placements to stop your ads appearing there again.

exclude AdWords placement

But this is a bit like playing whack-a-mole, as you will be continually excluding new apps (I haven’t found a way to opt out of in-app ads wholesale). Alternatively, just pause your display campaigns. Personally I gave up on display ads some time ago. The conversion ratios were so miserable (much lower than search ads) that I could never make any money on them.

If you have been stung for hundreds or thousands of dollars, it may be worth complaining to Google, to see if you can get any money back on the grounds:

  • You never explicitly opted in to in-app ads.
  • The apps your ads appear in bear no relationship to the search terms in your content campaign.

I have no idea if that will be successful, but it might be worth a try.

Google are continually changing the rules of the AdWords game and you would be naive to assume they are doing so with your best interests at heart. If you are running an AdWords campaign you must monitor it continuously or bad things will happen.

Related articles:

Why have my sales dropped?

why have my sales dropped?If you spend as much time as I do hanging around forums for independent developers, you will often see questions of the form “I only made X sales today/this week/this month, has something gone wrong?”. There are two distinct possibilities:

  1. Something has changed (e.g. your website is broken); or
  2. It’s a statistical fluctuation.

Rather than guessing, we can use some stats to work out the probability that a drop in sales is just a random fluctuation.

The Poisson distribution gives us the probability of a given number of discrete events occurring in a fixed interval of time (or space), if these events occur with a known average rate and independently of each other. It can be used to investigate the accuracy of v1 flying bombs, the number of 19th century Prussian soldiers kicked to death by horses and the number of South Africans attacked by sharks. It can also be used to calculate the probability of getting <= n sales per day/week/month, if we average N sales per day/week/month.

Poisson distribution

A comparison between the number of PerfectTablePlan sales per day over 90 days (blue histogram) vs predicted by the Poisson distribution (red histogram). We would expect the prediction to become more accurate with more data, assuming nothing else changes. Obviously things do change over the lifetime of a software product, hence the relatively short time span chosen.

Using this online Poisson distribution calculator we can work out some example probabilities:

expected
number of sales
over period
Probability of drop in sales of: 5 10 50 100
>= 20% 44% 33.3% 8.6% 2.3%
>= 40% 26.5% 13% 0.2% 0%
>= 60% 12.5% 2.9% 0% 0%
 = 100% 0.7% 0% 0% 0%

(0% = too small for the calculator to display)

For example:

  • If we average 5 sales per week, the chance of a 40% or more drop in sales (i.e. a week with 3 or less sales) is 26.5%.
  • If we average 50 sales per week, the chance of a 40% or more drop in sales (i.e. a week with 30 or less sales) is 0.2%.

So the less sales we make (or the shorter the period we look at), the bigger the random fluctuations we can expect. If I was averaging 5 sales per week, I wouldn’t be too worried about a drop of 40% in sales for one week. In fact, I would expect it to happen approximately one week in every 4 (running a business that averages 5 big B2B sales a year, must be very stressful!). But if I was making 50 sales per week, a 40% drop in sales should only happen by chance approximately once every 10 years. I would definitely check for other causes.

Assuming it isn’t just a statistical blip, the most likely cause of non-random change is an issue with your website. Rather than waiting for a problem, I suggest you set up continuous monitoring that emails or SMSs you if a problem occurs. There are various services for this. I use free pingdom.com and siteuptime.com accounts. Using 2 different services protects you against one of them silently failing.

If your website is up, what else have you changed recently? Check your analytics for changes and your Google webmaster tools account for warnings. Has traffic dropped (perhaps you been slapped by Google)? Has the number of downloads/trials dropped while the traffic stayed the same (perhaps there is a problem with downloading/signing up)? If you have made a new release, double check there are no major bugs in the installer or software. “It works on my development machine” doesn’t cut it with customers, so check it on a non-development machine or a clean VM.

Don’t assume that random strangers on the Internet will email you to tell you that something is broken. Perhaps 1 in a hundred or a thousand will. The rest will just click the back button. You can improve your odds by having loyal and engaged customers and a clearly displayed email address and/or phone number. But still don’t depend on it. When is the last time you noticed an issue on a website and took the time to report it?

Also some seasonal variation in sales is likely. The pattern depends on your market. Many businesses see a drop in sales in the northern hemisphere summer. But my wedding table plan software sells better in the summer. Hopefully you will know the pattern for your product after a year or two.

Random fluctuations and the lack of visitors to report issues means that it is hardest to tell whether a drop in sales is real when you start out. This is  when you need the sales most, both financially and emotionally. It gets easier as your traffic and sales improves. No one said that life was fair.

Training course update

I ran my second ‘Start your own software business’ course over the weekend of 22/23 March. Here is what some of the attendees had to say:

“I thought I knew most things about setting up and running an ISV but Andy filled in all the gaps and taught me stuff I hadn’t even thought about! I would, without hesitation, recommend this course (which is great value) to anyone thinking of starting a small software company or even an existing company that wants to ensure they give their business the best chance for success. Well done Andy!”
Anonymous (gainfully employed)

Roger Pearson“PC Pro magazine (not easy to impress) gave PerfectTablePlan a glowing review. That gives you some idea of Andy’s talent for programming and marketing. His weekend training program allows the attendees to garner his expertise for themselves and their software projects. Andy knows his subject – his experience is extensive, practical and hard-earned. I have run 2 successful small software business in the past. By attending his course I wanted to find out from someone who was actually doing it today, how I could apply techniques and best practice to my next software project. Did I succeed? Without a doubt. Andy was meticulous in his planning of the event and thorough in his presentation. I couldn’t ask for more. Top marks. I recommend Andy’s course to anyone venturing into the world of running a small software business.”
Roger Pearson

Derek Ekins“I recently attended Andy Brice’s “Start your own software business” course. Andy teaches some very practical skills to evaluate your idea, find if there is a market and launch your product. Behind most of the topics Andy had a story of how this particular lesson was learnt and how he has successfully implemented it. I now feel I am equipped with some practical knowledge of how to launch a software product. Thanks Andy.”
Derek Ekins

I will be following all their progress with interest.

I hope to run the course again in 2014. If you are interested in attending, please fill in the form on the training page.

Twitter Demographics Are Bullshit

twitter demographicsI have been experimenting a bit with promoting my software using promoted tweets. You can target people based on their interests or the Twitter handles they follow. I have chosen the latter approach with the aim of getting people to a) click through to my website and b) retweet (in the hope of more click throughs).

The results haven’t been great, with only 25% of the ‘engagements’ I paid for resulting in clicks through to my website. Here is a direct comparison between traffic from AdWords and Twitter ads to my seating planner software website (data from Google Analytics).

AdWords search
campaign
Twitter sponsored
tweet
Bounce rate 43% 78%
Av. pages visited 3.10 1.48
Av. time on site 1:51 0:40

Ouch. Then factor in that the Twitter traffic cost me 2.5 times as much per click through as the AdWords traffic. Double ouch. But that’s fine. You have do lots of experiments to find out what works. Most of them won’t be successful. This experiment only cost me £150.

However I was a bit puzzled by the ‘interests’ report from Twitter. Here are the top 10 ‘interests’ of the people that were shown my sponsored tweet, as reported by Twitter ads.

twitter demographicsBear in mind that I was targeting various Twitter handles related to the events and wedding industry for Twitter users in the UK, USA and Canada. According to the report:

  • 72% of them are interested in ‘Politics’.
  • 69% of them are interested in ‘Hip hop and rap’.
  • 62% of them are interested in  ‘NFL football’.
  • ‘Weddings’ is way down the list at number 55 with 15%, between ‘Leadership’ and ‘Dogs’.

Hmm, something is a bit fishy here.

I ran some more campaigns to promote my UK training course for people who want to create commercial software products. The ticket price for my course is higher than for my seating planner software, so I thought it was worth persevering a bit more with Twitter ads. Here are the top 10 ‘interests’ for the 3 campaigns I ran.

twitter demographics twitter demographics twitter demographicsBear in mind that this time, I was targeting various Twitter handles related to software development, marketing and entrepreneurship for Twitter users in the UK. We love our comedy in the UK and most of us could stand to lose a few pounds. But I can confidently state that the vast majority of people in the UK know almost nothing about NFL (American) football and care even less. ‘Computer programming’ and ‘Startups’ were waaay down all 3 lists.

Twitters says:

We infer interest from a variety of signals, like the accounts users follow and the Tweets they engage with.

I emailed them to point out that the interests seemed to be highly suspect, but I didn’t a substantive reply.

I can only conclude that either Twitter isn’t doing a very good job of the targeting or (more likely) it really doesn’t understand the interests of its customers and is doing a very poor job at guessing. Consequently I would urge you to be very wary of paying for promoted tweets on the basis of ‘interests’.