Difference between revisions of "Android"

From Minetest Developer Wiki
Jump to navigation Jump to search
 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
= Building Android from master branch =
+
= Building Android =
  
This is a simple guide on how to build Minetest for Android on Ubuntu <b>on a 64 bit system</b>. Building on 32 bit systems should work too when the URLs and paths are replaced accordingly. This guide covers all preparation needed. Once everything is set up, Minetest only needs <code>cd build/android && make</code> to compile.
+
See https://github.com/minetest/minetest/blob/master/doc/README.android
 
 
=== Required packages ===
 
Git, Make, and other basic tools are neccessary: <br\><br/>
 
<code>
 
sudo apt-get update<br/>
 
sudo apt-get install make m4 subversion git-core build-essential realpath openjdk-8-jdk
 
</code><br/><br/>
 
Gradle is required as well. If your distribution gives you gradle 2.10 or later (like Ubuntu 16.04 does), you may simply do:<br/><br/><code>sudo apt-get install gradle</code><br/><br/>
 
If your distribution ships with an older version of gradle, you may grab a recent version of gradle via a PPA:<br/><br/>
 
<code>
 
sudo add-apt-repository ppa:cwchien/gradle<br/>
 
sudo apt-get install gradle-2.13
 
</code><br/><br/>
 
 
 
As your architecture is 64 bit, you need additional packages.<br/><br/>
 
On newer systems do: (Ubuntu 16.04-ish): <br/><br/>
 
<code>
 
sudo apt-get install lib32z1
 
</code><br/><br/>
 
On older systems do:<br/><br/>
 
<code>
 
sudo apt-get install --force-yes libgd2-xpm ia32-libs ia32-libs-multiarch
 
</code>
 
 
 
=== Getting the SDK and NDK ===
 
 
 
Both SDK and NDK are needed:
 
 
 
<code>
 
wget https://dl.google.com/android/android-sdk_r24.4.1-linux.tgz <br\>
 
wget https://dl.google.com/android/repository/android-ndk-r16b-linux-x86_64.zip <br\>
 
<br\>
 
tar xf android-sdk_r24.4.1-linux.tgz <br\>
 
unzip android-ndk-r16b-linux-x86_64.zip <br\>
 
<br\>
 
android-sdk-linux/tools/android update sdk --no-ui -a --filter platform-tool,android-25,build-tools-25.0.3 <br\>
 
</code>
 
 
 
The last line will ask for your confirmation multiple times.
 
 
 
=== Obtaining and building Minetest ===
 
Clone Minetest, and build it:<br/><br/>
 
<code>
 
git clone --depth 1 https://github.com/minetest/minetest.git <br\>
 
cd minetest/build/android <br\>
 
make debug<br\>
 
</code>
 
 
 
The make file will ask you for the paths to your SDK and NDK.  It will then download and build all required libraries.  Finally it will build Minetest and the Java sources and pack everything into a debug-signed APK.
 
 
 
=== References ===
 
 
 
<references/>
 
[[Category:Compiling Minetest]]
 
 
 
= Releasing Minetest APK =
 
 
 
=== Perform the release ===
 
 
 
==== Build ====
 
First you should have a release build.
 
 
 
Ensure minetest_game is on the right git tag in games/minetest_game folder
 
 
 
<code>
 
cd games/minetest_game
 
 
 
git reset --hard
 
 
 
git checkout 0.4.17
 
 
 
cd -
 
</code>
 
 
 
Then you can perform the release
 
 
 
<code>
 
cd build/android
 
 
 
make release
 
</code>
 
 
 
This generates an apk file here: ''build/outputs/apk/Minetest-release-unsigned.apk''
 
 
 
==== Package ====
 
<code>
 
jarsigner -verbose -digestalg SHA1 -sigalg MD5withRSA -keystore $KEYSTORE_FOLDER/keystore-minetest.jks build/outputs/apk/Minetest-release-unsigned.apk Minetest
 
 
 
$ANDROID_SDK/build-tools/28.0.0/zipalign -v 4 build/outputs/apk/Minetest-release-unsigned.apk Minetest-release.apk
 
</code>
 
 
 
==== Deploy ====
 
 
 
You can now install the release on your phone. It's located inside the current folder.
 
 
 
<code>
 
adb install Minetest-release.apk
 
</code>
 
 
 
=== Publish on the Play Store ===
 
 
 
The Google Play Store app uses public beta for testers before making it available for many users.
 
 
 
You should first publish the beta release [https://play.google.com/apps/publish/?hl=fr#ManageReleaseTrackPlace:p=net.minetest.minetest&appid=4976427850705178518 here].
 
 
 
When the test is complete and valid, click on '''Create the production version''' and publish it.
 

Latest revision as of 19:42, 18 June 2022