In this post, I will explain how to install Phratch on an Android device. I created the .apk file for an ARM architecture. The following instructions are based on this page.

  • Download Android SDK:
  • Ant should be installed:
Image preparation:

First, download  a Pharo 2.0 image and execute the following code. It loads the necessary code for Android support and the Phratch package. Deprecation raiseWarning: false; showWarning: false.

"Installation of Android support"
Gofer new
 url: '';
 package: 'Android-Base';
SmalltalkImage checkSourcesFileAvailability: false.
SmalltalkImage checkChangesFileAvailability: false.
"2 - installation of Phratch"
Gofer it
 url: ''
 username: '' 
 password: ''; 
 package: 'ConfigurationOfPhratch';
(Smalltalk at: #ConfigurationOfPhratch) loadBleedingEdge.

Then, you can execute the following lines that makes Phratch be in User mode:

StartupLoader default removeAllScriptsFromAllDirectories; initialize.
PhratchFrameMorph open saveImageForEndUserSilently.
Image splitting

Now, split your image:

split -d -b 1m /path/to/myapplication.image myapplication.

In macosX, the option -d does not exist. It means that you should remove it and rename all created files with extensions as .00, .01, .02, …

Creation of the Android project

Create a new folder for the project. Inside it, unzip the (
Go inside the dir, and, inside it, unzip the ( I use the arm file.

Then do

 mkdir -p src/phratch/eu/android

Then create a .java file in src/phratch/eu/android/, which contains:

 import org.golubovsky.cogstack.CogActivity;
 public class Phratch extends CogActivity {

In assets/image, push the image splitted file (files with extension .00, .01, …), and run:

ls -l assets/image/

Make sure subdirectory assets/zipped exists. From, download in this folder the files,,,, and

Customize of the Android project

Now, comes the need to change files. Go back in the makevm folder.

In AndroidManifest.xml

  • change @@PACKAGE@@ by “”
  • change @@ACTIVITY@@ by “Phratch”

In build.xml

  • change @@BUILD@@ by “Phratch-android”

In res/values/strings.xml

  • change @@BUILD@@ by Phratch-android


  • change the line sdk.dir by the full path of your sdk, mine is sdk.dir=/Users/janniklaval/Desktop/phratch-and/makevm/sdk

In, change the two following lines:

  • target=android-4
  • android.library.reference.1=../../project/


  • target=android-17
  • android.library.reference.1=project/

In project/

  • change the line sdk.dir by the full path of your sdk, mine is sdk.dir=/Users/janniklaval/Desktop/phratch-and/makevm/sdk

In project/, change the following line:

  • target=android-4


  • target=android-17

In res/drawable/, you can replace icons.

Finish the creation of the .apk

Run the commands:

 ant clean
 ant debug

You can run

 ant release

The installable apk file will be under bin: Phratch-android-debug.apk.

Leave a reply


<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>