Post

Replies

Boosts

Views

Activity

Xcode behave differently on SPM between Package project and iOS project.
I'm now developing a iOS project and a SPM package project, which both depend on another swift package stored in a private repo. Our private repo has a non-default ssh port, so for commandline tools, I configured like this: // .ssh/config Host repo.private.com User git Port 20022 IdentityFile ~/.ssh/id_rsa PreferredAuthentications publickey AddKeysToAgent yes And I modified defaults to disable xcode integrated git: defaults write com.apple.dt.Xcode IDEPackageSupportUseBuiltinSCM YES For the Package project, I can simply use: .package(url: "git@repo.private.com:some-repo.git", from: "0.0.1"), and it works well. But for iOS project, I tried to add the dependency, and finally find out I have to configure the port, then the project packages shows as: ssh://git@repo.private.com:20022/some-repo.git So does xcode treat these project differently and use different toolchains? Is it possible to configure xcode and make these situation behave exactly?
0
0
465
Mar ’24
A bug in Xcode lldb debugger for swift
In some particular situation, Xcode debugger or lldb cli cannot correctly extract some value that returned by a async throw function and handled by guard let try?. Here is the minimum example: import Dispatch func test() async throws -> [Int] {   return [369] } let group = DispatchGroup() group.enter() let task = Task {   guard let res = try? await test() else { return }   print(res)   group.leave() } group.wait() If added a break point at print(res), the debugger cannot show the value of res. Due to forum limitation, I cannot paste a screenshot here... if use p res or po res at lldb cli, it shows: (lldb) p res error: expression failed to parse: error: <EXPR>:3:1: error: cannot find 'res' in scope res ^~~ (lldb) po res error: expression failed to parse: error: <EXPR>:3:1: error: cannot find 'res' in scope res ^~~ If test() returns a dict, or a costom struct, the issue retains. But if returned a trivial value like Int, it acts normally. Also, if remove the guard statement, make res a optional value(use let res = try? await test()), debugger can extract the value. Above results are compiled and run in this environment: Swift 5.6.1 Xcode 13.4.1 (13F100) lldb-1316.0.9.46 macOS 12.4 x86_64 arch
5
3
4.2k
Jul ’22
Use Network Extension for VPN on iOS
I'm trying to use Network Extension to develop a VPN tool for iOS devices. I used a NETunnelProviderManager to create VPN configuration and created extension target conaining a subclass of NEPacketTunnelProvider. But when I use NETunnelProviderManager.connection.startVPNTunnel() to enable the extension, I got a error output: "Failed to fetch info with type 2: Connection interrupted". I checked my entitlements for both app and extension and they both contains PacketTunnel capability. And the info.plist for extension is correct with a principal class $(PRODUCT_MODULE_NAME).PacketTunnelProvider (which is identical to my provider class). I want to know which configuration could cause the problem and how can I fix it. Thank for any helping.
0
0
554
Jun ’22