简体   繁体   English

如何同时在 Android 和 IOS 模拟器中查看我的 flutter 应用程序 output?

[英]How can i see my flutter app output in both Android and IOS simulator simultaneously?

I am using the android studio to develop flutter application, I want to know is there any way I can see my app output in both android and ios simulator also I can perform hot reload on both simulator? I am using the android studio to develop flutter application, I want to know is there any way I can see my app output in both android and ios simulator also I can perform hot reload on both simulator?

To debug multiple devices concurrently you should set up a launch config for each device that has the deviceId fieldset (this is the same ID you'd pass to flutter run -d xxx).要同时调试多个设备,您应该为具有 deviceId 字段集的每个设备设置一个启动配置(这是您传递给 flutter run -d xxx 的同一 ID)。 Open the launch config by clicking Debug -> Open Configurations.通过单击 Debug -> Open Configurations 打开启动配置。 Add a compound config at the bottom that will launch both (or more) configurations at the same time:在底部添加一个复合配置,它将同时启动两个(或多个)配置:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Current Device",
            "request": "launch",
            "type": "dart"
        },
        {
            "name": "Android",
            "request": "launch",
            "type": "dart",
            "deviceId": "android"
        },
        {
            "name": "iPhone",
            "request": "launch",
            "type": "dart",
            "deviceId": "iphone"
        },
    ],
    "compounds": [
        {
            "name": "All Devices",
            "configurations": ["Android", "iPhone"],
        }
    ]
}

Selecting the compound config on the Debug side bar and clicking Debug -> Start Debugging (or Start Without Debugging) will launched debug sessions for each device at the same time.选择 Debug 侧栏上的复合配置并单击 Debug -> Start Debugging(或 Start without Debugging)将同时为每个设备启动调试会话。

Yes, there is a way to do that First install android and ios simulator and one by one Flutter run after that when both simulators are running.是的,有办法做到这一点首先安装 android 和 ios 模拟器,然后在两个模拟器都运行时一个接一个Flutter run运行。 you can Hot reload from here.你可以从这里Hot reload

在此处输入图像描述

and if you are looking for running both simultaneously then just then select all available devices and run your command.如果您正在寻找同时运行两者,那么就在 select 所有可用设备上运行您的命令。 flutter run

Finally, I found a command to run an app in both Ios and Android simulator.最后,我找到了在 Ios 和 Android 模拟器中运行应用程序的命令。

write below command in a terminal where your app is located在您的应用所在的终端中写入以下命令

flutter run -d all

You can press r keyword in terminal to do hot reload.您可以在终端中按 r 关键字进行热重载。

在此处输入图像描述

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

相关问题 无法在 ios 模拟器上运行我的 flutter 应用程序 - Can't run my flutter app on an ios simulator iOS模拟器:如何查看后台应用程序? - iOS simulator : How can I see the background apps? 为我的 flutter 应用程序运行 IOS 模拟器时出现问题 - Problem with running IOS simulator for my flutter app 我的 Flutter 应用程序拒绝在 IOS 模拟器上运行 - My Flutter app refuses to run on an IOS Simulator Flutter 应用程序在启动时崩溃(仅 IOS,模拟器和真机都有) - Flutter app crash on startup (only IOS, both simulator and real device) 如何在XCode 6 iOS模拟器中运行/录制iOS应用程序? - How can I run / record an iOS app in the XCode 6 iOS Simulator? 如何在iOS 10模拟器上运行以Xcode 7.3.1编译的应用 - How can I run my app compiled in Xcode 7.3.1 on the iOS 10 Simulator 我如何在iPhone应用程序中同时支持iOS 4.X SDK和iOS 5 SDK? - How can I support both iOS 4.X SDK and iOS 5 SDK in my iPhone app? 无法在 ios 模拟器上运行我的 flutter 应用程序,该模拟器在 android 模拟器上完美运行。 运行 pod install 时出错 - Unable to run my flutter app on ios simulator which is working perfectly on android simulator. Error running pod install flutter ios:xcode 看不到我的 podfile - flutter ios: xcode can not see my podfile
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM