Skip to content

Commit a0e988c

Browse files
Run otool when launched to prompt command line tools installation
1 parent 8e26d40 commit a0e988c

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

CatalystDetect/ContentView.swift

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ struct ContentView: View {
4343
.padding()
4444
}
4545
.padding()
46+
.onAppear {
47+
runOtool()
48+
}
4649
}
4750

4851
private func handleDrop(_ providers: [NSItemProvider]) -> Bool {
@@ -121,6 +124,18 @@ struct ContentView: View {
121124
return output.contains("/System/iOSSupport/")
122125
}
123126

127+
private func runOtool() {
128+
let process = Process()
129+
process.launchPath = "/usr/bin/otool"
130+
131+
let pipe = Pipe()
132+
process.standardOutput = pipe
133+
process.launch()
134+
135+
let data = pipe.fileHandleForReading.readDataToEndOfFile()
136+
process.waitUntilExit()
137+
}
138+
124139
private func extractAppIcon() {
125140
let contentsPath = "\(appPath)/Contents"
126141
let infoPlistPath = "\(contentsPath)/Info.plist"

0 commit comments

Comments
 (0)