Files
xtool-mirror/Sources/XToolSupport/UninstallCommand.swift
Kabir Oberai 0425f9edeb Add SwiftLint (#104)
Closes #72
2025-05-31 19:38:57 +05:30

33 lines
857 B
Swift

import Foundation
import XKit
import SwiftyMobileDevice
import ArgumentParser
struct UninstallCommand: AsyncParsableCommand {
static let configuration = CommandConfiguration(
commandName: "uninstall",
abstract: "Uninstall an installed app"
)
@OptionGroup var connectionOptions: ConnectionOptions
@Argument(
help: "The app to uninstall"
) var bundleID: String
func run() async throws {
let client = try await connectionOptions.client()
let installProxy = try InstallationProxyClient(device: client.device, label: "xtool-inst")
do {
try await installProxy.uninstall(
bundleID: bundleID,
progress: { _ in }
)
} catch {
print("Failed: \(error)")
return
}
print("Success!")
}
}