Skip to content

Commit

Permalink
Merge pull request #236 from jessebot/update-lock-file-and-android-docs
Browse files Browse the repository at this point in the history
Update lock file and android docs
  • Loading branch information
cloudymax authored Sep 27, 2023
2 parents aa57a6a + eadb850 commit c377de4
Show file tree
Hide file tree
Showing 3 changed files with 202 additions and 118 deletions.
102 changes: 86 additions & 16 deletions docs/operating_systems/android/screen_mirroring.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,61 @@ title: Screen Mirroring
permalink: /os/android/screen-mirroring
---

## Screen Mirroring from Android device
We'll be using [scrcpy](https://github.com/Genymobile/scrcpy) in this guide, which bundles abd, so you don't need to install abd in addition to this.

### Installation and Setup On Debian
Do _NOT_ use the apt package. It is incredibly out of date. Use the snap package.
```bash
sudo snap install scrcpy
```
*NOTE*: Make use `/snap/bin` is in your path
# Screen Mirroring from Android device

Make sure your phone is also in debug mode:
We'll be using [scrcpy](https://github.com/Genymobile/scrcpy) in this guide.

```bash
# alias already present in onboardme .bashrc
alias adb='scrcpy.adb'
## Installation

<details>
<summary>`scrcpy` via `brew` and `apt` on Debian</summary>

First install adb with apt:

```bash
# use apt to install adb which scrcpy needs
sudo apt install -y adb
```

Then install [scrcpy](https://github.com/Genymobile/scrcpy) with brew:

```bash
# use linuxbrew to install scrcpy
brew install scrcpy

# add scrcpy to your path if you haven't already
export PATH="$PATH:/home/linuxbrew/.linuxbrew/bin"
```

</details>


<details>
<summary>Install via `snap` on Debian</summary>

I don't use the snap store anymore, but if you do, the below guide _may_ be of use (but is no longer tested!)

The snapstore verson of `scrcpy` installs `adb` for you, so you don't need to install it.

Do _NOT_ use the apt package. It is incredibly out of date. Use the snap package.
```bash
sudo snap install scrcpy
```
*NOTE*: Make use `/snap/bin` is in your path

Make sure your phone is also in debug mode:

```bash
alias adb='scrcpy.adb'
```

</details>


## Start the server with adb

# Start the server with scrcpy's bundled adb
```bash
adb start-server
```

Expand Down Expand Up @@ -81,14 +119,46 @@ FINALLY, you can now run this to get your phone mirrored:
```bash
scrcpy --select-tcpip
```
:party:

and if that fails, you can either upgrade your graphics card drivers, or try this command:

```bash
scrcpy --render-driver=software --select-tcpip
```

:tada:

# Troubleshooting
Is the device not showing up? Try disconnecting your phone and unmounting it via the file explorer.
Then restart the server with:


## device not showing up in adb?

Try disconnecting your phone and unmounting it via the file explorer. Then restart the server with:

```bash
adb kill-server
adb start-server
```

Then try connecting again and it _should_ work, but you may need to remove all allowed developer USB connections and restart the phone before trying. That's all I got.

## `Error: Could not create renderer`

If you're getting this error:

```console
$ scrcpy --select-tcpip
scrcpy 2.1.1 <https://github.com/Genymobile/scrcpy>
INFO: ADB device found:
INFO: --> (tcpip) 192.168.50.180:2233 device SM_G998B
/home/linuxbrew/.linuxbrew/Cellar/scrcpy/2.1.1/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 1.5 MB/s (56995 bytes in 0.036s)
[server] INFO: Device: [samsung] samsung SM-G998B (Android 13)
ERROR: Could not create renderer: Couldn't find matching render driver
WARN: Killing the server...
```

This is probably due to your graphics card drivers, and according to [this issue comment](https://github.com/Genymobile/scrcpy/issues/58#issuecomment-747511886) you can solve this by running:

```bash
scrcpy --render-driver=software --select-tcpip
```
Loading

0 comments on commit c377de4

Please sign in to comment.