-
Notifications
You must be signed in to change notification settings - Fork 32
Getting started
You need Ubuntu 15.10 64-bit to run the prebuilt version. (Other versions of Linux are not supported at this time)
If you don't have Android SDK's ADB, sudo apt-get install android-tools-adb
Install Android NDK - version r10e Linux 64-bit
run
export ANDROID_NDK_HOME=/path/to/ndk
Extract the downloaded file:
tar xf swift_android_2015-12-12.tar.xz
Write a simple Hello World program, and save it as hello.swift.
Now, try building the executable:
swiftandroid/bin/swiftc-android hello.swift
Push the executable and all its dependent libraries to the Android device.
There's a script that will do this for you: run
swiftandroid/bin/swift-android-push hello
to push hello and the libraries to /data/local/tmp
Run the executable, passing LD_LIBRARY_PATH to where the executable and libraries are saved
adb shell LD_LIBRARY_PATH=/data/local/tmp /data/local/tmp/hello
Add swift to the PATH:
export PATH=$PATH:/path/to/swiftandroid/bin
Fix include paths in Bionic module:
swift androidfix
follow instructions on Google site. Basically
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libncurses5:i386 libstdc++6:i386 zlib1g:i386
sudo apt-get install openjdk-7-jdk`
Then download and install the Android SDK from http://developer.android.com/sdk/installing/index.html?pkg=tools
After installing, export the location of the Android SDK:
export ANDROID_HOME=/path/to/android-sdk-linux
see the README of the gradle plugin. Basically,
git clone https://github.com/SwiftAndroid/swift-android-gradle.git
cd swift-android-gradle
./gradlew install
sudo apt-get install clang
git clone https://github.com/SwiftAndroid/swift-android-samples.git`
cd swift-android-samples/swifthello
./gradlew installDebug
Please report any issues to the issue tracker