mirror of
https://github.com/raysan5/raylib.git
synced 2026-02-01 11:49:17 -05:00
Updated Working for Android (markdown)
@ -87,6 +87,79 @@ _Step 4:_ To view log output from device:
|
|||||||
%ANDROID_SDK_TOOLS%\adb logcat -c
|
%ANDROID_SDK_TOOLS%\adb logcat -c
|
||||||
%ANDROID_SDK_TOOLS%\adb -d logcat raylib:V *:S
|
%ANDROID_SDK_TOOLS%\adb -d logcat raylib:V *:S
|
||||||
|
|
||||||
|
|
||||||
|
## Generate APK using raylib-game-template. (edited on 2022.07.30)
|
||||||
|
|
||||||
|
My pc os is win8.1 x64
|
||||||
|
|
||||||
|
_Step 1.need to download these (需要下载这些)
|
||||||
|
```
|
||||||
|
msys2 https://www.msys2.org/
|
||||||
|
run command in msys:
|
||||||
|
pacman -S mingw-w64-i686-toolchain (select default 选择默认的)
|
||||||
|
pacman -S mingw-w64-x86_64-make
|
||||||
|
|
||||||
|
android-studio https://developer.android.com/studio
|
||||||
|
use SDK Manager download these:
|
||||||
|
sdk with android-29
|
||||||
|
NDK 25.0.8775105
|
||||||
|
build tools 29.0.3
|
||||||
|
platform-tools
|
||||||
|
|
||||||
|
openjdk-8u332-b09-windows-64 https://www.openlogic.com/openjdk-downloads
|
||||||
|
|
||||||
|
raylib https://github.com/raysan5/raylib
|
||||||
|
|
||||||
|
raylib-game-template https://github.com/raysan5/raylib-game-template
|
||||||
|
```
|
||||||
|
|
||||||
|
_Step 2.confirm the installation path (确认安装路径)
|
||||||
|
```
|
||||||
|
mingw-w64 C:\msys64\mingw64\bin
|
||||||
|
NDK D:\Program_Files\android_sdk\ndk\25.0.8775105
|
||||||
|
openjdk D:\Program_Files\openjdk
|
||||||
|
android sdk D:\Program_Files\android_sdk
|
||||||
|
raylib C:\raylib
|
||||||
|
raylib-game-template D:\raylib-game-template-main
|
||||||
|
```
|
||||||
|
|
||||||
|
_Step 3.set environment variables (设置环境变量)
|
||||||
|
```
|
||||||
|
JAVA_HOME D:\Program_Files\openjdk
|
||||||
|
Path C:\msys64\mingw64\bin
|
||||||
|
```
|
||||||
|
|
||||||
|
_Step 4.edit makefile and makefile.android (编辑makefle和makefile.android)
|
||||||
|
```
|
||||||
|
c:\raylib\src\Makefile
|
||||||
|
line 203 ANDROID_NDK ?= D:/Program_Files/android_sdk/ndk/25.0.8775105
|
||||||
|
line 197 ANDROID_ARCH ?= arm64
|
||||||
|
line 198 ANDROID_API_VERSION ?= 29
|
||||||
|
|
||||||
|
d:\raylib-game-template-main\src\Makefile.Android
|
||||||
|
line 28 RAYLIB_PATH ?= C:\raylib
|
||||||
|
line 33 ANDROID_ARCH ?= ARM64
|
||||||
|
line 34 ANDROID_API_VERSION = 29
|
||||||
|
line 51 JAVA_HOME ?= D:/Program_Files/openjdk
|
||||||
|
line 52 ANDROID_HOME ?= D:/Program_Files/android_sdk
|
||||||
|
line 53 ANDROID_NDK ?= D:/Program_Files/android_sdk/ndk/25.0.8775105
|
||||||
|
line 55 ANDROID_BUILD_TOOLS ?= $(ANDROID_HOME)/build-tools/29.0.3
|
||||||
|
```
|
||||||
|
|
||||||
|
_Step 5.generate libraylib.a for android (生成安卓平台的libraylib.a)
|
||||||
|
```
|
||||||
|
in c:\raylib\src
|
||||||
|
run command:
|
||||||
|
mingw32-make PLATFORM=PLATFORM_ANDROID
|
||||||
|
```
|
||||||
|
|
||||||
|
_Step 6.generate APK (生成APK)
|
||||||
|
```
|
||||||
|
in d:\raylib-game-template-main\src
|
||||||
|
run command:
|
||||||
|
mingw32-make PLATFORM=PLATFORM_ANDROID
|
||||||
|
```
|
||||||
|
|
||||||
**If you have any doubt, [just let me know][raysan5].**
|
**If you have any doubt, [just let me know][raysan5].**
|
||||||
|
|
||||||
[raysan5]: mailto:ray@raylib.com
|
[raysan5]: mailto:ray@raylib.com
|
||||||
|
|||||||
Reference in New Issue
Block a user