I just create an app from flutter with demo application, I didn't add anything, just run
1
flutter create app_test_001
2
flutter create .
3
flutter build ios --release
When I run the emulator, it shows the default simple application
and when I run it on my iphone it gets the white screen
Result on emulador
Result in real device
Try this:
Make sure everything is right flutter doctor
Restart your computer
Check if your mobile device is updated
Also, these issues can relate: https://github.com/flutter/flutter/issues/18409
Related
So i'm testing a flutter app that builds and installs successfully on an iOS simulator as well as a physical devices. However, when building and installing the app with xcode via the USB, it successfully installs and launches but when the USB is disconnected from my mac and i try to run the already installed device on the iPhone, it shows only the launch / splash screen and fades and closes.
Is there something i'm doing wrong that causes this to happen? As the app works fine when connected with the USB and it's being run.
If the build is in debug mode - it won't open.
if you want to open application after disconnecting, try profile / release mode
flutter run --profile
or
flutter run --release
In iOS, debug build doesn't work without USB. To use the app without USB trying making a release build using flutter run --release
I'm working on a Flutter project, and when I run the project with the Andriod emulator it works fine, but when I try the iOS emulator it takes forever (or maybe never) to run and the debug console shows "Launching lib/main.dart on iPhone 11 in debug mode.."
I tried the iOS emulator with another project and its works without any problems.
Try flutter clean and flutter build ios in android studio before opening project in xcode. After successful build open the project in XCode and run in emulator.
As akdev answered that steps are necessary but if you added any plugin to your flutter app then also go to iOS folder using cd ios and use pod install hope this works.
I have a perfectly working Xcode (at least for Swift iOS projects), today I tried to install flutter.
I followed the steps from here: FlutterDev (every step, so the solution is not here)
I can build and run Flutter projects in terminal on Simulator on iPhones and Android Virtual Devices as well.
Flutter doctor found everything OK.
But I can't run it on any physical Apple device. Tested on 2 MacBook Pros -> deploying to 3 different iPhones.
I got SIGABRT error right after the app tried to launch if I run the from Xcode, and the terminal stuck in installing and launching... if I try to run the app from there.
Terminal
Xcode
Maybe you should just try these steps:
1) flutter clean
2) flutter build ios --release
Then later do this in Xcode MenuBar: Product -> Clean and then build in Xcode
It is a bug from Flutter. Instead switch the channel:
flutter channel dev
flutter upgrade
flutter run
But remember: The dev channel is far ahead of the stable one, it is little less safe. I would recommend you to use it just for running the app on your device. For coding etc. switch back to the stable channel:
flutter channel stable
flutter upgrade
The bug will be fixed in v1.15.3.
After I've spent my day troubleshooting the only solution that worked for me is to download xcode beta, the newest 13.4 iOS beta and then everything worked immediately. I opened the existing projects, hit run and opened on my phone without any extra steps.
Here's my Environment
Xcode Version: 11.1 (11A1027)
Physical device: - iPad mini 2 (IOS 12.4.2)
VSCode Version: 1.39.2
Flutter version: 1.9.1+hotfix.6
When I use the iOS part of the Flutter project and run it physical device using XCode, it detects the device and works fine but I am somehow not able to see the device on the available devices section on VSCode.
However VSCode detects and works fine with the simulator.
I also ran flutter doctor to see connected devices, but again it does not show the connected physical devices but shows the simulator created device.
Use rm -rf <flutter_repo_directory>/bin/cache to force delete the files in cache and then flutter doctor -v to reinstall the missing sdk directories.
Deleting the cache in flutter/bin/cache directory and then reinstalling the dart sdk solved this issue.
Referred to this issue in Flutter repository(Issue No:41006).
I had the same issue. In my case, a recent iOS update had turned off Developer mode, for some reason... So I needed to enable it again (Settings - Privacy & Security - Developer Mode).
iPadOS / iOS Devices Setup for Hot Reload
Before trying to flutter Debug on physical device from Vscode it is Required to first :
Run a successful Xcode build on that iOS or iPadOS device
Follow this steps if you don't know how to Run Xcode Build -> your device should then be detected by flutter :
Open Xcode & do all the classic Set Up (Signing in with a Team & choosing a UNIQUE bundle Identifier)
Set Your iPhone Auto-Lock to Never (& Unlock it !) - Connect your iPhone or iPad to Mac with USB cable & Accept Prompt on the iPhone
Run Xcode Build on your iPhone this alert prompt will select Ok
On your iPhone a new menu will have appeared - Navigate to it & Click « Verify App » or « Accept »
Now Run Xcode Build Again - if does not run try running flutter clean & flutter build ios & try running again
—
After Successful Xcode Build - Stop Running the App
Keep Xcode Open
— iOS Setup is done
Close all Simulators or Emulators - Close VsCode
run flutter devices to make sure your Device is now detected
if it’s not try Turning it off & plugging it back again - remember to accept Trust Computer Prompt - keep it device unlocked too !
Open back your project in VsCode or Android Studio
Hot Reload⚡️Using VsCode :
Press F8 or Select ▷ « Start Debugging » in main.dart
That’s it ! You now have the power of Hot Reload⚡️ with VsCode on a physical device !
Hot Reload using Terminal Commands :
run flutter run -d yourDeviceID
Have fun ! Press r in Terminal for HotReload⚡️
If you need to find your iOS device ID :
Select Add Additional Simulators
Hot Reload⚡️on Android Studio :
Select your device & run
All I had to do was to disconnect the device from the laptop, make sure VS Code is open, then connect the device again while no VS Code, then it detected right away and chose the device automatically.
Sometimes it doesn't detect the device if it is not directly connected to the computer. I had a docking station in between and it didn't recognized the device. Especially after you have updated you macOS just before.
With "focus mode" activated on the device (like "do not disturb" 🌙) it won't show up.
Check whether you have fully installed xcode by running flutter doctor -v
Incase you find that some thing like
[!] 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.
just run install Xcode and run
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
sudo xcodebuild -runFirstLaunch
Incase you installed xcode already, just run the above commands, they will do the magic.
I want to test a release build of my Flutter 1.9 iOS app on my iPhone without going through the App Store. The development build from IntelliJ runs just fine on my iPhone, but I want to see the real performance characteristics.
The Flutter documentation describes how to build a release version of the app. This creates build/ios/iphoneos/Runner.app in my project. But how can I get Runner.app from my Mac onto my iPhone?
With flutter run --release -d [device name], you can run the Flutter app in release mode either in a simulator or on a real device. Thank you, Chenna Reddy!