Modern Apps git

xtool.git

Public
git clone https://git.maproj.org/xtool.git
main ▾

xtool.git / Sources / XToolSupport / UninstallCommand.swift

UninstallCommand.swift33 lines · 883 BRaw
1import XUtils
2import Foundation
3import XKit
4import SwiftyMobileDevice
5import ArgumentParser
6
7struct UninstallCommand: AsyncParsableCommand {
8 static let configuration = CommandConfiguration(
9 commandName: "uninstall",
10 abstract: "Uninstall an installed app"
11 )
12
13 @OptionGroup var connectionOptions: ConnectionOptions
14
15 @Argument(
16 help: "The app to uninstall"
17 ) var bundleID: String
18
19 func run() async throws {
20 let client = try await connectionOptions.client()
21 let installProxy = try InstallationProxyClient(device: client.device, label: "xtool-inst")
22 do {
23 try await installProxy.uninstall(
24 bundleID: bundleID,
25 progress: { _ in }
26 )
27 } catch {
28 d.out.print("Failed: \(error)")
29 return
30 }
31 d.out.print("Success!")
32 }
33}