Find trust store
This commit is contained in:
parent
dab1963191
commit
a0e2298e69
|
@ -32,6 +32,10 @@ struct ListDevicesCommand: Command {
|
||||||
print("\(runtime):")
|
print("\(runtime):")
|
||||||
for device in filteredDevices {
|
for device in filteredDevices {
|
||||||
print(" - \(device.name)")
|
print(" - \(device.name)")
|
||||||
|
let trustStore = TrustStore(uuid: device.udid)
|
||||||
|
if trustStore.exists {
|
||||||
|
print(" - Trust store exists at \(trustStore.path)")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,17 @@
|
||||||
//
|
|
||||||
// TrustStore.swift
|
|
||||||
// XcodeSimulatorKit
|
|
||||||
//
|
|
||||||
// Created by Simon Kågedal Reimer on 2019-05-05.
|
|
||||||
//
|
|
||||||
|
|
||||||
import Foundation
|
import Foundation
|
||||||
|
import Basic
|
||||||
|
import SQLite
|
||||||
|
|
||||||
|
struct TrustStore {
|
||||||
|
let uuid: String
|
||||||
|
let path: AbsolutePath
|
||||||
|
|
||||||
|
init(uuid: String) {
|
||||||
|
self.uuid = uuid
|
||||||
|
self.path = XcodeSimulator.trustStore(forDeviceWithUUID: uuid)
|
||||||
|
}
|
||||||
|
|
||||||
|
var exists: Bool {
|
||||||
|
return localFileSystem.exists(path)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -1,2 +1,17 @@
|
||||||
|
import Basic
|
||||||
|
|
||||||
class XcodeSimulator {
|
class XcodeSimulator {
|
||||||
|
static let devicesDirectory = localFileSystem.homeDirectory.appending(
|
||||||
|
RelativePath("Library/Developer/CoreSimulator/Devices")
|
||||||
|
)
|
||||||
|
|
||||||
|
static func directory(forDeviceWithUUID uuid: String) -> AbsolutePath {
|
||||||
|
return devicesDirectory.appending(component: uuid)
|
||||||
|
}
|
||||||
|
|
||||||
|
static func trustStore(forDeviceWithUUID uuid: String) -> AbsolutePath {
|
||||||
|
return directory(forDeviceWithUUID: uuid).appending(
|
||||||
|
RelativePath("data/Library/Keychains/TrustStore.sqlite3")
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue