Thanks for checking out the Moai source code. Here's the scoop.
Moai SDK is an open source game framework for quickly developing great mobile games.
You can work in Lua or C++, and Moai SDK runs on multiple platforms including iOS, Android, Chrome, Windows, Mac and Linux.
Please clone the source in the following way.
git clone https://github.com/moai/moai-dev.git --recursive
Tools needed to build the MOAI SDK.
- Android SDK
- Android NDK (32bit Only, r8e or earlier)
- Java SE 6
- Ant 1.9
- CMake 2.8.11
- Ruby 1.9
- Visual Studio 2015 Community (Windows only)
- XCode 4 or 5 (Mac only)
- MinGW64 TCC (Windows only, needed for android luajit support or can build mingw version of moai)
- Emscripten
The following tools are required to build the API documentation.
On Mac OSX some tools need to be installed with homebrew:
$ brew install xctool ios-sim cmake
cmake needs to be 3.3 on osx
On Mac OSX, Linux and Windows, Android studio version should be 1.4+ and Android ndk can be r10e+
Please set the following environment variables.
export MOAI_BIN=<install_path>/moai-dev/release/osx/host-sdl/bin
export MOAI_CONFIG=<install_path>/moai-dev/samples/config
export MOAI_BIN=<install_path>/moai-dev/release/linux/host-sdl/x64/bin
export MOAI_CONFIG=<install_path>/moai-dev/samples/config
set MOAI_BIN=%MOAI_SDK_HOME%\bin\win32\
Please build according to the following procedure.
cd moai-dev
cd bin
env-win
build-windows
# Build
cd moai-dev
./bin/build-osx.sh
# Run
cd <sample_directory>
$MOAI_BIN/moai main.lua
cd moai-dev
./bin/build-ios.sh <lua_dir>
# Build
cd moai-dev
./bin/build-linux-sdl.sh
# Run
$MOAI_BIN/moai main.lua
# Build
export ANDROID_NDK=<path_to_android_ndk>
cd moai-dev
./bin/build-android.sh
# Edit Setting
cd release/android/host
vi settings-global.sh
vi settings-local.sh
# Run
./run-host.sh
#build
export EMSCRIPTEN_HOME=<path_to_emscripten_1.7.1>
cd moai-dev
./bin/build-html.sh
#run
<http-serve> cmake/build/host-template/www
#see src\host-html\readme.md for more info
./bin/create-projects-ios.sh
open cmake/projects/moai-ios/moai.xcproj
./bin/create-projects-osx.sh
open cmake/projects/moai-osx/moai.xcproj
Go to the samples folder, which contains dozens of samples that can be run using one the hosts located in ant (Android), xcode (OSX and iOS), or Visual Studio (Windows).
One of our priorities is to build richer samples for Moai developers, so if you'd like to see a particular code sample, let us know by posting in the Moai forums.
This SDK uses the CPAL license. Refer to the for attribution screens to include with games made with Moai.
- Moai Web Site
- Moai FAQ
- Moai SDK Framework Reference
- Moai forums
- Moai Wiki(getmoai)
- Moai Wiki(github)
- Moai API Documentation.
- MoaiFiddle An online Moai editor and player.
- Moai Site Redesign Proposal

