Command Line

David O'Connor edited this page Sep 18, 2016 · 6 revisions

As previously mentioned, mini2Dx uses Gradle as its build system. When you create your project using the project generator, mini2Dx will include a gradlew (for Mac OS X and Linux) and gradlew.bat (for Windows) in your project folder. This tool automatically downloads and installs Gradle tools and allows you to invoke Gradle tasks.

Prerequisites

If you've generated an Android project, you need to setup an ANDROID_HOME environment variable.

Windows:

  • On the command line type set ANDROID_HOME=C:/Path/To/Your/Android/Sdk and press Enter

Mac OS X

  • On the command line type vim ~/.bash_profile
  • Navigate to the bottom of the file
  • Press i to start Insert Mode
  • Add export ANDROID_HOME=/Path/To/Your/Android/Sdk
  • Press Esc and then type :wq
  • Close and reopen your command line

Linux

  • On the command line type nano ~/.bashrc
  • Navigate to the bottom of the file
  • Add export ANDROID_HOME=/Path/To/Your/Android/Sdk
  • Press CTRL + X
  • It will ask do you want to save, press Y and then Enter
  • Close and reopen your command line

Alternatively you can create a file called "local.properties" with the following content: sdk.dir=/Path/To/Your/Android/Sdk.

Building your code

To build your code, execute the following command.

Windows: gradlew.bat clean build

Mac OS X / Linux: ./gradlew clean build

Running your project

Desktop

Windows: gradlew.bat launchDesktop

Mac OS X / Linux: ./gradlew launchDesktop

Android

1.3.0 or later

Windows: gradlew.bat launchAndroid

Mac OS X / Linux: ./gradlew launchAndroid

pre-1.3.0

Windows: gradlew.bat android:installDebug android:run

Mac OS X / Linux: ./gradlew android:installDebug android:run

iOS

./gradlew launchIPhoneSimulator

./gradlew launchIPadSimulator

./gradlew launchIOSDevice

Releasing your game

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.