我想使用Mac主机上的Xcode远程开发/运行/调试Swift蓝牙程序,并将其安装到带有Debian OS的远程(SBC)华硕Tinkerboard S。
经过大量的搜索和拼凑而成的随机博客,以下部分正在工作:
当我检查Swift的版本时:
$ swift -v
Swift version 4.2.1 (swift-4.2.1-RELEASE)
Target: armv7-unknown-linux-gnueabihf
/usr/bin/lldb "--repl=-disable-objc-interop -color-diagnostics"
error: failed to stop process at REPL breakpoint
什么不起作用:
.xcodeproj
来重新生成swift package generate-xcodeproj
。PackageDescription API v3 is deprecated and will be removed in the future; used by package(s): SwiftFoundation, CJSONC, CStatfs
x86_64-linux-gnu
文件夹及其缺失。我已经安装了我所知道的依赖项...,我认为应该使用armv7-unknown-linux-gnueabihf
来代替。-----------------------------
Configuration:
-----------------------------
Username: linaro
Hostname: tinkerboard.local
Destination: ~/Swish/swift_program
-----------------------------
Start syncing project to linaro@tinkerboard.local:~/Swish/swift_program
sending incremental file list
./
Package.swift
993 100% 0.00kB/s 0:00:00
993 100% 0.00kB/s 0:00:00 (xfr#1, to-chk=12/16)
Did sync project to remote machine
⚒ Start building project
bash: /home/linaro/.bash_profile: No such file or directory
warning: PackageDescription API v3 is deprecated and will be removed in the future; used by package(s): SwiftFoundation, CJSONC, CStatfs
Compile Swift Module 'SwiftFoundation' (39 sources)
Compile Swift Module 'Bluetooth' (430 sources)
/home/linaro/Swish/swift_program/.build/checkouts/CStatfs.git--2064549412/module.modulemap:2:12: error: header '/usr/include/x86_64-linux-gnu/sys/vfs.h' not found
header "/usr/include/x86_64-linux-gnu/sys/vfs.h"
^
/home/linaro/Swish/swift_program/.build/checkouts/SwiftFoundation--958978667/Sources/SwiftFoundation/FileDescriptor.swift:13:12: error: could not build C module 'CStatfs'
import CStatfs
^
/home/linaro/Swish/swift_program/.build/checkouts/CStatfs.git--2064549412/module.modulemap:2:12: error: header '/usr/include/x86_64-linux-gnu/sys/vfs.h' not found
header "/usr/include/x86_64-linux-gnu/sys/vfs.h"
^
/home/linaro/Swish/swift_program/.build/checkouts/SwiftFoundation--958978667/Sources/SwiftFoundation/FileDescriptor.swift:13:12: error: could not build C module 'CStatfs'
import CStatfs
^
/home/linaro/Swish/swift_program/.build/checkouts/CStatfs.git--2064549412/module.modulemap:2:12: error: header '/usr/include/x86_64-linux-gnu/sys/vfs.h' not found
header "/usr/include/x86_64-linux-gnu/sys/vfs.h"
^
/home/linaro/Swish/swift_program/.build/checkouts/SwiftFoundation--958978667/Sources/SwiftFoundation/FileDescriptor.swift:13:12: error: could not build C module 'CStatfs'
import CStatfs
^
/home/linaro/Swish/swift_program/.build/checkouts/CStatfs.git--2064549412/module.modulemap:2:12: error: header '/usr/include/x86_64-linux-gnu/sys/vfs.h' not found
header "/usr/include/x86_64-linux-gnu/sys/vfs.h"
^
/home/linaro/Swish/swift_program/.build/checkouts/SwiftFoundation--958978667/Sources/SwiftFoundation/FileDescriptor.swift:13:12: error: could not build C module 'CStatfs'
import CStatfs
^
error: terminated(1): /usr/bin/swift-build-tool -f /home/linaro/Swish/swift_program/.build/debug.yaml main output:
我的Package.swift文件:
// swift-tools-version:4.2
// The swift-tools-version declares the minimum version of Swift required to build this package.
import PackageDescription
let package = Package(
name: "swift_program",
dependencies: [
.package(url: "https://github.com/PureSwift/BluetoothLinux.git", .branch("master")),
.package(url: "https://github.com/PureSwift/GATT", .branch("master")),
.package(url: "https://github.com/PureSwift/SwiftFoundation.git", .branch("master"))
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages which this package depends on.
.target(
name: "swift_program",
dependencies: ["BluetoothLinux", "GATT", "SwiftFoundation"])
]
)
感谢任何帮助/建议。