Skip to content

armgit / xtool

Public Imported from GitHub
0

Cross-platform Xcode replacement. Build and deploy iOS apps with SwiftPM on Linux, Windows, macOS.

883 B
Raw Blame
import XUtils
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 {
            d.out.print("Failed: \(error)")
            return
        }
        d.out.print("Success!")
    }
}