@@ -59,23 +59,23 @@ class Dump {
5959 consoleIO. writeMessage ( " Can't find machO name. " , to: . error)
6060 return
6161 }
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- }
62+ #if os(OSX)
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 )
7776 }
7877 }
78+ #endif
7979 needDumpFilePaths. append ( sourceUrl+ " / " + item+ " / " + machOName)
8080 dumpedFilePaths. append ( targetUrl+ " / " + item+ " / " + machOName)
8181 }
0 commit comments