Skip to content
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

adb push error #12

Closed
padok opened this issue Mar 9, 2018 · 9 comments
Closed

adb push error #12

padok opened this issue Mar 9, 2018 · 9 comments

Comments

@padok
Copy link

padok commented Mar 9, 2018

I installed the last version with

padok@Idris:~/git/scrcpy$ meson x --buildtype release --strip -Db_lto=true
The Meson build system
Version: 0.42.1
Source dir: /home/padok/git/scrcpy
Build dir: /home/padok/git/scrcpy/x
Build type: native build
Project name: scrcpy
Native C compiler: cc (gcc 7.2.0)
Build machine cpu family: x86_64
Build machine cpu: x86_64
Found pkg-config: /usr/bin/pkg-config (0.29.1)
Native dependency libavformat found: YES 57.71.100
Native dependency libavcodec found: YES 57.89.100
Native dependency libavutil found: YES 55.58.100
Native dependency sdl2 found: YES 2.0.6
Configuring config.h using configuration
Program ./scripts/build-wrapper.sh found: YES (/home/padok/git/scrcpy/server/./scripts/build-wrapper.sh)
Build targets in project: 6
padok@Idris:~/git/scrcpy$ cd x
padok@Idris:~/git/scrcpy/x$ ninja
[30/30] Generating scrcpy-server with a custom command.
:server:preBuild UP-TO-DATE
:server:preReleaseBuild UP-TO-DATE
:server:compileReleaseAidl UP-TO-DATE
:server:compileReleaseRenderscript UP-TO-DATE
:server:checkReleaseManifest UP-TO-DATE
:server:generateReleaseBuildConfig UP-TO-DATE
:server:prepareLintJar UP-TO-DATE
:server:generateReleaseResValues UP-TO-DATE
:server:generateReleaseResources UP-TO-DATE
:server:mergeReleaseResources UP-TO-DATE
:server:createReleaseCompatibleScreenManifests UP-TO-DATE
:server:processReleaseManifest UP-TO-DATE
:server:splitsDiscoveryTaskRelease UP-TO-DATE
:server:processReleaseResources UP-TO-DATE
:server:generateReleaseSources UP-TO-DATE
:server:javaPreCompileRelease UP-TO-DATE
:server:compileReleaseJavaWithJavac UP-TO-DATE
:server:compileReleaseNdk NO-SOURCE
:server:compileReleaseSources UP-TO-DATE
:server:lintVitalRelease
:server:mergeReleaseShaders UP-TO-DATE
:server:compileReleaseShaders UP-TO-DATE
:server:generateReleaseAssets UP-TO-DATE
:server:mergeReleaseAssets UP-TO-DATE
:server:transformClassesWithPreDexForRelease UP-TO-DATE
:server:transformDexWithDexForRelease UP-TO-DATE
:server:mergeReleaseJniLibFolders UP-TO-DATE
:server:transformNativeLibsWithMergeJniLibsForRelease UP-TO-DATE
:server:processReleaseJavaRes NO-SOURCE
:server:transformResourcesWithMergeJavaResForRelease UP-TO-DATE
:server:packageRelease UP-TO-DATE
:server:assembleRelease

BUILD SUCCESSFUL in 1s
24 actionable tasks: 1 executed, 23 up-to-date
padok@Idris:~/git/scrcpy/x$ sudo ninja install
[1/2] Generating scrcpy-server with a custom command.
(not invoking gradle, since we are root)
[1/2] Installing files.
Installing app/scrcpy to /usr/local/bin/scrcpy
Stripping target 'app/scrcpy'
Installing server/scrcpy-server.jar to /usr/local/share/scrcpy/scrcpy-server.jar

When I tried to use scrcpy with my mobile phone I got the error message

padok@Idris:~/git/scrcpy/x$ adb connect 10.80.0.138
connected to 10.80.0.138:5555
padok@Idris:~/git/scrcpy/x$ scrcpy 
exec: No such file or directory
ERROR: "adb push" returned with value 1

The adb command seems to work.

padok@Idris:~/git/scrcpy/x$ adb push server/scrcpy-server.jar /data/local/tmp/scrcpy-server.jar
server/scrcpy-server.jar: 1 file pushed. 0.7 MB/s (19038 bytes in 0.025s)

My phone is an Oneplus One (bacon) running LineageOS 14.1-20180128

@rom1v
Copy link
Collaborator

rom1v commented Mar 9, 2018

Currently, it does not work over adb connect.

What if you use it over usb instead?

@stek29
Copy link
Contributor

stek29 commented Mar 14, 2018

exec: No such file or directory

Are you sure that adb is in PATH?

@aarmea
Copy link

aarmea commented Mar 21, 2018

More specifically, the issue causing is that exec expects your PATH to be fully expanded. Apparently, tilde expansion is a feature of the shell.

Here are two workarounds that work for me:

  • Manually expand the tildes in your PATH: PATH="$PATH:$HOME/Android/Sdk/platform-tools" scrcpy
  • Set the ADB environment variable before calling scrcpy: ADB=$(which adb) scrcpy

@rom1v
Copy link
Collaborator

rom1v commented Mar 21, 2018

Apparently, tilde expansion is a feature of the shell.

Absolutely.

Manually expand the tildes in your PATH

Yes, that's a requirement.

Set the ADB environment variable before calling scrcpy: ADB=$(which adb) scrcpy

I think this should not change anything: if which adb gives a result, then it's in PATH, so scrcpy would find it.

@aarmea
Copy link

aarmea commented Mar 21, 2018

On my machine (whose PATH contains "~/Android/Sdk/platform-tools") scrcpy does not work but ADB=$(which adb) scrpy does. I think this is because exec doesn't do tilde expansion, while which does.

@rom1v
Copy link
Collaborator

rom1v commented Mar 21, 2018

OK, that's weird. On my Debian, I have the reverse behavior:

mkdir z
echo 'echo ok' > z/blabla
chmod +x z/blabla
export PATH="~/z:$PATH"
$ which blabla
$ blabla
ok

@aarmea
Copy link

aarmea commented Mar 21, 2018

Yeah - my point is that which will implicitly do the tilde expansion as expected, but calls to execvp (like this one in scrcpy) do not.

@rom1v
Copy link
Collaborator

rom1v commented Mar 21, 2018

Yeah - my point is that which will implicitly do the tilde expansion

Yes, but this surprises me.

as expected

IMO which should not expand ~ in PATH (and it does not on my Debian, cf my previous message, since blabla is not found) for consistency, since exec does not expand it.

@aarmea
Copy link

aarmea commented Mar 21, 2018

it does not on my Debian

TIL. I just tried this out on Debian and I'm getting the same result as you. It looks like this is because Debian uses its own implementation of which while Arch uses which from coreutils.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants