[Flutter/iOS] Run a project on a physical iPhone from VSCode. (Hot reload available) & wireless connection
As a person who started programming mobile applications with Android Native, it's quite tought to be familiar with Xcode. When it comes to a development tool for a flutter project, VSCode is the best and perfect choice. Let's try to reload and debug a project in a (troublesome) physical iPhone directly built from VSCode.
1) Connect your real physical iPhone using a USB cable.
2) Open your [project_name].xcworkspace in [ios] - [your project].
3) Your iphone is connected to Xcode. (It should appear next to [Runner] with its icon)
⭐️ Make sure to agree or trust all kind of messages popped up during the process.
4) Enable "Automatically manage signing" in [Runner] - [Targets] - [Signing & Capabilites] - [Signing].
🐥 If you only see a file instead of the setting menu below when clicking [Runner], please check [Hide Code Review] under [View] in the menu bar.
5) Build a project in Xcode.
6) Return to VScode and select your physical iPhone.
7) You probably see an "iproxy" warning message upon running a project.
8) Navigate to the directory where you have installed the flutter sdk. (Command "flutter doctor -v" to know its path)
9) Delete [artifacts] directory inside [flutter] - [bin] - [cache].
10) Rerun a project.
Now you can easily verify and debug physical-device-limited functions to ensure they are working correctly :=) ! 🤗
👻 How to connect a physical iPhone WIRELESSLY ?
1) Open your Xcode and navigate to [Window] - [Devices and Simulators] in the navigation bar.
2) Enable "Connect via network".
3) Restart Xcode and repeat the steps above. Right cllick of your physical device and select "Connect via IP Address" where you should enter your IP information. Ensure that your physical device and computer are connected to the SAME IP.
4) Run a project.
😮 Wireless debugging via VSCode is available for the flutter version above 3.10.0!!!