Difference between revisions of "Compiling ScummVM/Android"

Jump to navigation Jump to search
(Update instructions - use the Dockerized buildbot toolchains)
Line 50: Line 50:
  make toolchains/android
  make toolchains/android


At this point the 'docker images' command should return something like the following:
At this point the <code>docker images</code> command should return something like the following:
  docker images
  docker images
  REPOSITORY                  TAG      IMAGE ID      CREATED            SIZE
  REPOSITORY                  TAG      IMAGE ID      CREATED            SIZE
Line 57: Line 57:
  toolchains/common          latest    c751ec410582  About an hour ago  24.7kB
  toolchains/common          latest    c751ec410582  About an hour ago  24.7kB


*Important note: From time to time, you may need get updates from our Dockerized buildbot code (using git pull) and rebuild the toolchain containers, in order to make use of the latest improvements and any additional third party cross-compiled libraries.  
*Important note: From time to time, you may need get updates from our Dockerized buildbot code (using <code>git pull</code>) and rebuild the toolchain containers, in order to make use of the latest improvements and any additional third party cross-compiled libraries.


= Launch the Docker container =
= Launch the Docker container =
Line 85: Line 85:
  ANDROID_SDK_BTOOLS_VERSION=29.0.3
  ANDROID_SDK_BTOOLS_VERSION=29.0.3


*Important note: The above command reflects the SDK build tools version installed by the container at the time of writing. This version string may need updating if the container is updated to set up a more recent version of the SDK build tools.  
*Important note 1: The above command reflects the SDK build tools version installed by the container at the time of writing. This version string may need updating if the container is updated to set up a more recent version of the SDK build tools.
*Important note 2: Essentially, the set up of the SDK build tools path as an environmental variable, which is appended to the <code>$PATH</code> environemental variable below, is required only for running the <code>apksigner</code> command to sign a release build manually.


Additionally, run:
Additionally, run:
Line 102: Line 103:


== Configuring and Compiling ScummVM ==
== Configuring and Compiling ScummVM ==
From your Linux host (ie. not from within the Container shell):
<u>From your Linux host</u> (ie. not from within the Container shell):
You should probably first make sure you are working with the latest ScummVM code. Please, run:
You should probably first make sure you are working with the latest ScummVM code. Please, run:
  cd ~/Workspace/scummvm
  cd ~/Workspace/scummvm
  git pull
  git pull
<u>From the Docker container shell</u>:


'''TODO''' The following instructions build for the 'android-arm64-v8a' architecture. A slightly different configure command is required for the other target architectures
'''TODO''' The following instructions build for the 'android-arm64-v8a' architecture. A slightly different configure command is required for the other target architectures


From the Docker container shell:
Supported target architectures for the configure command (values for the <code>--host</code> switch parameter):
* For a debug build, run the following series of commands from inside the local scummvm repository folder (you should be in there by default after running the 'docker run' command):
* <code>android-arm-v7a</code> - for older Android devices
* <code>android-arm64-v8a</code> - for all new Android devices
* <code>android-x86</code> - ideal for emulator with 32bit images
* <code>android-x86_64</code> - ideal for emulator with 64bit images
'''For a debug build''', run the following series of commands from inside the local scummvm repository folder (you should be in there by default after running the <code>docker run</code> command):
  rm -rf android_project
  rm -rf android_project
  rm -rf debug
  rm -rf debug
Line 117: Line 124:
  make -j$(nproc) androiddistdebug
  make -j$(nproc) androiddistdebug


A debug build will be signed automatically by a debug certificate. This certificate will be created by default inside a '.android' subfolder of your ANDROID_SDK_HOME path, which for us is the host path: <tt>~/Workspace/android-scummvm-bb/.android/</tt>. The debug keystore is named appropriately 'debug.keystore'. For instructions on how to create a debug signing certificate manually, please refer to the [https://developer.android.com/studio/publish/app-signing#debugmode Android Developers instructions here]
If successful, the debug apk file will be created inside a <code>debug</code> subfolder in the ScummVM repository folder. The default name will be <code>ScummVM-debug.apk</code>.


* For a release build, run the following series of commands from inside the local scummvm repository folder (you should be in there by default after running the 'docker run' command):
A debug build will be signed automatically by a debug certificate. This certificate will be created by default inside a <code>.android</code> subfolder in your <code>${ANDROID_SDK_HOME}</code> path, which here is the host path: <tt>~/Workspace/android-scummvm-bb/.android/</tt>. The debug keystore is named appropriately 'debug.keystore'. For instructions on how to create a debug signing certificate manually, please refer to the [https://developer.android.com/studio/publish/app-signing#debugmode Android Developers instructions here]
 
'''For a release build''', run the following series of commands from inside the local scummvm repository folder (you should be in there by default after running the 'docker run' command):
  rm -rf android_project
  rm -rf android_project
  rm -rf debug
  rm -rf debug
Line 126: Line 135:
  make -j$(nproc) androiddistrelease
  make -j$(nproc) androiddistrelease


Please note that a release build must be signed with a non-debug key in order to be installed on a Android device.
If successful, the release apk file will be created inside a <code>release</code> subfolder in the ScummVM repository folder.
 
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, 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>
 
== Installing the apk on an Android Device ==
The quickest way to install a debug apk or a signed release apk on your Android Device is to use the <code>Profile or Debug APK</code> functionality of Android Studio.
 
* Important note: On Windows 10, you'll likely have Android Studio set up on the Windows host side. Hence, you will need to copy your apk from the Linux WSL2 environment to a Windows accessible folder. Since WSL2 mounts Windows folders by default under <code>/mnt/</code>, you could run from your Linux host (ie. not from inside the Docker Container) something similar to the following:


Supported target architectures for the configure command:
<code>cp release/scummvm-release-signed.apk /mnt/c/scummvm-android-apks/</code>
* <tt>android-arm-v7a</tt> - for older Android devices
* <tt>android-arm64-v8a</tt> - for all new Android devices
* <tt>android-x86</tt> - ideal for emulator with 32bit images
* <tt>android-x86_64</tt> - ideal for emulator with 64bit images


= Android Studio setup  =
= Android Studio setup  =
1,316

edits

Navigation menu