Nizzam
Nizzam

Reputation: 1050

Flutter : How to specify a device id in flutter?

How to select a device id in flutter run?

please specify a device with the '-d ' flag, or use '-d all' to act on all devices

iPhone 6      • 54XXXXXX35130ebefd38f • ios • iOS 10.3.3
iPhone 7 Plus • BA8CXXXXXXD0-577D675d • ios • iOS 11.2 (simulator)

Upvotes: 48

Views: 39134

Answers (4)

Juan Aguillón
Juan Aguillón

Reputation: 369

If you need to open on simulator, try this:

  1. Get all devices available xcrun simctl list Output can be like this

    == Devices ==
    -- iOS 13.5 --
    iPhone 8 (21DB8D2B-F71B-4D91-AB56-FD64A20CEEE7) (Shutdown)
    iPhone 8 Plus (D4AA1ABE-D40B-437D-9373-9AF89F2A4951) (Shutdown)
    iPhone 11 (44CE162D-D077-4165-BE44-33DE723FDBAB) (Shutdown)
    
  2. Set the desired device xcrun simctl boot 21DB**** ( For iPhone 8)

  3. Run flutter flutter run

If no open any simulator, run open -a Simulator

Upvotes: 7

flutter run -d "Iphone 6"

Test on MacOS High Sierra (

Upvotes: 34

Md Abdul Halim Rafi
Md Abdul Halim Rafi

Reputation: 1980

use the command on the terminal of android studio -

#flutter run -d "device name or id"

if the device name contains blank space it throws an error, so using device ID is better...

for example in my case the device ID was-

#flutter run -d 590******140

and it worked :)

Upvotes: 11

ap14
ap14

Reputation: 4741

Simply use

flutter run -d iPhone 6

For me this also works fine

flutter run -d BA8CXXXXXXD0-577D675d

Upvotes: 61

Related Questions