console-kit

4.2.7

💻 APIs for creating interactive CLI tools.
vapor/console-kit

What's New

[android] support `Android` platform.

2021-08-12T11:10:59Z
This patch was authored by @Guang1234567 and released by @gwynne.

Hello dev:

Just support android, thanks.

Usage:

#!/usr/bin/env bash

export ANDROID_HOME=$HOME/dev_kit/sdk/android_sdk
export ANDROID_SDK=$ANDROID_HOME
export ANDROID_SDK_ROOT=$ANDROID_HOME
export ANDROID_NDK_HOME=$ANDROID_HOME/ndk/21.4.7075529
export ANDROID_NDK=$ANDROID_NDK_HOME
export NDK_ROOT=$ANDROID_NDK_HOME
export ANDROID_NDK_ROOT=$ANDROID_NDK_HOME
export ANDROID_NDK_PATH=$ANDROID_NDK_HOME
export NDK_TOOLCHAINS=$HOME/dev_kit/sdk/toolchain-wrapper

ALL_IN_ONE_FOLDER=$(dirname $(pwd))

export SWIFT_ANDROID_HOME=$ALL_IN_ONE_FOLDER/swift-android-5.4.2-release-ndk21
export SWIFT_ANDROID_ARCH=aarch64
#export SWIFT_ANDROID_ARCH=armv7
#export SWIFT_ANDROID_ARCH=x86_64
export SWIFT_ANDROID_API=23

cd console-kit

#echo -e "\n\n\nRunning on macOS:\n=======================================\n"
#swift build
#.build/x86_64-apple-macosx/debug/ConsoleKitExample demo --color --frames "⠋,⠙,⠹,⠸,⠼,⠴,⠦,⠧,⠇,⠏"

echo -e "\n\n\nRunning on androidOS:\n=======================================\n"

${SWIFT_ANDROID_HOME}/build-tools/1.9.7-swift5.4/swift-build --configuration debug -Xswiftc -DDEBUG -Xswiftc -g

echo -e "\n\n\nCopy ELF to real android device :\n_______________________________________\n"

adb push .build/aarch64-unknown-linux-android/debug/ConsoleKitExample /data/local/tmp

echo -e "\n\n\nCopy swift runtime SO to real android device :\n_______________________________________\n"

adb push ${SWIFT_ANDROID_HOME}/toolchain/usr/lib/swift/android/aarch64/*.so /data/local/tmp

echo -e "\n\n\nRunning on real android device :\n_______________________________________\n"

adb shell LD_LIBRARY_PATH=/data/local/tmp /data/local/tmp/ConsoleKitExample demo --color --frames "⠋,⠙,⠹,⠸,⠼,⠴,⠦,⠧,⠇,⠏"

cd ..

Description

  • Swift Tools 5.2.0
View More Packages from this Author

Dependencies

Last updated: Wed Oct 27 2021 21:14:53 GMT-0500 (GMT-05:00)