Bochs/bochs/build/android/How_to_Build.txt

60 lines
2.4 KiB
Plaintext

1) At first, for building we need (64bit) linux, because already Android NDK support only x64 architecture. In
example, I use Ubuntu 16.10, which installed in Virtual Box in Windows 10.
2) Install Android SDK and NDK (I unpacked them into ~/android directory), and downlod required tools.
https://developer.android.com/ndk/downloads/index.html
https://developer.android.com/studio/index.html (you can download GUI Android Studio with SDK (which installs
from studio) or download command-line tools)
Download this:
Android SDK Tools
Android SDK Platform-tools
Android SDL Build tools
Android 6.0 (API 23) or higher
SDK Platform (API 23) or higher
3) Install JDK. You can do it from apt-get tool or download from official site (in this case you must set envirnoment
value to JDK, see guides "How install JDK and set envirnoment values to JDK).
Command:
sudo apt-get install openjdk-8-jdk
4) Set envirnoment values to Android's tools. For set android environment I create and use simple script setenv-android.sh.
In this sript you must set your paths and tools versions. If script don't work (see results from command "printenv") - set
this values manually. Warning: values will be setted for one command-line session.
Script:
#!/bin/sh
export PATH=~/android/android-ndk-r12b:$PATH
export PATH=~/android/android-sdk-linux/tools:$PATH
export PATH=~/android/android-sdk-linux/build-tools/24.0.0:$PATH
5) Install packages, which needs for build:
Commands:
sudo apt-get install ant //If you install manually - set envirnoment value to Ant
sudo apt-get install make
sudo apt-get install g++
6) Create and put keystore (I use debug version) in ~/.android/debug.keystore (only in this folder and with this name). In
example, I copy debug keystore, which created my Android Studio in Windows 10 (C:\Users\USER_NAME\.android\debug.keystore).
7) Download required repos from GitHub:
git clone git://github.com/pelya/commandergenius androidsdl
git clone git://github.com/lubomyr/bochs
8) Copy folder ~/bochs/android/bochs into ~/androidsdl/project/jni/application/, change symlink
~/androidsdl/project/jni/application/bochs/bochs to point to this bochs repository. For change symlink you can use this command:
ln -sf *bochs folder* *symlink path*
9) For build go to androidsdl folder:
cd ~/androidsdl
and build apk:
./build.sh bochs
Your apk will be in ~/androidsdk/project/bin/MainActivity-debug.apk