I'm unable to test my flutter application on VSCode which is running on catalina on vitual box.
After launching application from VSCode, I am just getting single line error Error launching application on Najam’s iPhone.
and then application is opening in the device but it is then disconnected with VSCode
Launching lib/main.dart on Najam’s iPhone in debug mode...
Automatically signing iOS for device deployment using specified development team in Xcode project: H5PHS46J86
Running pod install... 277.5s
Running Xcode build...
└─Compiling, linking and signing... 114.5s
Xcode build done. 346.8s
Installing and launching... 59.8s
Error launching application on Najam’s iPhone.
What I've tried
As suggested here https://github.com/flutter/flutter/issues/69632#issuecomment-803646337, I tried below solution but it didn't work for me
- Setting
platform to 10.0
inside the Podfile (platform :ios, '10.0' )- Doing a combination of
flutter clean
,pod cache clean --all
andpod install
I also tried this solution too https://stackoverflow.com/a/64661277/7290043. But it didn't work either.
flutter clean pod cache clean --all
rm -rf ios/Flutter/Flutter.framework
flutter pub get
pod install
flutter run
What should I do?
To test or deploy our flutter app to a physical device we first need to enable physical device deployment in Xcode using Apple ID or an Apple Developer account. And we also need to set up a package manager to manage flutter plugins that are to be used in the project.
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.
Flutter is a multi-platform application development framework that enables you, among other platforms, to develop iOS and Android apps from the same source code. However, you need to use Xcode to build an iOS app and Xcode will only work on macOS.
Flutter is designed to support mobile apps that run on both Android and iOS, as well as interactive apps that you want to run on your web pages or on the desktop.
The time to launch is very long. What type of machine are you building on? VSCode debugging might just be timing out. Try running directly from xcode and a) see if it remains connected, and b) see if any further errors are reported
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