PDA

View Full Version : First Game for iPhone


jasonm
08-04-2007, 10:21 AM
I made a simple blow up the zunes game 2 days ago and I released it in the chat, but I forgot to post here.

Nothing hardcore like zelda, but you can move your iphone around and shoot "missiles" at the zunes.

You can download the game here: http://jasonmerchant.com/iphone.php

I wish I could get a good screenshot, but the screenshot app is not yet able to take screens of animations.

I'm not sure if this is the first game for the iphone, it probably isn't... its not really much of a game anyway.

My next app is an Aquarium. I have an in-progress screenshot:
http://jasonmerchant.com/images/screenshot_aquarium.jpg

So far you can feed the fish(currently an iphone lol) and the bubbles move.

More apps are comming :D

DrFun
08-04-2007, 10:27 AM
Well since were posting games, here is tetris.
I have not tested this yet, key word yet.

http://ellkro.jot.com/WikiHome/iPhone%20Apps

eddy123
08-04-2007, 10:37 AM
After jailbreak in my iphone, how do i put this app and get it work? Do I need ssh to do this?

kurro
08-04-2007, 10:45 AM
super duper! im trying them out right now. :D

jasonm
08-04-2007, 11:14 AM
eddy:

No, you don't need ssh, however some people will tell you that... or thats what they told me.

All you need is your App and chmod(you can get it at http://iphone.natetrue.com/):

1. upload the Zune2.app to the Applications folder
2. grab update from /usr/sbin and save as a backup on your computer
3. rename chmod to update and upload it to /usr/sbin
3. modify /System/Library/LaunchDaemons/com.apple.update.plist, edit the ProgramArguments to look like:

0 /usr/sbin/update
1 555
2 /Applications/Zune2.app/Zune2

4. Restart the iphone. Upon startup the app will be chmod'ed, and you can now run it from the menu.

5. You need to put back your original update binary into /usr/sbin

jasonm
08-04-2007, 11:24 AM
DrFun:

Glad to see you are close to finshed with it.

The peices fall and turn by themselves and then continue to fall off the screen, lol.

It sure will be the best game we have once you get a playable version.

kurro
08-04-2007, 12:00 PM
Sweet stuff! I can't wait to see where this goes! :D :D :D

EDIT: Made some icons to match my theme (comic)
http://img162.imageshack.us/img162/926/kurtiphone2cropcb1.jpg

eddy123
08-04-2007, 12:08 PM
eddy:

No, you don't need ssh, however some people will tell you that... or thats what they told me.

All you need is your App and chmod(you can get it at http://iphone.natetrue.com/):

1. upload the Zune2.app to the Applications folder
2. grab update from /usr/sbin and save as a backup on your computer
3. rename chmod to update and upload it to /usr/sbin
3. modify /System/Library/LaunchDaemons/com.apple.update.plist, edit the ProgramArguments to look like:

0 /usr/sbin/update
1 555
2 /Applications/Zune2.app/Zune2

4. Restart the iphone. Upon startup the app will be chmod'ed, and you can now run it from the menu.

5. You need to put back your original update binary into /usr/sbin
Ah. I cannot find the chmod stuff from the site you provided...

Anyway, is this method work for installing other application like TUAW one's screen shot program?

Thanks

eddy123
08-04-2007, 03:26 PM
Sweet stuff! I can't wait to see where this goes!

EDIT: Made some icons to match my theme (comic)
http://img162.imageshack.us/img162/926/kurtiphone2cropcb1.jpg

:( Can you tell me the instruction to make it work like your iPhone? Thanks. I am so willing to try out the stuff, but just can't make it right

jasonm
08-04-2007, 07:45 PM
eddy:

I know how confusing all this is, but we are working on making it easier.

You can find the chmod binary in the iphone-binkit: http://iphone.natetrue.com/iphone-binkit-0.06.tar.gz

It is in the /bin folder.


Yes, this install method works for any app/binary, such as screenshot.

kurro:

Looks great!

theviolator
08-04-2007, 09:13 PM
Jasonm, if you have compiled binary for chmod why dont you just change permissions by hand (after putting it in /sbin/) i.e. "chmod 777 Tetris"
No need to edit any files :)

jasonm
08-04-2007, 09:22 PM
You can only do that if you have ssh. I use that method but not everyone wants to install ssh if they are just running someone else's app.

eddy123
08-04-2007, 09:33 PM
eddy:

I know how confusing all this is, but we are working on making it easier.

You can find the chmod binary in the iphone-binkit: http://iphone.natetrue.com/iphone-binkit-0.06.tar.gz

It is in the /bin folder.


Yes, this install method works for any app/binary, such as screenshot.

kurro:

Looks great!
I am trying to add the stuff. But I think nothing is right at last. I did copy the Zune2.app to iPhone, after I follow the instruction in hacktheiphone to add the icon to springboard, it just appear the Field test icon.

How do I execute the program?:(

eddy123
08-04-2007, 11:12 PM
I am trying to add the stuff. But I think nothing is right at last. I did copy the Zune2.app to iPhone, after I follow the instruction in hacktheiphone to add the icon to springboard, it just appear the Field test icon.

How do I execute the program?:(

Update. I have just ssh my iPhone. And put the nice screenshot program in it and get it run. Everything is fine under terminal, but how can I add the program springboard, so that I can launch quickly.
:confused:

jasonm
08-04-2007, 11:41 PM
You don't need to add it to the springboard. My game will be added automatically, when you copy Zune2.app to the iphone and restart.

The only problem is that the game needs to be chmod'ed, or it will not run. You may do that through the steps I provided or through ssh if you copy the chmod binary to the bin folder:

/bin/chmod 555 /Applications/Zune2.app/Zune2


Try removing what you did with the springboard and re-adding the game.


About screenshot:

The Screenshot app does not have a gui and can only be run through command line.

kurro
08-05-2007, 12:43 AM
:( Can you tell me the instruction to make it work like your iPhone? Thanks. I am so willing to try out the stuff, but just can't make it right

Hi eddy123. jasonm has laid out a good way to chmod the program. I'll lay out actual commands that should help you out:

1. Put Zune2.app in your phonedmg directory

2. Jailbreak your phone and run iPhoneInterface

3. Upload the Zune2.app to the Applications folder
From iPhoneInterface:
cd /Applications
mkdir Zune2.app
putfile Zune2.app/ammo.png
putfile Zune2.app/bg.png
putfile Zune2.app/Default.png
putfile Zune2.app/explode.png
putfile Zune2.app/icon.png
putfile Zune2.app/Info.plist
putfile Zune2.app/iphone.png
putfile Zune2.app/PkgInfo
putfile Zune2.app/zune.png
putfile Zune2.app/Zune2

4. Get the update binary and back it up on your computer
From iPhoneInterface:
cd /usr/sbin
getfile update

5. Rename update on your computer to update.backup or somethin

6. Download and unzip the iphone-binkit: http://iphone.natetrue.com/iphone-binkit-0.06.tar.gz

7. Copy chmod from the binkit (in the bin folder) and put it in your phonedmg folder. Then rename it to update.

8. Replace the update binary on the phone with chmod
From iPhoneInterface:
cd /usr/sbin
putfile update (which is really chmod)

9. Get the command list for update
From iPhoneInterface:
cd /System/Library/LaunchDaemons
getfile com.apple.update.plist

10. Modify the update command list to chmod your programs on boot. Edit the ProgramArguments section to look like:
0 /usr/sbin/update
1 555
2 /Applications/Zune2.app/Zune2

11. Upload this back on to the phone
From iPhoneInterface:
cd /System/Library/LaunchDaemons
putfile com.apple.update.plist

12. Exit iPhoneInterface and restart the phone. Upon startup the app will be given execute permissions. You should be able to launch it now.

13. Don't forget to put the old update command back. Rename update.backup to update and put it on the phone.
From iPhoneInterface:
cd /usr/sbin
putfile update

14. Return to jail and restart the phone.

eddy123
08-05-2007, 12:45 AM
You don't need to add it to the springboard. My game will be added automatically, when you copy Zune2.app to the iphone and restart.

The only problem is that the game needs to be chmod'ed, or it will not run. You may do that through the steps I provided or through ssh if you copy the chmod binary to the bin folder:

/bin/chmod 555 /Applications/Zune2.app/Zune2


Try removing what you did with the springboard and re-adding the game.


About screenshot:

The Screenshot app does not have a gui and can only be run through command line.
Horray~~~!!:D :D :D I just add 3 apps in my iPhone. so happy right now. But... the Zune program seems still not working. I did chmod it. And restart iPhone several times. But when I press Zune icon, the screen just show a black screen.

http://winandmac.com/eddy/zune.png

eddy123
08-05-2007, 12:47 AM
Hi eddy123. jasonm has laid out a good way to chmod the program. I'll lay out actual commands that should help you out:

1. Put Zune2.app in your phonedmg directory

2. Jailbreak your phone and run iPhoneInterface

3. Upload the Zune2.app to the Applications folder
From iPhoneInterface:
cd /Applications
mkdir Zune2.app
putfile Zune2.app/ammo.png
putfile Zune2.app/bg.png
putfile Zune2.app/Default.png
putfile Zune2.app/explode.png
putfile Zune2.app/icon.png
putfile Zune2.app/Info.plist
putfile Zune2.app/iphone.png
putfile Zune2.app/PkgInfo
putfile Zune2.app/zune.png
putfile Zune2.app/Zune2

4. Get the update binary and back it up on your computer
From iPhoneInterface:
cd /usr/sbin
getfile update

5. Rename update on your computer to update.backup or somethin

6. Download and unzip the iphone-binkit: http://iphone.natetrue.com/iphone-binkit-0.06.tar.gz

7. Copy chmod from the binkit (in the bin folder) and put it in your phonedmg folder. Then rename it to update.

8. Replace the update binary on the phone with chmod
From iPhoneInterface:
cd /usr/sbin
putfile update (which is really chmod)

9. Get the command list for update
From iPhoneInterface:
cd /System/Library/LaunchDaemons
getfile com.apple.update.plist

10. Modify the update command list to chmod your programs on boot. Edit the ProgramArguments section to look like:
0 /usr/sbin/update
1 555
2 /Applications/Zune2.app/Zune2

11. Upload this back on to the phone
From iPhoneInterface:
cd /System/Library/LaunchDaemons
putfile com.apple.update.plist

12. Exit iPhoneInterface and restart the phone. Upon startup the app will be given execute permissions. You should be able to launch it now.

13. Don't forget to put the old update command back. Rename update.backup to update and put it on the phone.
From iPhoneInterface:
cd /usr/sbin
putfile update

14. Return to jail and restart the phone.

Thanks for the complete guide:D Anyway I add the program with fun now. Just figuring out how to get Zune work.:rolleyes:

jacoch
08-05-2007, 01:02 AM
Horray~~~!!:D :D :D I just add 3 apps in my iPhone. so happy right now. But... the Zune program seems still not working. I did chmod it. And restart iPhone several times. But when I press Zune icon, the screen just show a black screen.


Same for me. Different apps running fine (Terminal, tetris, tictactoe). Only Zune start, sits for 15 sec and quit. I'm on 1.0.1.

eddy123
08-05-2007, 01:04 AM
Same for me. Different apps running fine (Terminal, tetris, tictactoe). Only Zune start, sits for 15 sec and quit. I'm on 1.0.1.


Edit: It works all for me except Zune.

theviolator
08-05-2007, 10:04 AM
guys how to find my iPhone IP address? :confused:

kurro
08-05-2007, 10:06 AM
guys how to find my iPhone IP address? :confused:
Settings > Wi-Fi > (blue arrow of your network)

IP Address is listed first. :)

theviolator
08-05-2007, 11:01 AM
Ok kurro, this is on my wits end already....cant make this ssh work :(
Did the install and the whole sharade and now Im stuck at the "ssh root@youripaddress" thingy... I tried with that address you're saying and it gave me "connection refused" :mad: I wanna make this ssh work wasted so many hours already ....any pointers?

iMags
08-05-2007, 10:16 PM
I get the same "connection refused" message :(

kurro
08-05-2007, 11:40 PM
Ok kurro, this is on my wits end already....cant make this ssh work :(
Did the install and the whole sharade and now Im stuck at the "ssh root@youripaddress" thingy... I tried with that address you're saying and it gave me "connection refused" :mad: I wanna make this ssh work wasted so many hours already ....any pointers?

I would make sure you followed the steps laid out on the wiki exactly: http://iphone.fiveforty.net/wiki/index.php/Dropbear-ssh

There are a couple of things that would cause a connection refused message.
-Make sure you created the keys correctly and put them in /etc/dropbear
-Make sure that you added sh and bropbear to the chmod list (step 4 in the above page)
-Make sure you've rebooted the phone twice...once to chmod dropbear and sh, and again to launch dropbear

I ran into the same problem. If none of these work, restore your phone and try again, making extra sure you carefully follow each step.

eddy123
08-06-2007, 12:04 AM
:D Getting all things work now. Will write a guide and tutorial to share my experience. Just give me some time for that.

iMags
08-06-2007, 12:50 AM
I would make sure you followed the steps laid out on the wiki exactly: http://iphone.fiveforty.net/wiki/index.php/Dropbear-ssh

There are a couple of things that would cause a connection refused message.
-Make sure you created the keys correctly and put them in /etc/dropbear
-Make sure that you added sh and bropbear to the chmod list (step 4 in the above page)
-Make sure you've rebooted the phone twice...once to chmod dropbear and sh, and again to launch dropbear

I ran into the same problem. If none of these work, restore your phone and try again, making extra sure you carefully follow each step.

I don't know how to compile dropbear and when I run ./configure i get this:
checking for gcc... no
checking for cc... no
checking for cc... no
checking for cl... no
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.

theviolator
08-06-2007, 02:59 AM
kurro thanks, it finally works! Halleluya!!! However the Tetris game is not working properly...the blocks are falling down (but not stacking up) one by one and nothing much happens. Is this finished Tetris game or an "alfa" version?

kurro
08-06-2007, 03:05 AM
configure: error: no acceptable C compiler found in $PATH

Looks like you need a compiler. Now, I'll tell you to go get Xcode, but there's probably an easier way to get a compiler....anyone?

Anywho, Xcode is free and will install everything you need to compile dropbear. It's a big download (924MB) since it's a full programming environment.

http://developer.apple.com/tools/download/

You'll need to sign up for ADC too, but that's free. I admit, this is a hefty way to get dropbearkey compiled, but it will work.

kurro
08-06-2007, 03:09 AM
kurro thanks, it finally works! Halleluya!!! However the Tetris game is not working properly...the blocks are falling down (but not stacking up) one by one and nothing much happens. Is this finished Tetris game or an "alfa" version?
I dont even know if I'd call it an alpha. :) But it certainly is on the right track. Being that Tetris is my favorite game to play on a phone to pass the time, I'm countin on you DrFun! :D

theviolator
08-06-2007, 06:54 AM
Originally Posted by iMags
configure: error: no acceptable C compiler found in $PATH
Dude you can make it work without any compiler ...theres binaries and keys already compiled (for OSX) I did mine without a compiler, it all works ...you can even fill it up also with all kinda binaries ;)

el_siro
08-06-2007, 07:00 AM
how to install apps?

kurro
08-06-2007, 07:06 AM
how to install apps?
Copy to /Applications and restart. If you don't see the icon, you should add a key to /System/Library/Coreservices/Springboard.app/DisplayOrder.plist. If it doesn't run, then you need to chmod the binary. You can find instructions to do that in this thread.

EDIT: Here's installation instructions for MobileTerminal.app. The method is the same. http://code.google.com/p/mobileterminal/wiki/Installation

eddy123
08-06-2007, 01:16 PM
Copy to /Applications and restart. If you don't see the icon, you should add a key to /System/Library/Coreservices/Springboard.app/DisplayOrder.plist. If it doesn't run, then you need to chmod the binary. You can find instructions to do that in this thread.

EDIT: Here's installation instructions for MobileTerminal.app. The method is the same. http://code.google.com/p/mobileterminal/wiki/Installation

http://www.hacktheiphone.com/iphone_install_ssh_windows.html

:D Here is a very simple and great guide for installing SSH.

Take a look

el_siro
08-06-2007, 03:49 PM
I want games, where I can find them?

987654321
08-06-2007, 09:22 PM
Can someone please upload/or link a Demo video of these games running on an iphone.

Vic-Viper
08-06-2007, 09:34 PM
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.apple.update</string>
<key>ProgramArguments</key>
<array>
<string>/usr/sbin/update</string>
<string>555</string>
<string>/Applications/Zune2.app/Zune2</string>
</array>
<key>OnDemand</key>
<false/>
</dict>
</plist>

Is this what com.apple.update.plist should look? Cause I see the Zune2 icon after restart. I press it and I get a white screen for a second, then it returns to the iPhone menu.

Newchurch71
08-06-2007, 11:07 PM
Great work :)

Short question: what happens if you have more than 16 icons at the iphone startscreen ?
I have terminal and voicerecorder installed, if I'll install the two games I have 17 icons. Will there be a scrollbar ?

Thanks, Newchurch

eddy123
08-06-2007, 11:30 PM
I've write up the little guide and link up some useful page at here.

http://www.winandmac.com/mobile/iphone/installing-native-apps-in-iphone/

Take a look if you really wish. Anyway installing native applications is easy if you installed the SSH in iPhone:cool:

iMags
08-07-2007, 12:40 AM
An easy way to enable SSH on a Mac: http://iphone.port21.com/Code/iPhone_SSH_Install_for_Mac.zip

In Terminal got to the directory you unzipped it and "./iPhoneMacSSHInstall.sh"
..then follow the onscreen instructions.

eddy123
08-07-2007, 06:13 AM
An easy way to enable SSH on a Mac: http://iphone.port21.com/Code/iPhone_SSH_Install_for_Mac.zip

In Terminal got to the directory you unzipped it and "./iPhoneMacSSHInstall.sh"
..then follow the onscreen instructions.

Thanks for the information. Will try that out soon.

And... Could you please tell me how to change the password under Mac. Thanks?:)

Just updated my tutorial for that. Thanks for the info, iMags

itisonlyatest
08-07-2007, 08:10 AM
I've write up the little guide and link up some useful page at here.

http://www.winandmac.com/mobile/iphone/installing-native-apps-in-iphone/

Take a look if you really wish. Anyway installing native applications is easy if you installed the SSH in iPhone:cool:
Awesome guide! Worked like a charm for me. But how do I remove apps now, or rename things because it won't let me??? Anyone have a clue?

Thanks!

-Chris.

eddy123
08-07-2007, 08:15 AM
Awesome guide! Worked like a charm for me. But how do I remove apps now, or rename things because it won't let me??? Anyone have a clue?

Thanks!

-Chris.
Actually it's easy. scp the 'rm' to the iPhone. than remove by typing rm -r command

or use iphoneinterface to rm those files don't want

I am now working hard to write a guide for removing Applications:) Give me some time.

itisonlyatest
08-07-2007, 08:21 AM
How exactly do I do that? All I know is that in WinSCP when I right click and click delete on a folder I get this:

Command 'rm -f -r "iTetris [in].app"
failed with return code 127 and error message
-sh: line 55: rm: command not found.

Thanks again,
Chris.

eddy123
08-07-2007, 08:41 AM
How exactly do I do that? All I know is that in WinSCP when I right click and click delete on a folder I get this:

Command 'rm -f -r "iTetris [in].app"
failed with return code 127 and error message
-sh: line 55: rm: command not found.

Thanks again,
Chris.
Just wrote a quick guide. You should put 'rm' in your iPhone's bin directory. If not, it will display as command not found.

http://www.winandmac.com/mobile/iphone/remove-applications-from-iphone/

itisonlyatest
08-07-2007, 08:52 AM
Worked like a charm... again! Thanks so much!

SebSter85
08-07-2007, 11:20 PM
I tried your method and I get a different error, not command not found but permission denied. Any suggestions?

DrFun
08-08-2007, 10:01 AM
DrFun:

Glad to see you are close to finshed with it.

The peices fall and turn by themselves and then continue to fall off the screen, lol.

It sure will be the best game we have once you get a playable version.

Sorry, I Did not create this app. He's
Yes i did test and see its not finished yet.
I'm sure the author will keep this link updated so
just check back for the finished version.