Skip to content

Commit 846607d

Browse files
Added physical device setup (#278)
Co-authored-by: Pooja Bhaumik <[email protected]>
1 parent 5e3db82 commit 846607d

File tree

1 file changed

+46
-10
lines changed
  • docs/testing-deployment-publishing/running-your-app

1 file changed

+46
-10
lines changed

docs/testing-deployment-publishing/running-your-app/local-run.md

Lines changed: 46 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ Here are the steps to use local run:
6565

6666
![code-export](../imgs/code-export.avif)
6767

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).
6969

7070
<div style={{
7171
position: 'relative',
@@ -101,15 +101,47 @@ and reloads the entire app, resetting its state. For more info, you can visit [F
101101

102102
![run-controls](../imgs/run-controls.avif)
103103

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.
107+
108+
![access-project-code.avif](../imgs/access-project-code.avif)
109+
110+
### Setup Android Device
111+
112+
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
105137

106138
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.
107139

108140
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.
109141

110142
![access-device-logs](../imgs/access-device-logs-2.avif)
111143

112-
### Console input
144+
### Console Input
113145

114146
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.
115147

@@ -141,24 +173,24 @@ The console input in local run is particularly useful for performing hot reload
141173
</div>
142174
<p></p>
143175

144-
### Checking errors
176+
### Checking Errors
145177

146178
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.
147179

148-
## Reconfigure local run setup
180+
## Reconfigure Local Run Setup
149181

150182
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**.
151183

152184
![reconfigure-local-run.avif](../imgs/reconfigure-local-run-2.avif)
153185

154186

155-
## Access project code
187+
## Access Project Code
156188

157189
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).
158190

159191
![access-project-code.avif](../imgs/access-project-code.avif)
160192

161-
## Manually download code and run
193+
## Manually Download Code and Run
162194

163195
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.
164196

@@ -169,7 +201,7 @@ Here’s how you do it:
169201
3. [Installing IDE and Plugins](#3-installing-ide-and-plugins)
170202
4. [Running app on device](#4-running-app-on-device)
171203

172-
### 1. Download code
204+
### 1. Download Code
173205

174206
:::warning
175207

@@ -225,10 +257,14 @@ You can choose to install either [Visual Studio Code](https://code.visualstudio.
225257
- To install Visual Code with Flutter and Dart plugins, check out [this link](https://flutter.dev/docs/get-started/editor?tab=vscode).
226258
- To install Android Studio with Flutter and Dart plugins, check out [this link](https://flutter.dev/docs/get-started/editor?tab=androidstudio).
227259
228-
### 4. Running app on device
260+
### 4. Running App on Device
229261
230262
You can choose to run your app on a real device or an emulator.
231263
264+
:::tip
265+
To test app on a real device, see how to [**setup a physical device**](#setup-physical-device).
266+
:::
267+
232268
To run your app on a device:
233269
234270
1. First open the downloaded project in your preferred IDE.
@@ -258,7 +294,7 @@ Running your app on a Desktop involves:
258294
visibility using [Responsive Visibility](../../ff-concepts/layout/responsive-layout.md#responsive-visibility).
259295
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.
260296
261-
## Video guide
297+
## Video Guide
262298
263299
If you prefer watching a video tutorial, here's the one for you:
264300
<div class="video-container"><iframe width="630" height="355" src="https://www.youtube.com/embed/k9NpYncXC_U" title="Local Run | New Feature Tutorial" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe></div>

0 commit comments

Comments
 (0)