Repository navigation
Add live device screen streaming to the Screen Capture window #224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
81 commits
Select commit
Hold shift + click to select a range
696c3ce
Add the on-device screen streaming server
todi1856 6e8b6af
Add live screen streaming to the Screen Capture window
todi1856 f482cfc
Add tests for live streaming and screenshot details
todi1856 6f1baf6
CI: build the server jar before packing the package
todi1856 5aced5d
Document the live stream and update the changelog
todi1856 5db42b1
fix preview going out of bounds
todi1856 f87a4dd
handle virtualDisplay being null
todi1856 7123543
Fix save as for screenshot
todi1856 076c7de
shorten changelog
todi1856 6508758
Try to fix panning on OSX
todi1856 b2e6c2f
update screenshot
todi1856 58fd75e
apply review fix
todi1856 f1d921f
apply review fix
todi1856 c58dc0f
Apply review fixes
todi1856 b5bf917
Track keys which were held
todi1856 68f3993
show live view when opening the window
todi1856 638bbef
Decouple layout viewer from screen capture
todi1856 a280502
LayoutView->LayoutViewer
todi1856 3243bee
apply design changes
todi1856 5572bf3
Fix https://jira.unity3d.com/browse/UUM-154320 Openterminal was not w…
todi1856 cc39ffa
reset protocol version to 1
todi1856 b8de601
Remove Open/Save from screen capture
todi1856 daa0dfe
Move Capture button to Take Screenshot
todi1856 257a1e3
fixate width dropdown Screenshot/Video
todi1856 5b456e7
expand status bar
todi1856 2bcfb36
expand
todi1856 cbbf432
Report to status bar
todi1856 501a95e
Add setting for showing where screenshots are saved
todi1856 901e3f8
fix status bar style
todi1856 14e33a6
add cog for quickly accessing settings
todi1856 fa688d0
add multiselection to captures
todi1856 d2248ae
Draw bounding box around screenshots/live
todi1856 9bc14a9
Copy To for multiselection
todi1856 0b59277
add image icon
todi1856 07830bf
fix status bar for video
todi1856 8bc5901
fix ui
todi1856 fbed84a
Add fold control
todi1856 47c3c2a
move access to preferences to kebab icon
todi1856 32b0d14
Make a help box
todi1856 fa949b5
folder to path
todi1856 48b19ef
bump image
todi1856 119aa80
apply changes from upstream
todi1856 1158bdb
update test
todi1856 ccc14e9
apply review
todi1856 24e1104
Merge remote-tracking branch 'origin/master' into livestream
todi1856 a938216
fix formatting
todi1856 ebd6a4f
make screenshot shortcuts only work while in Live
todi1856 2a7b665
flash screenshot when it's taken
todi1856 18d47fc
release touch, if stream dies
todi1856 5fd1532
apply cleanup
todi1856 92c86d6
Screenshot->Capture
todi1856 3f5c187
use dedicate folder for tests for captures
todi1856 00478fc
Ensure we're saving to correct folder
todi1856 ec752e8
Use EditorUtility.OpenWithDefaultApp(path) to open files
todi1856 f3b54e9
Move frame decoding to GUI, also apply profiler marks
todi1856 4381045
Use 'UserSettings/AndroidLogcat/Captures' instead of Library/AndroidL…
todi1856 bd28dbf
move device.Wakeup to reader thrad
todi1856 55a2678
reset fold state on window close
todi1856 d23fa26
Add Unity.Profiling as expected namespace
todi1856 00589f6
fix formatting
todi1856 3f985a4
Added side buttons too
todi1856 10f8767
fix stats ui being clipped when phone is in landscape
todi1856 1883433
prefer using newer api for setting rotation on Android
todi1856 b8c2755
Turn display, to visually display rotation
todi1856 608fe87
preserve rotation when switching between screenshot and live
todi1856 ee0c3d0
select entry when right clicking
todi1856 821e3ae
implement deselection
todi1856 82e453e
move stream shutdown to thread
todi1856 a34d758
forgot some control docs
todi1856 f91bbbc
better image
todi1856 e972c1e
don't squeze buttons
todi1856 c587c30
Turn the screenshot to match live view
todi1856 c924dd9
don't stretch the live image when rotating
todi1856 8d86a71
don't resize screenshot view when rotated
todi1856 b50a17f
Move default location to AndroidLogcat/Captures
todi1856 fe1ae65
update ProjectRelativePathTests
todi1856 be0d85d
revert image resize when rotating
todi1856 bf38f49
Update com.unity.mobile.android-logcat/Documentation~/android-logcat-…
todi1856 0c0f938
Update com.unity.mobile.android-logcat/Documentation~/android-logcat-…
todi1856 b89f917
Update com.unity.mobile.android-logcat/Documentation~/screen-capture-…
todi1856 59f276f
Apply docs review feedback
todi1856 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file modified
BIN
-129 KB
(52%)
com.unity.mobile.android-logcat/Documentation~/images/capture_screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+203 KB
...mobile.android-logcat/Documentation~/images/device-screen-capture-live-view.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
61 changes: 61 additions & 0 deletions
61
com.unity.mobile.android-logcat/Documentation~/screen-capture-live-stream.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,61 @@ | ||
| # View the device screen live | ||
|
|
||
| This page explains how to use the [Screen Capture tool](screen-capture.md) to view the screen of the connected device as it changes, and how to control the device from the Unity Editor. | ||
|
|
||
| The live view mirrors the device's display into the Unity Editor. Unlike a screenshot or a video, Unity doesn't save a live view. The view is live and stops when you select something else. | ||
|
|
||
| ## View the screen | ||
|
|
||
| To view the device screen live: | ||
|
|
||
| 1. Open the [Device Screen Capture window](screen-capture-window-reference.md). | ||
| 2. In the [Toolbar](screen-capture-window-reference.md#toolbar), use **Device Selector** to specify the device to view. | ||
| 3. In the [Capture list](screen-capture-window-reference.md#capture-list), select **Live**. The Screen Capture tool starts streaming and displays the device's screen in the [Capture preview](screen-capture-window-reference.md#capture-preview). | ||
|
|
||
|  | ||
|
|
||
| The stream stops when you select another row in the list, close the window, or disconnect the device. Selecting a different device restarts the stream against the newly selected one. | ||
|
|
||
| The device only sends a frame when its screen changes, so **Frame Rate** in the [Live view details](screen-capture-window-reference.md#live-view-details) drops to almost nothing while the device shows a still screen. This is expected: the last frame stays on display. | ||
|
|
||
| If the stream stops on its own, for example because the device restarted, the [Capture preview](screen-capture-window-reference.md#capture-preview) displays a **Reconnect** button. Select **Reconnect** to restart the stream, or turn **Live** off and on again. | ||
|
|
||
| ## Control the device | ||
|
|
||
| While the live view is streaming, the Screen Capture tool sends your input to the device. **Input** in the [Live view details](screen-capture-window-reference.md#live-view-details) shows whether the device accepts input. | ||
|
|
||
| | **Input** | **Result on the device** | | ||
| | ------------------------------------------ | ------------------------------------------------------------ | | ||
| | Click or drag the image | Sends a tap or a swipe at the same place on the device's screen. | | ||
| | Scroll the wheel over the image | Scrolls the content under the pointer. | | ||
| | Click the image, then press keys | Sends the keys you press, including **Backspace**, **Enter**, **Tab**, and the arrow keys. | | ||
| | **Shift** and an arrow key | Extends the selection in a text field on the device, as it would on the device's own keyboard. | | ||
| | **Escape** | Sends the Back key. | | ||
| | **Ctrl+A**, **Ctrl+C**, **Ctrl+V** (macOS: **Cmd+A**, **Cmd+C**, **Cmd+V**) | Selects all, copies, and pastes on the device, using the device's clipboard. | | ||
| | The **◄**, **●**, and **■** buttons | Sends the Back, Home, and Overview keys. Useful on a device that uses gesture navigation, where the mirrored image has no navigation bar to tap. | | ||
| | The **Power**, **Vol +**, and **Vol -** buttons | Sends the Power, Volume Up, and Volume Down keys, which you can't reach through the mirrored screen. The device sends no frames while its screen is off. | | ||
| | The **Device Rotation** buttons | Rotates the device's screen. **Auto** returns rotation control to the device's accelerometer. | | ||
| | The **Device Fold** buttons | Folds and unfolds a foldable device, so that you can view its other display. These buttons appear only for a foldable device. | | ||
|
|
||
| The Unity Editor handles other **Ctrl** and **Cmd** combinations, so its own shortcuts continue to work while the image has focus. To zoom the view instead of scrolling the device, press **Ctrl** (macOS: **Cmd**) and scroll over the image. For more information, refer to [Zoom into the image](screen-capture-window-reference.md#zoom-into-the-image). | ||
|
|
||
| An app that locks its orientation doesn't rotate with the device. In this case, the live view rotates the image instead, so the rotation is still visible. The device's screen keeps the app's rotation. | ||
|
|
||
| > [!NOTE] | ||
| > The device's clipboard and your computer's clipboard don't exchange content. **Ctrl+C** copies content on the device and **Ctrl+V** pastes that content on the device. | ||
|
|
||
| ## Change the size, quality, and frame rate | ||
|
|
||
| Streaming a display uses the device's CPU to compress each frame, and the connection to your computer to transfer it. To reduce CPU usage or bandwidth, use the [Live Stream](android-logcat-settings.md#live-stream) settings. To open these settings, go to **Edit** > **Preferences** > **Analysis** > **Android Logcat Settings** (macOS: **Unity** > **Settings** > **Analysis** > **Android Logcat Settings**). | ||
|
|
||
| The settings apply when a stream starts. To apply them to a stream that is already running, select **Reconnect** in the live view, or turn **Live** off and on again. | ||
|
|
||
| > [!NOTE] | ||
| > If you connect the device with `adb connect` instead of USB, the stream shares the device's Wi-Fi connection with other adb tasks, including the message log. If the connection is slow, lower **Max Size** and **Max Frame Rate**, or connect the device by USB. | ||
|
|
||
| ## Additional resources | ||
|
|
||
| * [Device Screen Capture window reference](screen-capture-window-reference.md) | ||
| * [Capture a screenshot](screen-capture-screenshot.md) | ||
| * [Capture a video](screen-capture-video.md) | ||
| * [Connect to a device](connect-to-a-device.md) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
adding a lead line for steps
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Applied in 59f276f, thanks!