You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/testing-deployment-publishing/running-your-app/local-run.md
+46-10Lines changed: 46 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,7 +65,7 @@ Here are the steps to use local run:
65
65
66
66

67
67
68
-
7. From the test menu, click on the **Get Devices** button. This will list devices connected to your system. You can add or remove devices from the list by clicking on the **+** and **-** buttons, respectively. Once you've finalized your selection, simply click on the **Test** button to see your app running on selected devices. **Tip**: In the Mac OS desktop app, you can directly open the simulator by clicking on the **Launch iOS Simulator** text.
68
+
7. From the test menu, click on the **Get Devices** button. This will list devices connected to your system. You can add or remove devices from the list by clicking on the **+** and **-** buttons, respectively. Once you've finalized your selection, simply click on the **Test** button to see your app running on selected devices. **Tip**: In the Mac OS desktop app, you can directly open the simulator by clicking on the **Launch iOS Simulator** text. To test app on a real device, see how to [setup a physical device](#setup-physical-device).
69
69
70
70
<div style={{
71
71
position: 'relative',
@@ -101,15 +101,47 @@ and reloads the entire app, resetting its state. For more info, you can visit [F
101
101
102
102

103
103
104
-
## Access device logs in local run
104
+
## Setup Physical Device
105
+
106
+
Testing your app on physical devices is essential to ensure it performs as expected in real-world scenarios. To set up a physical device, first, launch the project in **Android Studio** or **Xcode**, depending on the platform you are targeting. You can easily access these options by clicking on the **code icon** in the **Local Run** menu.
To setup Android physical device, first enable Developer Options and USB Debugging in your Android device. Navigate to **Settings > About phone**, tap **Build number** seven times to activate Developer Options, then go to **Settings > System > Developer options** and enable **USB debugging**.
113
+
114
+
Connect your device to your computer via USB, authorizing the connection if prompted. Verify the setup by running `flutter devices` in Android Studio’s terminal; your device should appear in the list of connected devices.
115
+
116
+
:::info
117
+
118
+
For more detailed guidance, refer to the [**Android Flutter documentation**](https://docs.flutter.dev/get-started/install/macos/mobile-android#configure-your-target-android-device).
119
+
120
+
:::
121
+
122
+
### Setup iOS Device
123
+
124
+
To setup iOS physical device, you must configure your **Apple Developer account** and set up **code signing** in Xcode. First, add your **Apple ID** by opening **Xcode > Preferences > Accounts**, clicking **"+"**, selecting **Apple ID**, and signing in.
125
+
126
+
Next, assign your project to a development team. Open your project in Xcode, select the **Runner** project, go to **Signing & Capabilities**, and choose your **Apple Developer team** in the **Team** dropdown. If your team is not listed, ensure that your Apple ID has been properly added to Xcode.
127
+
128
+
Finally, configure code signing to allow your app to run on a real device. Ensure **"Automatically manage signing"** is enabled. Xcode will attempt to create and download a **provisioning profile** for your project. If issues arise, you may need to manually create a provisioning profile in the **Apple Developer Certificates, Identifiers & Profiles** section. Once created, download and double-click the provisioning profile to install it in Xcode.
129
+
130
+
:::info
131
+
132
+
For more detailed guidance, refer to the [**iOS Flutter documentation**](https://docs.flutter.dev/get-started/install/macos/mobile-ios#configure-your-target-ios-device).
133
+
134
+
:::
135
+
136
+
## Access Device Logs in Local Run
105
137
106
138
Device logs provide a way to access and view the logs generated by your app while it's running on a device or simulator. They are invaluable for understanding the inner workings of your app. If something isn't functioning as expected, the device logs can reveal the reasons behind it.
107
139
108
140
To access the device logs, first run your app using the local run. Then, open the test menu and click on **Logs** icon. This will display a floating window with detailed logs of the app while it's running.
The console input in local run is particularly useful for performing hot reload and hot restart directly from the device logs. To initiate a hot reload, press `r` followed by `Enter`, and for a hot restart, press `R` followed by `Enter`. Additionally, any terminal commands commonly used with Flutter while running an app should work with the console input.
115
147
@@ -141,24 +173,24 @@ The console input in local run is particularly useful for performing hot reload
141
173
</div>
142
174
<p></p>
143
175
144
-
### Checking errors
176
+
### Checking Errors
145
177
146
178
Any errors displayed in the red box on your screen are also recorded in the Device logs, where you can find detailed information about the app's state and the events leading up to the issue.
147
179
148
-
## Reconfigure local run setup
180
+
## Reconfigure Local Run Setup
149
181
150
182
If you need to update the Flutter SDK version, run Flutter Doctor, or start the simulator again, simply open the test menu and click **Configure**.
To access the project code, open the test menu and ensure the project is not running. Click on the **code icon**, and you'll be presented with options to either open the project folder, project in your preferred IDE or directly launch the project in Xcode (for macOS users).
There may be certain situations where you, as a developer, may prefer not to have local runs overwrite any changes that have been made in the code. In such cases, you can manually download the code onto your local system and then make any modifications as needed.
164
196
@@ -169,7 +201,7 @@ Here’s how you do it:
169
201
3.[Installing IDE and Plugins](#3-installing-ide-and-plugins)
170
202
4.[Running app on device](#4-running-app-on-device)
171
203
172
-
### 1. Download code
204
+
### 1. Download Code
173
205
174
206
:::warning
175
207
@@ -225,10 +257,14 @@ You can choose to install either [Visual Studio Code](https://code.visualstudio.
225
257
- To install Visual Code with Flutter and Dart plugins, check out [this link](https://flutter.dev/docs/get-started/editor?tab=vscode).
226
258
- To install Android Studio with Flutter and Dart plugins, check out [this link](https://flutter.dev/docs/get-started/editor?tab=androidstudio).
227
259
228
-
### 4. Running app on device
260
+
### 4. Running App on Device
229
261
230
262
You can choose to run your app on a real device or an emulator.
231
263
264
+
:::tip
265
+
To test app on a real device, see how to [**setup a physical device**](#setup-physical-device).
266
+
:::
267
+
232
268
To run your app on a device:
233
269
234
270
1. First open the downloaded project in your preferred IDE.
@@ -258,7 +294,7 @@ Running your app on a Desktop involves:
258
294
visibility using [Responsive Visibility](../../ff-concepts/layout/responsive-layout.md#responsive-visibility).
259
295
3. **Run the app on a desktop**: Use the Local Run feature in the FlutterFlow Desktop app or manually download and run the code, choosing your target device (e.g., macOS) before running.
260
296
261
-
## Video guide
297
+
## Video Guide
262
298
263
299
If you prefer watching a video tutorial, here's the one for you:
0 commit comments