We've seen how to use Minimacy as a command line tool: it runs in a terminal and may open a graphical user interface or not.
There are other hosts where Minimacy can't be started from a command line:
- MacOS Apps: such an app will use Cocoa GUI, instead of X11. It is a single file which contains all the needed files.
- iOS : Minimacy can be used to create apps for iPhone and iPad
- Android : Minimacy can be used to create apps for Android based devices
We'll see how to build these apps.
#MacOS
We assume that Xcode is already installed, else you must install it from the Appstore. In this example we used Xcode version 16.1.
First of all, you need to clone the Minimacy project from github:
>git clone https://github.com/ambermind/minimacy.git
Then open the file: ./minimacy/macos/cocoaGL/minimacy.xcodeproj
[
](html)
Select menu Product/Run. Xcode compiles and run the apps. In a few you get this:
- Minimacy app is launched
- Xcode show the console output
Because the ./minimacy/programs/boot.mcy file provided with the git archive only starts the console, nothing interesting happens here.
[
](html)
Now edit this boot.mcy file:
- with any text editor, such as Visual Studio Code (we recommend to install the Minimacy extension you will find in ./minimacy/misc/vscode_extension/minimacy/minimacy-0.0.1.vsix)
- in Xcode directly but as *.mcy files are not recognized by Xcode, you need to specify "Plain Text" in the right panel.
Select boot.mcy in the left, open right panel and click on the type select control:
[
](html)
Select "Plain Text" in the list:
[
](html)
Now you can edit the file:
[
](html)
Then replace the run function with:
fun main() = start("demo.fun.tetris");;
Select menu Product/Run. Xcode recompiles and runs the Tetris example, which runs on every platforms without any change.
[
](html)
Congrats, your first MacOS app is ready!
From now on, it is a regular MacOS app, so you should at least modify:
- The "Product Name"
- The "Bundle Identifier" which must be unique to your app
#iOS
We assume that Xcode is already installed, else you must install it from the Appstore. In this example we used Xcode version 16.1.
Once Xcode is ready, you need to clone the Minimacy project from github:
>git clone https://github.com/ambermind/minimacy.git
Then open the file: ./minimacy/ios/minimacy/minimacy.xcodeproj
[
](html)
Select a target, for example iPhone SE simulator:
[
](html)
Select menu Product/Run. Xcode compiles and run the apps. In a few you get this:
- iPhone SE simulator is started
- Minimacy app is launched
- Xcode show the console output
Because the ./minimacy/programs/boot.mcy file provided with the git archive only starts the console, nothing interesting happens here: the simulator screen is all black.
[
](html)
Now edit this boot.mcy file:
- with any text editor, such as Visual Studio Code (we recommend to install the Minimacy extension you will find in ./minimacy/misc/vscode_extension/minimacy/minimacy-0.0.1.vsix)
- in Xcode directly but as *.mcy files are not recognized by Xcode, you need to specify "Plain Text" in the right panel (see above in the 'MacOS' section how to do it).
Then replace the run function with:
fun main() = start("demo.fun.boing");;
Select menu Product/Run. Xcode recompiles and runs the Boing example, which runs on every platforms without any change.
[
](html)
Congrats, your first iOS app is ready!
From now on, it is a regular iOS app, so you should at least modify:
- The "Product Name"
- The "Bundle Identifier" which must be unique to your app
[
](html)
#Android
Android Studio is hard to setup, because you need to align perfectly 4 software versions: Android Studio, AGP, Gradle and JDK. This is just insane.
This is a working combination:
- Android Studio Meerkat | 2024.3.1
- AGP (Android Gradle Plugin) 8.9.0
- Gradle 8.11.1
- JDK corretto-21.0.6
Once your Android configuration is ready, you need to clone the Minimacy project from github:
>git clone https://github.com/ambermind/minimacy.git
Launch Android Studio, and select Open project.
[
](html)
Select ./minimacy/android/minimacy folder.
[
](html)
Then Android Studio starts. It will take some time (up to 2 minutes) for Android Studio to import the project and you reach this stage:
[
](html)
You may instantiate Android simulators if you don't have any. In our example, we created "Galaxy Nexus API 29".
Now we just click Run 'app'. The project is compiled and launched on the simulator.
[
](html)
Because the ./minimacy/programs/boot.mcy file provided with the git archive only starts the console, nothing interesting happens here: the simulator screen is all black.
[
](html)
Now edit this boot.mcy file. Then replace the run function with:
fun main() = start("demo.fun.boing");;
[
](html)
Click Run 'app'. Android Studio recompiles and runs the Boing example, which runs on every platforms without any change.
[
](html)
Congrats, your first Android app is ready!
From now on, it is a regular Android app, so you should at least modify:
- The "Display Name": edit field "app_name" in file ./minimacy/android/minimacy/app/src/main/res/values/strings.xml
- The "Bundle Identifier" which must be unique to your app: edit field "applicationId" in file ./minimacy/android/minimacy/app/build.gradle
On Android, there is some special trick concerning assets:
- files specified in assets must be copied into regular files when the App starts, so that Minimacy can open them.
- this is achieved by calling assetDirCopy(...): this function copies the files from an asset folder to a file directory.
- The default source code copies the rom files, then assets such as boot.mcy in programs/, as well as assets in "demo", "usr", "test".
- you may edit this file: ./minimacy/android/minimacy/app/src/main/cpp/system_ui_android.c
- you may add calls to assetDirCopy when needed.
[
](html)
#Icons
It is always painful to generate icons in all possible sizes for Apps. Minimacy provides a convenient tool: iconMaker
In order to generate the icons:
- replace ./minimacy/logo.png with your own png file (located at the root directory)
- on Windows, double-click on ./minimacy/iconMaker.mcy
- on MacOs, use the Minimacy command line: ./minimacy/bin/minimacyMac ./minimacy/iconMaker.mcy
IconMaker will populate all the required files directly in the target directories (android, ios, macos).