DEV Community

Damola Adekoya
Damola Adekoya

Posted on

10 3

How to run your flutter app on multiple emulator devices using vscode

How to run your flutter app on multiple emulator devices using vscode

Flutter is a cross-platform mobile framework i.e it support for both Android and iOS, developing flutter is so fascinating that you get to write once and run on both platform. in this post I will be showing how to run more than one emulator concurrently using Visual studio code, by default you can only run a single emulator at a time on a project. Thanks to super-fast hot reload and restart feature of flutter which makes development experience faster and better. But it would have been better if you can be testing/debugging your application as you are developing on both platforms devices without you have to wait for one device.

Steps

  • Create different emulator devices you want to run your application on. e.g iOS devices, Android device NB: I won't be showing how to create emulator devices

How to create Android and iOS emulator device .

  • Make sure all the devices are launched.i.e all devices for iOS and Android.

  • Get ID for all your devices, to get the device id run

    flutter devices

    on your terminal to get your device id. [screenshot below]

Screenshot 2020-05-10 at 7.18.03 PM.png

  • Create a launch configuration setting for your flutter project. [screenshot below]

Screenshot 2020-05-10 at 6.53.34 PM.png

  • Create a device profile for each of the devices in the launch.json
{
      "name": "iPad Pro",
      "request": "launch",
      "type": "dart",
      "deviceId": "CE96E50B-A047-40D9-9921-1359CA2CF231"

}

Enter fullscreen mode Exit fullscreen mode

NB:
name is the profile name i.e device name although it can be any name.
below is the sample configuration setting for my flutter app

{
  // Use IntelliSense to learn about possible attributes.
  // Hover to view descriptions of existing attributes.
  // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Flutter",
      "request": "launch",
      "type": "dart"
    },
    {
      "name": "Android",
      "request": "launch",
      "type": "dart",
      "deviceId": "emulator-5554"
    },
    {
      "name": "iPhone",
      "request": "launch",
      "type": "dart",
      "deviceId": "iPhone"
    },
    {
      "name": "iPad Pro",
      "request": "launch",
      "type": "dart",
      "deviceId": "CE96E50B-A047-40D9-9921-1359CA2CF231"
    }
  ],
  "compounds": [
    {
      "name": "All Devices",
      "configurations": ["Android", "iPhone", "iPad Pro"]
    }
  ]
}

Enter fullscreen mode Exit fullscreen mode
  • Screenshot 2020-05-10 at 7.36.17 PM.png

What is the Role of Obfuscation in Mobile App Protection?

What is the Role of Obfuscation in Mobile App Protection?

Attackers try to reverse engineer and tamper with apps by injecting malicious code to bypass features or steal user information. Obfuscation prevents reverse engineering by making it difficult for attackers to understand how an app functions.

Read more

Top comments (3)

Collapse
 
maximryabovol profile image
MaximRyabovol

Thank you very much! I managed to run the app on different platforms simultaneously (ios, android, web, macOS).

Collapse
 
blithegdv profile image
Hani

Thanks. But the "How to create Android and iOS emulator device" link is dead.

Collapse
 
devdammak profile image
Damola Adekoya

you can check this out:-

medium.com/@daspinola/setting-up-a......

Android Malware: How It Works and How to Protect Your App Against It

Android Malware: How It Works and How to Protect Your App Against It

Your Android app is on the front line and malware is getting smarter using repackaging, dynamic instrumentation, and code injection. Learn how obfuscation and RASP deter attacks, protect code, and secure in-app defenses with real time insights.

Watch now

👋 Kindness is contagious

Take a moment to explore this thoughtful article, beloved by the supportive DEV Community. Coders of every background are invited to share and elevate our collective know-how.

A heartfelt "thank you" can brighten someone's day—leave your appreciation below!

On DEV, sharing knowledge smooths our journey and tightens our community bonds. Enjoyed this? A quick thank you to the author is hugely appreciated.

Okay