Open main menu

Difference between revisions of "Compiling ScummVM/Android"

 
(6 intermediate revisions by 2 users not shown)
Line 37: Line 37:
<code>sudo apt-get install git m4 make</code>
<code>sudo apt-get install git m4 make</code>
*Important note: The instructions below assume that you are running the commands from a Linux bash shell. If you're on Windows, please make sure you '''always have Docker Desktop up and running before launching your Linux bash shell(s)'''.
*Important note: The instructions below assume that you are running the commands from a Linux bash shell. If you're on Windows, please make sure you '''always have Docker Desktop up and running before launching your Linux bash shell(s)'''.
== On macOS ==
# If you don't already have Xcode command line tools, Xcode from the app store, then from the Terminal run:  <code>xcode-select --install</code>
# If you don't have homebrew installed, install it from https://brew.sh/, then from the Terminal, install docker with  <code>brew install docker</code>
# Install a docker server.  The easiest one is probably [https://docs.docker.com/desktop/install/mac-install/ Docker Desktop]


= Setting up the environment =
= Setting up the environment =
Line 63: Line 69:
<code>cd ~/Workspace/android-scummvm-bb/dockerized-bb</code>
<code>cd ~/Workspace/android-scummvm-bb/dockerized-bb</code>


<code>make toolchains/android</code>
<code>make toolchains/android/pull</code>


At this point the <code>docker images</code> command should return something like the following:
At this point the <code>docker images</code> command should return something like the following; <code>toolchains/android</code> is the required image:


<code>docker images</code>
<code>docker images</code>
Line 139: Line 145:
*<code>android-arm-v7a</code> - for older Android devices
*<code>android-arm-v7a</code> - for older Android devices
* <code>android-x86</code> - ideal for emulator with 32bit images
* <code>android-x86</code> - ideal for emulator with 32bit images
* <code>android-x86_64</code> - ideal for emulator with 64bit images
* <code>android-x86_64</code> - ideal for emulator with 64bit images or a Chromebook device


==== '''For a debug build''' ====
==== '''For a debug build''' ====
Line 168: Line 174:
For instructions on how to create a debug signing certificate manually, if the developer wants to create it one their own for some reason, please refer to the [https://developer.android.com/studio/publish/app-signing#debugmode Android Developers instructions here].
For instructions on how to create a debug signing certificate manually, if the developer wants to create it one their own for some reason, please refer to the [https://developer.android.com/studio/publish/app-signing#debugmode Android Developers instructions here].


==== '''For a release build''' ====
==== '''For a release build (which builds all engines)''' ====
First run a <code>make clean</code> and <code>configure</code> command from inside the local scummvm repository folder (you should be in there by default after running the <code>docker run</code> command). Choose one of the following commands based on the target android architecture:
First run a <code>make clean</code> and <code>configure</code> command from inside the local scummvm repository folder (you should be in there by default after running the <code>docker run</code> command). Choose one of the following commands based on the target android architecture:


Line 192: Line 198:
Please note that a release build must be signed with a non-debug key in order to be installed on a Android device. In order to sign a release build, assuming you have created a release keystore named <code>scummvm-release-key.keystore</code> and have put it in your <code>${ANDROID_SDK_HOME}</code> path on the host Linux (ie. here <code>~/Workspace/android-scummvm-bb/bshomes/sdk-home</code>), you will need to run a command like the following:
Please note that a release build must be signed with a non-debug key in order to be installed on a Android device. In order to sign a release build, assuming you have created a release keystore named <code>scummvm-release-key.keystore</code> and have put it in your <code>${ANDROID_SDK_HOME}</code> path on the host Linux (ie. here <code>~/Workspace/android-scummvm-bb/bshomes/sdk-home</code>), you will need to run a command like the following:


<code>apksigner sign --ks ${ANDROID_SDK_HOME}/scummvm-release-key.keystore --out release/scummvm-release-signed.apk release/ScummVM-release-unsigned.apk</code>
<code>${ANDROID_SDK_BTOOLS}/apksigner sign --ks ${ANDROID_SDK_HOME}/scummvm-release-key.keystore --out release/scummvm-release-signed.apk release/ScummVM-release-unsigned.apk</code>


== Installing the apk on an Android Device ==
== Installing the apk on an Android Device ==
Line 207: Line 213:
This folder can be opened by Android Studio. C files are not yet available, but it is possible to edit the Java source files and debug both Java & native code (on an emulator or on a real device via an <tt>adb</tt> connection).
This folder can be opened by Android Studio. C files are not yet available, but it is possible to edit the Java source files and debug both Java & native code (on an emulator or on a real device via an <tt>adb</tt> connection).


To ''enable debugging'', after opening the <tt>android-project</tt> directory, please change <tt>Project configuration</tt>, under tab <tt>Debugger</tt>, and set field <tt>Debug type</tt> to <code>Dual</code>.
To ''enable debugging'', after opening the <tt>android_project</tt> directory, please edit the <tt>android_project configuration</tt> (click on the dropdown arrow next to the configuration name and select <tt>Edit Configurations...</tt>), select the tab <tt>Debugger</tt>, and set field <tt>Debug type</tt> to <code>Dual</code>.


= References  =
= References  =
* [[Compiling_ScummVM/Docker#Using_the_docker_images | Using the Docker images]]
* [[Compiling_ScummVM/Docker#Using_the_docker_images | Using the Docker images]]
65

edits