Flutter-intellij: FR: Add ability to change iOS Simulator version (X, XR, 6s, etc.) from Android Studio

Created on 31 Dec 2018  Â·  7Comments  Â·  Source: flutter/flutter-intellij

I am using Android Studio and I can see Open iOS Simulator option in the toolbar, when I tap on it, it always launches iPhone XR simulator.

Is there any way to change the simulator from Android Studio, I know I can open the Xcode and choose the simulator from the list and then come back to Android Studio and select it, but I was looking for a way so that I can set Simulator in Xcode and next time I tap Open iOS Simulator, I am presented with the simulator I selected in Xcode in the last run.

Flutter Doctor

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v1.0.1-pre.1, on Mac OS X 10.14 18A389, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
[✓] Android Studio (version 3.2)
[!] Connected device
    ! No devices available

! Doctor found issues in 1 category.

Most helpful comment

the Simulator menu changes to "File" -> Open Device, there are

  • iOS
  • tvOS
  • watchOS

under each item, you may choose the device your want.

All 7 comments

@dark-chocolate
Now, there is an alternative to achieve this. That is, we can launch simulator manually, just simulator by spotlight. Once changed to simulator XX, it will open XX as default the next time. Once simulator is launched, it will be available from the flutter-intellij plugin.

I had selected iPhone 5s from Xcode, run the app, exited the simulator.
And now if I do spotlight search for simulator it agains opens the Android Studio one (iPhone XR), but it should have opened the last one (iPhone 5s). Did I do thing correctly, or I missed something?

This is how it works on my mac.

  1. Open simulator using "spotlight"
    2.Using the device menu for "simulator" to change it to "Ipad pro"
    3.Close the other simulator but "Ipad pro"
    4.Close ipad pro.(No simulator instances now)
    5.Open Simulator from spotlight, it opens ipad pro.

@dark-chocolate

Thank you so much. Really appreciate it.

@kangwang1988 I am sorry, it isn't working anymore, probably an update of Android Studio did that, or what.

Here if my flutter doctor

[✓] Flutter (Channel dev, v1.6.0, on Mac OS X 10.14 18A389, locale en-GB)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
[✓] Android Studio (version 3.4)
[✓] Connected device (1 available)

• No issues found!

Alternatively you can set you own configuration using your simulator id
to find your the simulator id enter this in the terminal: xcrun simctl list

```{
"version": "0.2.0",
"configurations": [
{
"name": "Flutter",
"request": "launch",
"type": "dart"
},
{
"name": "Android",
"request": "launch",
"type": "dart",
"deviceId": "android"
},
{
"name": "iPhone",
"request": "launch",
"type": "dart",
"deviceId": "iPhone"
},
{
"name": "iPhone 11",
"request": "launch",
"type": "dart",
"deviceId": "C5017F40-EA5A-428E-8C41-8F8C346C0A39"
},
],
"compounds": [
{
"name": "All Devices",
"configurations": ["Android", "iPhone", "iPhone 11"],
}
]
}

the Simulator menu changes to "File" -> Open Device, there are

  • iOS
  • tvOS
  • watchOS

under each item, you may choose the device your want.

Was this page helpful?
0 / 5 - 0 ratings