@@ -59,19 +59,21 @@ class Dump {
5959 consoleIO. writeMessage ( " Can't find machO name. " , to: . error)
6060 return
6161 }
62- let machOFile = sourceUrl+ " / " + item+ " / " + machOName
63- let task = Process ( )
64- task. launchPath = " /usr/bin/otool "
65- task. arguments = [ " -l " , machOFile]
66- let pipe = Pipe ( )
67- task. standardOutput = pipe
68- task. launch ( )
69- let data = pipe. fileHandleForReading. readDataToEndOfFile ( )
70- if let output = String ( data: data, encoding: String . Encoding. utf8) {
71- if output. contains ( " platform 2 " ) {
72- consoleIO. writeMessage ( " This app not support dump on M1 Mac. Because machO PLATFORM is IOS! " )
73- do { try fileManager. removeItem ( atPath: targetUrl) } catch { }
74- exit ( - 10 )
62+ if #available( macOS 11 . 0 , * ) {
63+ let machOFile = sourceUrl+ " / " + item+ " / " + machOName
64+ let task = Process ( )
65+ task. launchPath = " /usr/bin/otool "
66+ task. arguments = [ " -l " , machOFile]
67+ let pipe = Pipe ( )
68+ task. standardOutput = pipe
69+ task. launch ( )
70+ let data = pipe. fileHandleForReading. readDataToEndOfFile ( )
71+ if let output = String ( data: data, encoding: String . Encoding. utf8) {
72+ if output. contains ( " LC_VERSION_MIN_IPHONEOS " ) || output. contains ( " platform 2 " ) {
73+ consoleIO. writeMessage ( " This app not support dump on M1 Mac. Because machO PLATFORM is IOS! " )
74+ do { try fileManager. removeItem ( atPath: targetUrl) } catch { }
75+ exit ( - 10 )
76+ }
7577 }
7678 }
7779 needDumpFilePaths. append ( sourceUrl+ " / " + item+ " / " + machOName)
0 commit comments