Files
VirtualBuddy/Packages/MacDebugProtocol/Tests/MacDebugProtocolTests/EmbeddedProfilesTests.swift
Guilherme Rambo aabca5342d Xcode app provisioning (#823)
* Automatic provisioning of Mac apps launched via Xcode

* Improve Xcode integration sheet UI

* Security: harden local debugging socket and Xcode tool usage

* Soften rule around Xcode MCP use and xcodebuild prohibition

* Security: harden App Store Connect API key storage and access

* Fix debugged app incorrectly detected as not provisioned due to wildcard matching in provisioning profile

* Add previews for provisioning and debugging UI elements

* Disambiguate virtual machine vs. host Mac in provisioning and signing team management UIs

* Make Xcode debugging setup accessible from the Guest menu

* Completely disable debugging socket when developer features disabled, fix socket dying on accept failure

* Add versioning to scheme bindings, refer to VirtualBuddy components by a stable symlinked location, store scheme URLs so that app can potentially migrate schemes in the future

* Delay showing provisioning sheet so that an app that's already provisioned for the VM doesn't trigger it
2026-11-24 17:46:23 -03:00

25 lines
1.3 KiB
Swift

import Foundation
import Testing
@testable import MacDebugProtocol
struct EmbeddedProfilesTests {
@Test func findsNestedBundlesWithoutTraversingSymlinkedDirectories() async throws {
try await DebugTools.withTemporaryDirectory { root in
let app = root.appendingPathComponent("Main.app")
let paths = ["Main.app/Contents", "Main.app/Contents/PlugIns/Example.appex/Contents",
"Main.app/Contents/Library/LoginItems/Helper.app/Contents", "Outside.app/Contents"]
for path in paths {
let directory = root.appendingPathComponent(path)
try DebugTools.directory(directory)
try Data().write(to: directory.appendingPathComponent("embedded.provisionprofile"))
}
try FileManager.default.createSymbolicLink(at: app.appendingPathComponent("Contents/Other.app"),
withDestinationURL: root.appendingPathComponent("Outside.app"))
let profiles = try EmbeddedProfiles.find(in: app)
#expect(profiles.count == 3)
let expected = paths.dropLast().map { root.appendingPathComponent($0 + "/embedded.provisionprofile").resolvingSymlinksInPath().standardizedFileURL.path }
#expect(Set(profiles.map(\.path)) == Set(expected))
}
}
}