Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to choose iPhone simulator model to debug Flutter app on Visual Studio Code?

How to choose iPhone model to debug a Flutter application using VSCode? Currently every time I debug an app, iPhoneX always starts, but I would like to choose another model, for example iPhone 8, how do I do this?

enter image description here

like image 567
Augusto Avatar asked Jul 27 '19 18:07

Augusto


People also ask

How do you debug a Flutter App on Iphone?

You need to go to your Settings > General > Device Management. Inside Device Management, select the developer name and tap Trust “YOUR DEVELOPER NAME”. You should now be able to run your Flutter app on your local device.

How do you run a Flutter code on iOS emulator?

Click on the Flutter Inspector from the right pane and click on 'Toggle Platform Mode' from the top menu of the newly opened box. This will change the UI of the running app on your device.


4 Answers

What worked for me was running flutter doctor in the terminal. it gave me the following output:

 [!] Xcode - develop for iOS and macOS
    ✗ Xcode installation is incomplete; a full installation is necessary for iOS development.
      Download at: https://developer.apple.com/xcode/download/
      Or install Xcode via the App Store.
      Once installed, run:
        sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
        sudo xcodebuild -runFirstLaunch

Xcode was installed previously, but after running the two commands, I was finally able to use the iOS Simulator in visual studio code.

like image 101
Adam Avatar answered Oct 14 '22 17:10

Adam


What I did was change the selected iOS device in the simulator, closing the simulator, then restarted my debugging session. The flutter app was then loaded on to the newly selected device.

I am using a Macbook Pro. So if you [right-click or two-button-click] the Simulator app -> select 'Device' -> select the iOS you want -> then select the desired device

like image 40
D'Ante Barnes Avatar answered Oct 29 '22 08:10

D'Ante Barnes


The Dart VS Code extention documentation here mentions a few ways to change the device that's used.

  1. Clicking on the currently selected device in the status bar enter image description here
  2. Executing the Flutter: Select Device command
  3. Pressing your custom key binding for the Flutter: Select Device command
like image 4
Jonathan Parker Avatar answered Oct 29 '22 09:10

Jonathan Parker


// 2022

Easy way to do this is start the simulator and from MacOS dock, right click on the simlator - > Device -> ios -> choose new simlator

enter image description here

like image 4
7MEU Avatar answered Oct 29 '22 07:10

7MEU