Skip to content

Commit 96177f9

Browse files
author
Anton Pogonets
committed
Update README.md
1 parent 164661c commit 96177f9

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

README.md

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Based on:
55
- https://github.com/SwiftJava/swifty-robot-environment
66
- https://github.com/zayass/swift-android-vagrant
77

8-
# Instalation
8+
# Installation
99
Prebuilt toolchain can be located [here](https://bintray.com/readdle/swift-android-toolchain/swift-android-toolchain)
1010

1111
### Prepare environment
@@ -24,33 +24,34 @@ cd ~
2424
mkdir android
2525
cd android
2626
27-
NDK=15c
28-
SWIFT_ANDROID=4.0k
29-
3027
# install ndk
28+
NDK=15c
3129
wget https://dl.google.com/android/repository/android-ndk-r$NDK-darwin-x86_64.zip
3230
unzip android-ndk-r$NDK-darwin-x86_64.zip
3331
rm -rf android-ndk-r$NDK-darwin-x86_64.zip
3432
unset NDK
3533
3634
# instal swift android toolchain
35+
SWIFT_ANDROID=$(curl -fsSL https://raw.githubusercontent.com/readdle/swift-android-toolchain/master/build/config/version)
3736
wget https://dl.bintray.com/readdle/swift-android-toolchain/swift-android-$SWIFT_ANDROID.zip
3837
unzip swift-android-$SWIFT_ANDROID.zip
3938
rm -rf swift-android-$SWIFT_ANDROID.zip
39+
40+
swift-android-$SWIFT_ANDROID/bin/swift-android tools --update
41+
ln -sfn swift-android-$SWIFT_ANDROID swift-android-current
4042
unset SWIFT_ANDROID
4143
```
4244

4345
6. Setup environment variables by putting this to .profile
4446

4547
```
4648
NDK=15c
47-
SWIFT_ANDROID=4.0k
4849
4950
export JAVA_HOME=$(/usr/libexec/java_home --version 1.8)
5051
# Uncomment if you install Android Studio
5152
# export ANDROID_HOME=$HOME/Library/Android/sdk
5253
export ANDROID_NDK_HOME=$HOME/android/android-ndk-r$NDK
53-
export SWIFT_ANDROID_HOME=$HOME/android/swift-android-$SWIFT_ANDROID
54+
export SWIFT_ANDROID_HOME=$HOME/android/swift-android-current
5455
export TOOLCHAINS=swift
5556
5657
export PATH=$ANDROID_NDK_HOME:$PATH
@@ -66,12 +67,6 @@ unset SWIFT_ANDROID
6667
source $HOME/.profile
6768
```
6869

69-
8. Install Swift Android Build tools(optional). If you want to run swift compiler from command line reload your environment from step 4 and run following command
70-
71-
```
72-
swift android tools --update
73-
```
74-
7570
### Build and Test swift modules
7671

7772
Our current swift build system is tiny wrapper over Swift PM. See [Swift PM](https://github.com/apple/swift-package-manager/blob/master/Documentation/Usage.md) docs for more info.

0 commit comments

Comments
 (0)