@@ -34,7 +34,7 @@ To follow along with this guide, you'll need:
34
34
The stdlib is currently only buildable for Android from a Linux environment.
35
35
Before attempting to build for Android, please make sure you are able to build
36
36
for Linux by following the instructions in the Swift project README.
37
- 2 . The latest version of the Android NDK (r12 at the time of this writing),
37
+ 2 . The latest version of the Android NDK (r13 at the time of this writing),
38
38
available to download here:
39
39
http://developer.android.com/ndk/downloads/index.html .
40
40
3 . An Android device with remote debugging enabled. We require remote
@@ -52,7 +52,7 @@ the Swift stdlib for Android requires the libiconv and libicu libraries.
52
52
However, you'll need versions of these libraries that work on Android devices.
53
53
54
54
You may download prebuilt copies of these dependencies, built for Ubuntu 15.10
55
- and Android NDK r12 . Click [ here] ( https://github.com/SwiftAndroid/libiconv-libicu-android/releases/download/android-ndk-r12 /libiconv-libicu-armeabi-v7a-ubuntu-15.10-ndk-r12 .tar.gz )
55
+ and Android NDK r13 . Click [ here] ( https://github.com/SwiftAndroid/libiconv-libicu-android/releases/download/android-ndk-r13 /libiconv-libicu-armeabi-v7a-ubuntu-15.10-ndk-r13 .tar.gz )
56
56
to download, then unzip the archive file.
57
57
58
58
Alternatively, you may choose to build libiconv and libicu for Android yourself:
@@ -81,7 +81,7 @@ Android NDK, as well as the directories that contain the `libicuuc.so` and
81
81
$ utils/build-script \
82
82
-R \ # Build in ReleaseAssert mode.
83
83
--android \ # Build for Android.
84
- --android-ndk /path/to/android-ndk-r12 \ # Path to an Android NDK.
84
+ --android-ndk /path/to/android-ndk-r13 \ # Path to an Android NDK.
85
85
--android-api-level 21 \ # The Android API level to target. Swift only supports 21 or greater.
86
86
--android-icu-uc /path/to/libicu-android/armeabi-v7a \
87
87
--android-icu-uc-include /path/to/libicu-android/armeabi-v7a/icu/source/common \
@@ -102,7 +102,7 @@ gold linker in the Android NDK into your `PATH`:
102
102
103
103
```
104
104
$ sudo ln -s \
105
- /path/to/android-ndk-r12 /toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/arm-linux-androideabi/bin/ld.gold \
105
+ /path/to/android-ndk-r13 /toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/arm-linux-androideabi/bin/ld.gold \
106
106
/usr/bin/armv7-none-linux-androideabi-ld.gold
107
107
```
108
108
@@ -112,9 +112,9 @@ source file, targeting Android:
112
112
```
113
113
$ build/Ninja-ReleaseAssert/swift-linux-x86_64/bin/swiftc \ # The Swift compiler built in the previous step.
114
114
-target armv7-none-linux-androideabi \ # Targeting android-armv7.
115
- -sdk /path/to/android-ndk-r12 /platforms/android-21/arch-arm \ # Use the same NDK path and API version as you used to build the stdlib in the previous step.
116
- -L /path/to/android-ndk-r12 /sources/cxx-stl/llvm-libc++/libs/armeabi-v7a \ # Link the Android NDK's libc++ and libgcc.
117
- -L /path/to/android-ndk-r12 /toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9 \
115
+ -sdk /path/to/android-ndk-r13 /platforms/android-21/arch-arm \ # Use the same NDK path and API version as you used to build the stdlib in the previous step.
116
+ -L /path/to/android-ndk-r13 /sources/cxx-stl/llvm-libc++/libs/armeabi-v7a \ # Link the Android NDK's libc++ and libgcc.
117
+ -L /path/to/android-ndk-r13 /toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9 \
118
118
hello.swift
119
119
```
120
120
@@ -155,7 +155,7 @@ $ adb push build/Ninja-ReleaseAssert/swift-linux-x86_64/lib/swift/android/libswi
155
155
In addition, you'll also need to copy the Android NDK's libc++:
156
156
157
157
```
158
- $ adb push /path/to/android-ndk-r12 /sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libc++_shared.so /data/local/tmp
158
+ $ adb push /path/to/android-ndk-r13 /sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libc++_shared.so /data/local/tmp
159
159
```
160
160
161
161
Finally, you'll need to copy the ` hello ` executable you built in the
@@ -198,7 +198,7 @@ $ utils/build-script \
198
198
-R \ # Build in ReleaseAssert mode.
199
199
-T \ # Run all tests.
200
200
--android \ # Build for Android.
201
- --android-ndk ~/android-ndk-r12 \ # Path to an Android NDK.
201
+ --android-ndk ~/android-ndk-r13 \ # Path to an Android NDK.
202
202
--android-ndk-version 21 \
203
203
--android-icu-uc ~/libicu-android/armeabi-v7a/libicuuc.so \
204
204
--android-icu-uc-include ~/libicu-android/armeabi-v7a/icu/source/common \
0 commit comments