https://github.com/codeljo/ndk_command_line_app
Android NDK Command Line App Example
https://github.com/codeljo/ndk_command_line_app
android ndk ndk-build ndk-sample
Last synced: 10 months ago
JSON representation
Android NDK Command Line App Example
- Host: GitHub
- URL: https://github.com/codeljo/ndk_command_line_app
- Owner: codeljo
- License: mit
- Created: 2023-11-24T08:35:35.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-01-05T08:56:10.000Z (over 2 years ago)
- Last Synced: 2025-02-25T02:39:08.432Z (over 1 year ago)
- Topics: android, ndk, ndk-build, ndk-sample
- Language: Makefile
- Homepage:
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NDK Command Line App
### Add Android SDK tools to your PATH
```
export PATH=$PATH:/path/to/Android/Sdk/platform-tools/
```
### Add Android NDK to your PATH
```
export PATH=$PATH:/path/to/android-ndk/
```
### Setup NDK_PROJECT_PATH
```
export NDK_PROJECT_PATH=.
```
### Clean Build
```
ndk-build NDK_APPLICATION_MK=./Application.mk clean
```
### Build App
```
ndk-build NDK_APPLICATION_MK=./Application.mk
```
### Transfer compiled app to Android device
```
adb connect ANDROID_IP_HERE
adb push ./libs/armeabi-v7a/main.out /data/local/tmp/
```
### Run binary on Android device
```
adb shell
chmod 755 /data/local/tmp/main.out
/data/local/tmp/main.out
```
### NDK Reference
ABI | Supported Instruction Sets
----|------------------------------------------------------
armeabi-v7a | armeabi, Thumb-2, VFPv3-D16
arm64-v8a | AArch64
x86 | x86, MMX, SSE/2/3, SSSE3
x86_64 | x86-64, MMX, SSE/2/3, SSSE3, SSE4.1, SSE4.2, POPCNT
all | build for all ABI's
> The NDK supported ARMv5 (armeabi), and 32-bit and 64-bit MIPS, but support for these ABIs was removed in NDK r17.
https://developer.android.com/ndk/guides/ndk-build
https://developer.android.com/ndk/guides/android_mk
https://developer.android.com/ndk/guides/application_mk
https://developer.android.com/ndk/guides/cpp-support
https://developer.android.com/ndk/guides/abis