@@ -36,7 +36,7 @@ To follow along with this guide, you'll need:
36
36
instructions in the Swift project README.
37
37
2 . The latest build of the Swift compiler for your Linux distro, available at
38
38
https://www.swift.org/download/ or sometimes your distro package manager.
39
- 3 . The latest version of the Android LTS NDK (r26d at the time of this writing),
39
+ 3 . The latest version of the Android LTS NDK (r27c at the time of this writing),
40
40
available to download here:
41
41
https://developer.android.com/ndk/downloads
42
42
4 . An Android device with remote debugging enabled or the emulator. We require
@@ -54,9 +54,9 @@ and the prebuilt Swift toolchain (add --skip-early-swift-driver if you already
54
54
have a Swift toolchain in your path):
55
55
56
56
```
57
- $ NDK_PATH=path/to/android-ndk-r26d
58
- $ SWIFT_PATH=path/to/swift-DEVELOPMENT-SNAPSHOT-2024-07 -09-a-ubuntu22.04/usr/bin
59
- $ git checkout swift-DEVELOPMENT-SNAPSHOT-2024-07 -09-a
57
+ $ NDK_PATH=path/to/android-ndk-r27c
58
+ $ SWIFT_PATH=path/to/swift-DEVELOPMENT-SNAPSHOT-2024-11 -09-a-ubuntu22.04/usr/bin
59
+ $ git checkout swift-DEVELOPMENT-SNAPSHOT-2024-11 -09-a
60
60
$ utils/build-script \
61
61
-R \ # Build in ReleaseAssert mode.
62
62
--android \ # Build for Android.
@@ -83,8 +83,8 @@ Then use the standalone Swift stdlib from the previous step to compile a Swift
83
83
source file, targeting Android:
84
84
85
85
```
86
- $ NDK_PATH="path/to/android-ndk-r26d "
87
- $ SWIFT_PATH=path/to/swift-DEVELOPMENT-SNAPSHOT-2024-07 -09-a-ubuntu22.04/usr/bin
86
+ $ NDK_PATH="path/to/android-ndk-r27c "
87
+ $ SWIFT_PATH=path/to/swift-DEVELOPMENT-SNAPSHOT-2024-11 -09-a-ubuntu22.04/usr/bin
88
88
$ $SWIFT_PATH/swiftc \ # The prebuilt Swift compiler you downloaded
89
89
# The location of the tools used to build Android binaries
90
90
-tools-directory ${NDK_PATH}/toolchains/llvm/prebuilt/linux-x86_64/bin/ \
@@ -122,18 +122,20 @@ commands to copy the Swift Android stdlib:
122
122
123
123
```
124
124
$ adb push build/Ninja-ReleaseAssert/swift-linux-x86_64/lib/swift/android/libswiftCore.so /data/local/tmp
125
- $ adb push build/Ninja-ReleaseAssert/swift-linux-x86_64/lib/swift/android/libswiftGlibc .so /data/local/tmp
125
+ $ adb push build/Ninja-ReleaseAssert/swift-linux-x86_64/lib/swift/android/libswiftAndroid .so /data/local/tmp
126
126
$ adb push build/Ninja-ReleaseAssert/swift-linux-x86_64/lib/swift/android/libswiftSwiftOnoneSupport.so /data/local/tmp
127
127
$ adb push build/Ninja-ReleaseAssert/swift-linux-x86_64/lib/swift/android/libswiftRemoteMirror.so /data/local/tmp
128
128
$ adb push build/Ninja-ReleaseAssert/swift-linux-x86_64/lib/swift/android/libswift_Concurrency.so /data/local/tmp
129
+ $ adb push build/Ninja-ReleaseAssert/swift-linux-x86_64/lib/swift/android/libswift_RegexParser.so /data/local/tmp
130
+ $ adb push build/Ninja-ReleaseAssert/swift-linux-x86_64/lib/swift/android/libswift_StringProcessing.so /data/local/tmp
129
131
$ adb push build/Ninja-ReleaseAssert/swift-linux-x86_64/lib/swift/android/libdispatch.so /data/local/tmp
130
132
$ adb push build/Ninja-ReleaseAssert/swift-linux-x86_64/lib/swift/android/libBlocksRuntime.so /data/local/tmp
131
133
```
132
134
133
135
In addition, you'll also need to copy the Android NDK's libc++:
134
136
135
137
```
136
- $ adb push /path/to/android-ndk-r26d /toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/libc++_shared.so /data/local/tmp
138
+ $ adb push /path/to/android-ndk-r27c /toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/libc++_shared.so /data/local/tmp
137
139
```
138
140
139
141
Finally, you'll need to copy the ` hello ` executable you built in the
@@ -176,7 +178,7 @@ $ utils/build-script \
176
178
-R \ # Build in ReleaseAssert mode.
177
179
-T \ # Run all tests, including on the Android device (add --host-test to only run Android tests on the Linux host).
178
180
--android \ # Build for Android.
179
- --android-ndk ~/android-ndk-r26d \ # Path to an Android NDK.
181
+ --android-ndk ~/android-ndk-r27c \ # Path to an Android NDK.
180
182
--android-arch aarch64 \ # Optionally specify Android architecture, alternately armv7 or x86_64
181
183
--android-api-level 21
182
184
```
0 commit comments