2

I installed scrcpy and created a shortcut, but the program only runs from the store, how do I create a shortcut with a working startup code ?

enter image description here enter image description here enter image description here enter image description here

The code from here doesn't work...

No application launcher for scrcpy


[Desktop Entry]
Version=1.0
Type=Application
Name=scrcpy
GenericName=scrcpy
Comment=Screen mirroring application
Exec=scrcpy %F
Icon=phone-symbolic
Terminal=false
X-MultipleArgs=false
Categories=Development;GTK;
StartupNotify=true

When I click on a manually created shortcut... in the tray, the animation circle just turns and disappears.

When I enter a command from the terminal, I get this error:

:scrcpy
INFO: scrcpy 1.17 <https://github.com/Genymobile/scrcpy>
/usr/local/share/scrcpy/scrcpy-server: 1 file pushed. 2.8 MB/s (18570 bytes in 0.006s)
ERROR: Exception on thread Thread[main,5,main]
java.lang.NumberFormatException: For input string: "1.17"
    at java.lang.Integer.parseInt(Integer.java:615)
    at java.lang.Integer.parseInt(Integer.java:650)
    at com.genymobile.scrcpy.Server.createOptions(Server.java:52)
    at com.genymobile.scrcpy.Server.main(Server.java:101)
    at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
    at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:389)

The program works only by clicking on the launch button in the GNOME store.

:scrcpy --help
Usage: scrcpy [options]

Options:

--always-on-top
    Make scrcpy window always on top (above other windows).

-b, --bit-rate value
    Encode the video at the given bit-rate, expressed in bits/s.
    Unit suffixes are supported: 'K' (x1000) and 'M' (x1000000).
    Default is 8000000.

--codec-options key[:type]=value[,...]
    Set a list of comma-separated key:type=value options for the
    device encoder.
    The possible values for 'type' are 'int' (default), 'long',
    'float' and 'string'.
    The list of possible codec options is available in the
    Android documentation:
    &lt;https://d.android.com/reference/android/media/MediaFormat&gt;

--crop width:height:x:y
    Crop the device screen on the server.
    The values are expressed in the device natural orientation
    (typically, portrait for a phone, landscape for a tablet).
    Any --max-size value is computed on the cropped size.

--disable-screensaver
    Disable screensaver while scrcpy is running.

--display id
    Specify the display id to mirror.

    The list of possible display ids can be listed by:
        adb shell dumpsys display
    (search &quot;mDisplayId=&quot; in the output)

    Default is 0.

--encoder name
    Use a specific MediaCodec encoder (must be a H.264 encoder).

--force-adb-forward
    Do not attempt to use &quot;adb reverse&quot; to connect to the
    the device.

--forward-all-clicks
    By default, right-click triggers BACK (or POWER on) and
    middle-click triggers HOME. This option disables these
    shortcuts and forward the clicks to the device instead.

-f, --fullscreen
    Start in fullscreen.

-h, --help
    Print this help.

--legacy-paste
    Inject computer clipboard text as a sequence of key events
    on Ctrl+v (like MOD+Shift+v).
    This is a workaround for some devices not behaving as
    expected when setting the device clipboard programmatically.

--lock-video-orientation value
    Lock video orientation to value.
    Possible values are -1 (unlocked), 0, 1, 2 and 3.
    Natural device orientation is 0, and each increment adds a
    90 degrees rotation counterclockwise.
    Default is -1 (unlocked).

--max-fps value
    Limit the frame rate of screen capture (officially supported
    since Android 10, but may work on earlier versions).

-m, --max-size value
    Limit both the width and height of the video to value. The
    other dimension is computed so that the device aspect-ratio
    is preserved.
    Default is 0 (unlimited).

-n, --no-control
    Disable device control (mirror the device in read-only).

-N, --no-display
    Do not display device (only when screen recording is
    enabled).

--no-key-repeat
    Do not forward repeated key events when a key is held down.

--no-mipmaps
    If the renderer is OpenGL 3.0+ or OpenGL ES 2.0+, then
    mipmaps are automatically generated to improve downscaling
    quality. This option disables the generation of mipmaps.

-p, --port port[:port]
    Set the TCP port (range) used by the client to listen.
    Default is 27183:27199.

--prefer-text
    Inject alpha characters and space as text events instead of
    key events.
    This avoids issues when combining multiple keys to enter a
    special character, but breaks the expected behavior of alpha
    keys in games (typically WASD).

--push-target path
    Set the target directory for pushing files to the device by
    drag &amp; drop. It is passed as-is to &quot;adb push&quot;.
    Default is &quot;/sdcard/&quot;.

-r, --record file.mp4
    Record screen to file.
    The format is determined by the --record-format option if
    set, or by the file extension (.mp4 or .mkv).

--record-format format
    Force recording format (either mp4 or mkv).

--render-driver name
    Request SDL to use the given render driver (this is just a
    hint).
    Supported names are currently &quot;direct3d&quot;, &quot;opengl&quot;,
    &quot;opengles2&quot;, &quot;opengles&quot;, &quot;metal&quot; and &quot;software&quot;.
    &lt;https://wiki.libsdl.org/SDL_HINT_RENDER_DRIVER&gt;

--render-expired-frames
    By default, to minimize latency, scrcpy always renders the
    last available decoded frame, and drops any previous ones.
    This flag forces to render all frames, at a cost of a
    possible increased latency.

--rotation value
    Set the initial display rotation.
    Possibles values are 0, 1, 2 and 3. Each increment adds a 90
    degrees rotation counterclockwise.

-s, --serial serial
    The device serial number. Mandatory only if several devices
    are connected to adb.

--shortcut-mod key[+...]][,...]
    Specify the modifiers to use for scrcpy shortcuts.
    Possible keys are &quot;lctrl&quot;, &quot;rctrl&quot;, &quot;lalt&quot;, &quot;ralt&quot;,
    &quot;lsuper&quot; and &quot;rsuper&quot;.

    A shortcut can consist in several keys, separated by '+'.
    Several shortcuts can be specified, separated by ','.

    For example, to use either LCtrl+LAlt or LSuper for scrcpy
    shortcuts, pass &quot;lctrl+lalt,lsuper&quot;.

    Default is &quot;lalt,lsuper&quot; (left-Alt or left-Super).

-S, --turn-screen-off
    Turn the device screen off immediately.

-t, --show-touches
    Enable &quot;show touches&quot; on start, restore the initial value
    on exit.
    It only shows physical touches (not clicks from scrcpy).

-v, --version
    Print the version of scrcpy.

-V, --verbosity value
    Set the log level (debug, info, warn or error).
    Default is info.

-w, --stay-awake
    Keep the device on while scrcpy is running, when the device
    is plugged in.

--window-borderless
    Disable window decorations (display borderless window).

--window-title text
    Set a custom window title.

--window-x value
    Set the initial window horizontal position.
    Default is &quot;auto&quot;.

--window-y value
    Set the initial window vertical position.
    Default is &quot;auto&quot;.

--window-width value
    Set the initial window width.
    Default is 0 (automatic).

--window-height value
    Set the initial window width.
    Default is 0 (automatic).

Shortcuts:

In the following list, MOD is the shortcut modifier. By default,
it's (left) Alt or (left) Super, but it can be configured by
--shortcut-mod (see above).

MOD+f
    Switch fullscreen mode

MOD+Left
    Rotate display left

MOD+Right
    Rotate display right

MOD+g
    Resize window to 1:1 (pixel-perfect)

MOD+w
Double-click on black borders
    Resize window to remove black borders

MOD+h
Middle-click
    Click on HOME

MOD+b
MOD+Backspace
Right-click (when screen is on)
    Click on BACK

MOD+s
    Click on APP_SWITCH

MOD+m
    Click on MENU

MOD+Up
    Click on VOLUME_UP

MOD+Down
    Click on VOLUME_DOWN

MOD+p
    Click on POWER (turn screen on/off)

Right-click (when screen is off)
    Power on

MOD+o
    Turn device screen off (keep mirroring)

MOD+Shift+o
    Turn device screen on

MOD+r
    Rotate device screen

MOD+n
    Expand notification panel

MOD+Shift+n
    Collapse notification panel

MOD+c
    Copy to clipboard (inject COPY keycode, Android &gt;= 7 only)

MOD+x
    Cut to clipboard (inject CUT keycode, Android &gt;= 7 only)

MOD+v
    Copy computer clipboard to device, then paste (inject PASTE
    keycode, Android &gt;= 7 only)

MOD+Shift+v
    Inject computer clipboard text as a sequence of key events

MOD+i
    Enable/disable FPS counter (print frames/second in logs)

Ctrl+click-and-move
    Pinch-to-zoom from the center of the screen

Drag &amp; drop APK file
    Install APK from computer


The store collects the information and builds my server:

gnome-software-service.desktop[7737]: INFO: scrcpy 1.17 <https://github.com/Genymobile/scrcpy>
gnome-software-service.desktop[7788]: [100%] /data/local/tmp/scrcpy-server.jar
gnome-software-service.desktop[7788]: /usr/local/share/scrcpy/scrcpy-server: 1 file pushed. 8.6 MB/s (34930 bytes in 0.004s)
kernel: [ 
kernel: [
kernel: [
kernel: [
dbus-daemon[
dbus-daemon[
gnome-software-service.desktop[7790]: [server] INFO: Device:
gnome-software-service.desktop[7737]: INFO: Renderer: opengl
gnome-software-service.desktop[7737]: INFO: OpenGL version: 3.0 Mesa 20.0.8
gnome-software-service.desktop[7737]: INFO: Trilinear filtering enabled
gnome-software-service.desktop[7737]: INFO: Initial texture: 1080x2336

Most likely, it should already be a program and not just a shortcut.

  • Please edit your question, and add the output when you run the command scrcpy in a terminal (don't add a comment, edit your question instead). It may help to investigate the issue. – Archisman Panigrahi Feb 13 '21 at 11:14

0 Answers0