mirror of
https://github.com/xtool-org/xtool.git
synced 2026-02-04 11:53:30 +01:00
33 lines
861 B
Swift
33 lines
861 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!")
|
|
}
|
|
}
|