Linux Format logo

Linux on your iPhone

So, it's April Fool's day again, and this time I came up with quite a nice joke. Sadly, things haven't worked out, so I figured I'd tell you what I had planned so at least you know that I tried!

As an April Fool's joke, I created a fake Linux app for the iPhone that made it look like Linux was running on your phone. It doesn't actually do anything - when you type text, it just spits out one of several pre-determined responses, but there are various geeky in-jokes for people in the know. The idea was that you'd buy it knowing it was fake (it was made very clear in the app description), then show it to your Linuxy friends, say "hey, I installed Linux on my iPhone!" and see how long it took for them to figure out it was a joke.

Sadly, Apple rejected the app for various reasons. First, they said that people might see the warning messages and think their iPhone had crashed. To be fair, the original version of the app showed this screen after trying to run X:

iPhone Linux - broken X server

So, even though the app was called "Fake Linux" and it was pretty clear that it was just a joke, I added a big warning screen to the front re-assuring people that everything they saw within the app was just a joke and was nothing to worry about. When you tapped it, the app would wait a few seconds so you could walk to your colleague's desk, then run as normal. It looked like this:

iPhone Linux - it's just a simulation!

It's just a joke. It's just a game. It's just a simulation. It's not real. Good enough? No - it was rejected again, for the same reason - people might see the error messages and think they are real. The splash screen? "The splash screen is not relevant," said Apple. Still, at least they were polite enough to call me and explain.

The next stop for me was to do a search and replace for the word "error" and replace it to "notice" - I decided that even "warning" was a bit risky given Apple's kid gloves approach to users. I also changed the "broken X" picture to be a welcome screen, so it now looked like this:

iPhone Linux - welcome!

So: no mention at all of warnings, errors or similar. It's now just a simple app that prints text responding to what you type. Surely that would be enough? No. This time, Apple gave a pretty final rejection, again by phone, saying "it emulates Linux... that's not something we would accept."

Putting aside for a moment the fact that they could have told me that four weeks ago, I have a pretty fundamental issue with this response from Apple: Fake Linux doesn't emulate Linux at all. All it does is read the text that comes in, and prints some text that looks appropriate. It doesn't run any commands. It doesn't do anything other than print out text. Yes, it has some stupid geeky jokes in there that poke fun at some of Linux's more common flaws: PulseAudio fails to run; X doesn't work; Emacs crashes with an out-of-memory error; and so on. But these are all quite innocent.

To give you an idea of how it works, here's an actual chunk of the source code:

if (ArrayStartsWithString(parts, @"sudo")) {
	if ([parts count] == 1) {
		AddHistoryLine(@"usage: sudo [-n] -h | -K | -k | -L | -V | -v");
		AddHistoryLine(@"usage: sudo -l[l] [-AnS] [-g groupname|#gid] [-U username] [-u username|#uid] [-g groupname|#gid] [command]");
		AddHistoryLine(@"usage: sudo [-AbEHnPS] [-C fd] [-g groupname|#gid] [-p prompt] [-u username|#uid] [-g groupname|#gid] [VAR=value] [-i|-s] []");
		AddHistoryLine(@"usage: sudo -e [-AnS] [-C fd] [-g groupname|#gid] [-p prompt] [-u username|#uid] file ...");				
	} else {
		// remove the sudo part and run the command as per normal
		[parts removeObjectAtIndex:0];
	}
}

if (ArrayStartsWithString(parts, @"ls")) {
	if (([command compare:@"ls -l"] == NSOrderedSame) || ([command compare:@"ls -ls"] == NSOrderedSame) || ([command compare:@"ls -lsh"] == NSOrderedSame)) {
		AddHistoryLine(@"-r--r--r-- 1 root root   512  2010-03-01 18:07 README");
	} else if ([command compare:@"ls -a"] == NSOrderedSame) {
		AddHistoryLine(@".");
		AddHistoryLine(@"..");
		AddHistoryLine(@"README");			
	} else if ([command compare:@"ls -la"] == NSOrderedSame) {
		AddHistoryLine(@"drwxr-xr-x 33 root root  4096  2010-03-01 18:07 .");
		AddHistoryLine(@"drwxr-xr-x 3 root root   4096  2010-03-01 18:07 ..");
		AddHistoryLine(@"-r--r--r-- 1 root root   512   2010-03-01 18:07 README");	
	} else {
		AddHistoryLine(@"README");
	}
} else if (ArrayStartsWithString(parts, @"uname")) {
	if ([parts count] == 1) {
		AddHistoryLine(@"Linux");
	} else {
		AddHistoryLine(@"Linux iPhone 2.6.32 #53-iPhone SMP Tue Dec 8 04:01:29 UTC 2009 ARMv7 GNU/Linux");
	}
} else if ([command compare:@"pwd"] == NSOrderedSame) {
	AddHistoryLine(@"/root");
// and so on...

Yes, it's just a load of "if" statements that read what was typed and print out messages.

And, because it's April 1st and people probably think this is some sort of cunning meta-April-fools thing, here's a video of the app running on the iPhone Simulator:

 

Am I upset? A little, but it's OK - if you want to release on the App Store, you have to play by Apple's rules, even when those rules seem a little crazy. And Apple has managed to sell quite a few copies of my iPhone game, Brain Party (which is now open source! for Linux users!), so I can't really complain too much - I just wish they'd lighten up a bit!


Your comments

Google

Put it on the Google Marketplace! Oh... wait...

You were surprised...

that Apple rejected it?

Schame on Apple

Nice joke, lame that they've refused it :(

Geek

Well! I'd buy that for sure if you had luck with iTunes store ..

Source

Would you be willing to release the source for those with the SDK? I would like to trick a few people :)

Nice joke

Nice joke. Now you know the difference between open and closed systems. You cannot make fun of the latter.

Can't you just release it

Can't you just release it for jailbroken devices?

Other way

Next year can we have this for Android... oh... wait...

Why don't you just make it

Why don't you just make it web-based? I see no need for it to be an app.

But but!!!!!!! Why don't you

But but!!!!!!!
Why don't you make app for open-source OS? Like Android? :(

Puritans in Cupertino

Maybe they looked at the source code and confused the curly brackets with boobies...

To be expected

When they say that "it emulates Linux" - it is enough that it emulates the look, feel and a few commands of a Linux terminal.

I see at least two reasons for which that "look and feel emulation" wouldn't be acceptable for Apple:
- Even as a joke, it could be used as free publicity for Linux - "here are examples of what one can do with Linux - I only have my iPhone, and it's only text here, but I'll show you more on my computer if you're curious"
- If someone hides that it is a joke (once it is on the AppStore, you cannot control how people use it), it could send wrong signals about the "hackability" of the iPhone, thus encouraging more people to try it.

You could argue that the concerns for these arguments are unfounded, but that's Apple we're dealing with - an organization that rejected a book on the iPhone (in its iPhone app form) because it mentioned jailbreaking: any suggestion, even as a joke, that the iPhone is even slightly hackable is unwelcome by their standards.

@ Android

"Why don't you make app for open-source OS? Like Android? :("

Android IS Linux. There's no real fooling people there.

it's so funny how things

it's so funny how things changed last years look at the presentation of mac os x in 2000 http://www.youtube.com/watch?v=Ko4V3G4NqII
when stevo told everybody "DARWIN IS VERY LINUX-LIKE" now the L word is a bad word

Typical

I'm no fan of MS, but honestly... if they decided that every Windows Mobile app had to be approved by them and sold via their store, people would be throwing briKs through the plate glass in Redmond. Apple displays behavior that's 10 times more consumer-unfriendly and everyone shrugs and says, "Well, that's Apple". IMO, if you're really pro-Open Source, Apple should be the last company you buy anything from. Well, except maybe for SCO.

Brilliant!

Nice work! Too bad it wasn't accepted.

What do you expect!

Apple is a joke, too locked down and stupid to deal with, Droid does what Apple can't / won't haha...

Why anyone enjoys locked down garbage iHave no idea...

Maybe since their devices are made in china, they think they have to have the same mentality as the gov there...

my jailbroken iphone does all that and more

i agree with a few post, apple is getting pretty bad they reject 10's of thousands of apps. i read they rejected a ton of sex app and they should but they let the swim suit issue and playboy put an app. it is all about dollars for them. your app wasn't going to make them much money is what it came too, and i am sure linux was the other part.

This is the reason I went

This is the reason I went with a Droid and rooted it... If someone would trade me an iPhone and $1,000 for my phone I would say no thanks to the offer because I love my phone too much lol

Why not make this code open source

Why don't you release this app's code as open source for people who have Xcode, I would be very grateful

HI

Even though this is an old post and my comment may never be read, I think that you should release this app so that people such as myself with a Mac and the iPhone SDK can load this onto their devices, you could just create a compressed .zip archive and then place a download link

Just a suggestion

Why don't you make a copy on cydia and on android that'll be great by the way i have a jailbroken ipod 4th gen



Web hosting by UKFast