swift3.0获取字符串的方法改变了 之前直接输入对应的索引就可以 现在需要String.Index 比如我要获取字符串从索引7开始 absoluteString.substring(from:absoluteString.index(absoluteString.startIndex, offsetBy: 7)) whereis 查询命令在什么路径 比如查询open命令在什么路径 whereis open NSTask类在Swift3.0换成Process类 利用open命令打开一个程序 let process = Process() process.launchPath = "/bin/bash" process.arguments = ["-c","open -a /Applications/Unarchiver.app \(ipaPath)"] process.launch() process.waitUntilExit() open命令打开APP一直提示不存在 因为名字有空格 我重新命名 问题解决 这应该不是长久之计 Swift3.0 Array类型转成String list.joined(separator: "/") open解压的命令 会获取不到数据 因为解压已经离开终端的范畴 所以需要休眠程序 等待解压完毕 sleep(0.25); 