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?
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.
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.
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.
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
The Dart VS Code extention documentation here mentions a few ways to change the device that's used.
// 2022
Easy way to do this is start the simulator and from MacOS dock, right click on the simlator - > Device -> ios -> choose new simlator
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With