简体   繁体   English

Flutter 应用程序:IOS 模拟器未连接到 Android Studio

[英]Flutter app : IOS emulator not connecting to Android Studio

In flutter development I want to connect iOS emulator to the android studio.在颤振开发中,我想将 iOS 模拟器连接到 android studio。

when I open iOS emulator from android studio It will open but app not run.当我从 android studio 打开 iOS 模拟器时它会打开但应用程序不会运行。 It give error like "No connected devices."它给出了“没有连接的设备”之类的错误。

Project is run from Xcode but from AndroidStidio in will not run项目是从 Xcode 运行的,但在 AndroidStidio 中不会运行

Which version I Use:我使用哪个版本:
1) macOS Mojave-10.14.5 1) macOS Mojave-10.14.5
2) AndroidStudio-3.4 2) AndroidStudio-3.4
3) Xcode-10.3 3) Xcode-10.3
4) FlutterSDK-1.7.8 4) FlutterSDK-1.7.8
5) Dart-2.4 5) Dart-2.4

在此处输入图片说明

Follow below steps按照以下步骤操作

Open Xcode打开 Xcode

Xcode -> Preference -> Locations -> Command Line Tools

Select Xcode your_xcode_version选择 Xcode your_xcode_version

Now go to Android studio and run flutter doctor现在去 Android Studio 并运行flutter doctor

Hope this one resolve your issue.希望这能解决您的问题。

您是否尝试在终端中执行flutter doctor命令以获取有关该问题的更多详细信息?

i have faced same issue. 我也遇到过同样的问题。 when I open ios emulator from android-studio the version is iphoneXr-12.4 which is not detected in android-studio. 当我从android-studio打开ios模拟器时,版本为iphoneXr-12.4,而在android-studio中未检测到。

but I have run iphoneXr-12.2 from Xcode it was detected by the android-studio.so i have set iphoneXr-12.2 as boot. 但是我已经从Xcode运行了iphoneXr-12.2,它被android-studio.so检测到,所以我将iphoneXr-12.2设置为启动。

so you can change boot emulator by using below commands. 因此,您可以使用以下命令更改启动模拟器。

First of all get iphoneXr-12.2 device UUID using : 首先使用以下命令获取iphoneXr-12.2设备UUID:

 xcrun simctl list

then run command with your UUID : 然后使用您的UUID运行命令:

xcrun simctl boot "YOUR DEVICE UUID"

you shoud path android studio select target sdk for exmple sdk version 28你应该路径android studio选择目标sdk作为例子sdk版本28

file -> project structure ->project -> project-sdk文件 -> 项目结构 -> 项目 -> project-sdk

select api version sdk选择api版本sdk

screen shot of select选择的屏幕截图

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM