I made a flutter app and tried to build on iPhone. It works while debugging is connected. But if I try to exit and relaunch the app or disconnect cable, it would not launch again and keeps crashing.
How can I use the app while Xcode debugging is disconnected?
Question posted in Xcode
Whether you're new to Xcode or an experienced developer, our archive has everything you need to know about this integrated development environment (IDE). From basic functionalities to advanced features, our archive covers a wide range of Xcode-related questions and answers. Browse our archive now and find solutions to your Xcode questions, and take your app development skills to the next level
Whether you're new to Xcode or an experienced developer, our archive has everything you need to know about this integrated development environment (IDE). From basic functionalities to advanced features, our archive covers a wide range of Xcode-related questions and answers. Browse our archive now and find solutions to your Xcode questions, and take your app development skills to the next level
5
Answers
Run
flutter run --release
in the terminal and that’ll allow you to run a production version app on your iOS device without debugging connected.If you only
Start Debugging
after this you can disconnect cable and will work. If you afterRestart Debugging
after this if you disconnect cable app will be crashing. I think you restart debugging.From Xcode, you can change the Build Configuration of the Run Schema easily. To do this, click on Runner -> Edit Scheme, then go in the Run tab, choose "Release" in the Build Configuration drop down menu. To install the application, run the configuration again.
See Step 4 in this page for screenshots.
Assuming you can already able to debug with cable.
flutter build ios
flutter install
, if more than 1 device option is available, terminal will prompt you to choose the device for installation.Its not possible for now, you should build app only on Release mode (from XCode) to make it run on Physical phone.