如果电脑同时打开了多个模拟器,运行flutter项目时会让选择在那个模拟器上运行,我电脑上打开了俩模拟器,VS Code检测到,让选择一个执行run命令。
leon:hellow_world huanghaipo$ flutter run
More than one device connected; please specify a device with the '-d <deviceId>' flag, or use '-d all' to act on all devices.
连接了多个设备; 请指定带有“-d <deviceId>”标志的设备,或使用“-d all”对所有设备执行操作。
iPhone 5s • A11DBCFF-E260-492D-91BB-F8C7F1233CAE • ios • com.apple.CoreSimulator.SimRuntime.iOS-12-2 (simulator)
iPhone 8 • 8934C82E-6D26-43EA-9E40-5496FD001388 • ios • com.apple.CoreSimulator.SimRuntime.iOS-12-2 (simulator)
根据提示,选择要运行项目的设备id。
leon:hellow_world huanghaipo$ flutter run -d 8934C82E-6D26-43EA-9E40-5496FD001388
如果模拟器没有打开可以通过下方命令打开:
open -a Simulator
网友评论