//從git上clone
1岛蚤、打開命令行窗口细溅,輸入以下命令
git clone -b beta https://github.com/flutter/flutter.git?
2、配置環(huán)境變量
2.1 sudo vi .bash_profile, 按i進(jìn)入編輯模式柿汛,輸入export PATH=`pwd`/flutter/bin:$PATH盾戴,并按ESC,再輸入:wq斩祭, 保存退出
3劣像、輸入flutter doctor 檢查安裝缺失相,按提示摧玫,進(jìn)行相應(yīng)安裝
若執(zhí)行flutter doctor出現(xiàn)以下錯誤:
?Unhandled exception:
Exception: idevice_id returned an error:
#0? ? ? IMobileDevice.getInfoForDevice (package:flutter_tools/src/ios/mac.dart:122:9)
<asynchronous suspension>
#1? ? ? IOSDevice.getAttachedDevices (package:flutter_tools/src/ios/devices.dart:152:53)
<asynchronous suspension>
#2? ? ? IOSDevices.pollingGetDevices (package:flutter_tools/src/ios/devices.dart:112:57)
#3? ? ? PollingDeviceDiscovery.devices (package:flutter_tools/src/device.dart:163:52)
<asynchronous suspension>
#4? ? ? DeviceManager.getAllConnectedDevices (package:flutter_tools/src/device.dart:91:46)
<asynchronous suspension>
#5? ? ? DeviceValidator.validate (package:flutter_tools/src/doctor.dart:677:54)
<asynchronous suspension>
#6? ? ? Doctor.startValidatorTasks (package:flutter_tools/src/doctor.dart:107:52)
#7? ? ? Doctor.diagnose (package:flutter_tools/src/doctor.dart:174:41)
#8? ? ? _AsyncAwaitCompleter.start (dart:async/runtime/libasync_patch.dart:49:6)
#9? ? ? Doctor.diagnose (package:flutter_tools/src/doctor.dart:164:24)
#10? ? DoctorCommand.runCommand (package:flutter_tools/src/commands/doctor.dart:29:39)
#11? ? _AsyncAwaitCompleter.start (dart:async/runtime/libasync_patch.dart:49:6)
#12? ? DoctorCommand.runCommand (package:flutter_tools/src/commands/doctor.dart:28:42)
#13? ? FlutterCommand.verifyThenRunCommand (package:flutter_tools/src/runner/flutter_command.dart:383:18)
#14? ? _asyncThenWrapperHelper.<anonymous closure> (dart:async/runtime/libasync_patch.dart:77:64)
#15? ? _rootRunUnary (dart:async/zone.dart:1132:38)
#16? ? _CustomZone.runUnary (dart:async/zone.dart:1029:19)
#17? ? _FutureListener.handleValue (dart:async/future_impl.dart:129:18)
#18? ? Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:642:45)
#19? ? Future._propagateToListeners (dart:async/future_impl.dart:671:32)
#20? ? Future._complete (dart:async/future_impl.dart:476:7)
#21? ? _SyncCompleter.complete (dart:async/future_impl.dart:51:12)
#22? ? _AsyncAwaitCompleter.complete.<anonymous closure> (dart:async/runtime/libasync_patch.dart:33:20)
#23? ? _rootRun (dart:async/zone.dart:1124:13)
#24? ? _CustomZone.run (dart:async/zone.dart:1021:19)
#25? ? _CustomZone.bindCallback.<anonymous closure> (dart:async/zone.dart:947:23)
#26? ? _microtaskLoop (dart:async/schedule_microtask.dart:41:21)
#27? ? _startMicrotaskLoop (dart:async/schedule_microtask.dart:50:5)
#28? ? _runPendingImmediateCallback (dart:isolate/runtime/libisolate_patch.dart:115:13)
#29? ? _RawReceivePortImpl._handleMessage (dart:isolate/runtime/libisolate_patch.dart:172:5)
此時可以依次執(zhí)行以下命令解決:
brew uninstall ideviceinstaller
brew uninstall libimobiledevice
brew install --HEAD libimobiledevice
brew link --overwrite libimobiledevice
brew install --HEAD ideviceinstaller
brew link --overwrite ideviceinstaller