A quick hack to measure iPhone OS distribution
I haven’t posted here in a while, since I have been so busy building new stuff. Some updates are expected soon (iPhone Layar anyone?)
Since most of the projects I’m working on involve iPhones in some way, I was interested in OS distribution on the iPhone platform: Is it still necessary to target OS 2.xx, or has 3.xx have enough uptake?
Since the iPhone sends it’s OS version in every web request it does, I decided to have a look at my own logfiles (in the hope that bigger apps will follow
).
I do realise this isn’t a scientific valid result: It’s just the distribution of one, quite recent, app. However, it does say something. So, without further ado, I present the results:
| OS: | 3_0_1 | 68% |
| OS: | 3_0 | 20% |
| OS: | 2_2 | 1% |
| OS: | 2_2_1 | 3% |
| OS: | 3_1 | 9% |
From this small sample, 4% didn’t already run 3.xx (it might help that this is an iPhone only app: iPod Touches apparently are updated less).
Since this is only taken from a small sample, I hope bigger apps will release their stats. Here is the small PHP code I used:
<?
define("LOGFILE","/home/panman/logs/prod.panman.nl_access_log");
$lines=file(LOGFILE);
foreach ($lines as $line){
if (!eregi("stufidates",$line)) {continue;}
//if ($i==0) {echo $line;}
$parts=explode(" ",$line);
if ($parts[12]!="(iPhone;"){
$detects["noip"]++;
} else {
$os=$parts["17"];
$detects[$os]++;
}
$i++;
}
echo "<table width=500>";
foreach ($detects as $key=>$hits){
echo "<tr><td>OS:</td><td>".$key."</td><td>".number_format(($hits/$i)*100)."%</td></tr>";
}
echo "</table>";
echo "Total:".$i;
?>
If you have an iphone app that does requests to your webserver, please run this code (or something similar, it’s just a first version) on your logs, and let me know the results.
Interesting Martijn, can you tell us something about the period these stats are from?
The numbers posted above are from last week. I’ll update the post with some older numbers in a bit.
Here is the analysis over a longer time period: Roughly last month:
OS: 3_0_1 Hits:1314 70%
OS: 3_0 Hits:453 24%
OS: 2_2 Hits:17 1%
OS: 2_2_1 Hits:37 2%
OS: 3_1 Hits:61 3%
OS: noip Hits:6 0%
OS: - Hits:2 0%