Running PyAMF on the IPhone OS

Introduction

Note: this is a work in progress.

The  iPhone OS, or OS X iPhone, is the operating system developed by Apple Inc. for the  iPhone and  iPod touch, using an  ARM-based processor. Shortly after the operating system was released (firmware release 1.1.1), hackers were able to "jailbreak" the device through a  TIFF exploit. The resulting application, "Installer.app", enabled the user to download a selection of unofficial third-party programs. Some of these give the user more control over the iPod Touch than is officially available, and also makes it work on Linux operating systems.

 Python 2.5.1 is also one of those third-party programs, but  Subversion, Java, GCC etc can all be found there. This tutorial shows you how to install a basic toolkit including Subversion, Python and it's dependencies.

Jailbreak Your Device

There are several tools out there to jailbreak your iPhone or iPod Touch. This tutorial focusses on the  QuickPwn tool and version 2.2 of the iPhone OS.

  1. First make sure your device is up to date by hooking it up to iTunes and checking the Software Version number:

  1. Download the QuickPwn tool for  Mac OSX or  Windows and follow the onscreen instructions. Once the QuickPwn tool completed the jailbreak process it should display something like:

  1. After the jailbreak process the device should show the  Cydia package manager in the installed applications list:

Install Packages

Start Cydia by selecting the icon and press the Search button on the bottom of the page. This should bring up an interface that allows you to search the available packages.

OpenSSH

  1. The first thing we want to install is the  OpenSSH package. Do a search for ssh and select the OpenSSH package as shown in the first picture below. Then select the OpenSSH item in the list and press the Confirm button to install the package.
  1. Check the Network configuration settings of your iPhone for it's IP address and ssh into it using Apple's Terminal, Putty or any SSH client. The default root password is alpine. For example:
ssh root@192.168.1.103
root@192.168.1.103's password:
  1. Make sure to change your root password using the passwd command.
$ passwd
Changing password for root.
Old password:
New password:
Retype new password:

Subversion

Next thing to install is  Subversion. Do a search for subversion and select the Subversion package as shown in the first picture below. Then select the Subversion item in the list and press the Confirm button to install the package.

Python

Now install  Python. Do a search for python and select the iPhone/Python package as shown in the first picture below. Then select that iPhone/Python item in the list and press the Confirm button to install the package. This will install the Python runtime,  PyObjC, setuptools and a  sample application for the iPhone OS written with Python and PyObjC.

Additional Packages

Other useful and optional packages are the GNU C compiler, the APT package manager, Mobile Terminal and wget:

Download the example

  1. Download PyAMF and install it on your device using the regular installation instructions.
  2. Grab the example from the  Subversion repository with:
    svn co http://svn.pyamf.org/examples/trunk/iphone-os
    cd iphone-os/python
    

Server

The WSGI server for the Adobe Flash Player and other AMF clients starts on http://192.168.1.103:8000 when you run the server.py file from the python folder:

python server.py

Note: You can change the IP address of this example server by editing server.py.

Attachments