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

raspberry support ? #179

Closed
antoniosap opened this issue Jun 21, 2018 · 10 comments
Closed

raspberry support ? #179

antoniosap opened this issue Jun 21, 2018 · 10 comments

Comments

@antoniosap
Copy link

how compile client for raspberry pi 3 ? #

@rom1v
Copy link
Collaborator

rom1v commented Jun 21, 2018

The easiest way is to compile it directly on your raspberry pi.

@Vitalic66
Copy link

Vitalic66 commented Jun 25, 2018

Hi I also try to compile it. Fails right now because of missing license for android sdk.

Trying to install sdk manager on laptop with ubuntu and copy the license to the pi.

@Vitalic66
Copy link

Vitalic66 commented Jun 25, 2018

Facing some problems on Pi3 with stretch:

without root access i get this error when building:

pi@raspberrypi:~/scrcpy/x $ ninja
[1/1] 'Generating scrcpy-server with a custom command.'
FAILED: server/scrcpy-server.jar 
'/home/pi/scrcpy/server/./scripts/build-wrapper.sh' '../server/.' 'server/scrcpy-server.jar' 'release'
Starting a Gradle Daemon (subsequent builds will be faster)
Observed package id 'platform-tools' in inconsistent location '/usr/lib/android-sdk/platform-tools' (Expected '/usr/lib/android-sdk/platform-tools/platform-tools')
Observed package id 'platform-tools' in inconsistent location '/usr/lib/android-sdk/platform-tools' (Expected '/usr/lib/android-sdk/platform-tools/platform-tools')
Observed package id 'platform-tools' in inconsistent location '/usr/lib/android-sdk/platform-tools' (Expected '/usr/lib/android-sdk/platform-tools/platform-tools')
File /home/pi/.android/repositories.cfg could not be loaded.
Checking the license for package Android SDK Build-Tools 27.0.3 in /usr/lib/android-sdk/platform-tools/licenses
License for package Android SDK Build-Tools 27.0.3 accepted.
Preparing "Install Android SDK Build-Tools 27.0.3 (revision: 27.0.3)".
Warning: Failed to read or create install properties file.
Checking the license for package Android SDK Platform 27 in /usr/lib/android-sdk/platform-tools/licenses
License for package Android SDK Platform 27 accepted.
Preparing "Install Android SDK Platform 27 (revision: 3)".
Warning: Failed to read or create install properties file.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':server'.
> Failed to install the following SDK components:
      platforms;android-27 Android SDK Platform 27
      build-tools;27.0.3 Android SDK Build-Tools 27.0.3
  The SDK directory is not writable (/usr/lib/android-sdk/platform-tools)


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 35s
ninja: build stopped: subcommand failed.

with root access it says:

root@raspberrypi:/home/pi/scrcpy/x# ninja
[1/1] 'Generating scrcpy-server with a custom command.'
(not invoking gradle, since we are root)

and can't launch:

[0/1] 'Running external command run.'
adb: error: cannot stat '/home/pi/scrcpy/x/server/scrcpy-server.jar': No such file or directory
ERROR: "adb push" returned with value 1
FAILED: run 
'/usr/bin/python3' '/usr/share/meson/meson' '--internal' 'commandrunner' '/home/pi/scrcpy' '/home/pi/scrcpy/x' '' 'scripts/run-scrcpy.sh'
ninja: build stopped: subcommand failed.

@rom1v
Copy link
Collaborator

rom1v commented Jun 25, 2018

sudo chmod +w /usr/lib/android-sdk/platform-tools
ninja

@Vitalic66
Copy link

Right already did this and had this error after chmod:

[1/1] 'Generating scrcpy-server with a custom command.'
FAILED: server/scrcpy-server.jar 
'/home/pi/scrcpy/server/./scripts/build-wrapper.sh' '../server/.' 'server/scrcpy-server.jar' 'release'
Observed package id 'platform-tools' in inconsistent location '/usr/lib/android-sdk/platform-tools' (Expected '/usr/lib/android-sdk/platform-tools/platform-tools')
Observed package id 'platform-tools' in inconsistent location '/usr/lib/android-sdk/platform-tools' (Expected '/usr/lib/android-sdk/platform-tools/platform-tools')
Checking the license for package Android SDK Build-Tools 27.0.3 in /usr/lib/android-sdk/platform-tools/licenses
License for package Android SDK Build-Tools 27.0.3 accepted.
Preparing "Install Android SDK Build-Tools 27.0.3 (revision: 27.0.3)".
Warning: Trying to install into /usr/lib/android-sdk/platform-tools/build-tools/27.0.3/ but package "Android SDK Platform-Tools" already exists at /usr/lib/android-sdk/platform-tools/. It must be deleted or moved away before installing into a child directory.
Checking the license for package Android SDK Platform 27 in /usr/lib/android-sdk/platform-tools/licenses
License for package Android SDK Platform 27 accepted.
Preparing "Install Android SDK Platform 27 (revision: 3)".
Warning: Trying to install into /usr/lib/android-sdk/platform-tools/platforms/android-27/ but package "Android SDK Platform-Tools" already exists at /usr/lib/android-sdk/platform-tools/. It must be deleted or moved away before installing into a child directory.

FAILURE: Build failed with an exception.

So i copied content of platform-tools to another folder and renamed the original one.

Now i get this error...

pi@raspberrypi:~/scrcpy/x $ ninja
[1/1] 'Generating scrcpy-server with a custom command.'
FAILED: server/scrcpy-server.jar 
'/home/pi/scrcpy/server/./scripts/build-wrapper.sh' '../server/.' 'server/scrcpy-server.jar' 'release'
Observed package id 'platform-tools' in inconsistent location '/usr/lib/Android-sdk/platform-tools/platform-tools1' (Expected '/usr/lib/Android-sdk/platform-tools/platform-tools')
Observed package id 'platform-tools' in inconsistent location '/usr/lib/Android-sdk/platform-tools/platform-tools1' (Expected '/usr/lib/Android-sdk/platform-tools/platform-tools')
Checking the license for package Android SDK Build-Tools 27.0.3 in /usr/lib/Android-sdk/platform-tools/licenses
License for package Android SDK Build-Tools 27.0.3 accepted.
Preparing "Install Android SDK Build-Tools 27.0.3 (revision: 27.0.3)".
Warning: An error occurred while preparing SDK package Android SDK Build-Tools 27.0.3: Remote host closed connection during handshake.:
javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
	at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:1002)
	at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1385)
	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1413)
	at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1397)
	at sun.net.www.protocol.https.HttpsClient.afterConnect(HttpsClient.java:559)
	at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(AbstractDelegateHttpsURLConnection.java:185)
	at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(HttpsURLConnectionImpl.java:162)
	at com.android.sdklib.repository.legacy.remote.internal.DownloadCache.openUrl(DownloadCache.java:249)
	at com.android.sdklib.repository.legacy.remote.internal.DownloadCache.openDirectUrl(DownloadCache.java:333)
	at com.android.sdklib.repository.legacy.LegacyDownloader.downloadFully(LegacyDownloader.java:90)
	at com.android.repository.impl.downloader.LocalFileAwareDownloader.downloadFully(LocalFileAwareDownloader.java:82)
	at com.android.repository.impl.installer.BasicInstaller.doPrepare(BasicInstaller.java:70)
	at com.android.repository.impl.installer.AbstractPackageOperation.prepare(AbstractPackageOperation.java:306)
	at com.android.builder.sdk.DefaultSdkLoader.installRemotePackages(DefaultSdkLoader.java:354)
	at com.android.builder.sdk.DefaultSdkLoader.installBuildTools(DefaultSdkLoader.java:306)
	at com.android.builder.sdk.DefaultSdkLoader.getTargetInfo(DefaultSdkLoader.java:148)
	at com.android.build.gradle.internal.SdkHandler.initTarget(SdkHandler.java:182)
	at com.android.build.gradle.BasePlugin.ensureTargetSetup(BasePlugin.java:879)
	at com.android.build.gradle.BasePlugin.createAndroidTasks(BasePlugin.java:700)
	at com.android.build.gradle.BasePlugin.lambda$null$4(BasePlugin.java:650)
	at com.android.builder.profile.ThreadRecorder.record(ThreadRecorder.java:81)
	at com.android.build.gradle.BasePlugin.lambda$createTasks$5(BasePlugin.java:646)
	at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:91)
	at org.gradle.internal.event.BroadcastDispatch$ActionInvocationHandler.dispatch(BroadcastDispatch.java:80)
	at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:42)
	at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:230)
	at org.gradle.internal.event.BroadcastDispatch$SingletonDispatch.dispatch(BroadcastDispatch.java:149)
	at org.gradle.internal.event.AbstractBroadcastDispatch.dispatch(AbstractBroadcastDispatch.java:58)
	at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.java:324)
	at org.gradle.internal.event.BroadcastDispatch$CompositeDispatch.dispatch(BroadcastDispatch.java:234)
	at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:140)
	at org.gradle.internal.event.ListenerBroadcast.dispatch(ListenerBroadcast.java:37)
	at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
	at com.sun.proxy.$Proxy25.afterEvaluate(Unknown Source)
	at org.gradle.configuration.project.LifecycleProjectEvaluator.notifyAfterEvaluate(LifecycleProjectEvaluator.java:76)
	at org.gradle.configuration.project.LifecycleProjectEvaluator.doConfigure(LifecycleProjectEvaluator.java:70)
	at org.gradle.configuration.project.LifecycleProjectEvaluator.access$100(LifecycleProjectEvaluator.java:34)
	at org.gradle.configuration.project.LifecycleProjectEvaluator$ConfigureProject.run(LifecycleProjectEvaluator.java:110)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
	at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:50)
	at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:666)
	at org.gradle.api.internal.project.DefaultProject.evaluate(DefaultProject.java:135)
	at org.gradle.execution.TaskPathProjectEvaluator.configure(TaskPathProjectEvaluator.java:35)
	at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:62)
	at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:38)
	at org.gradle.initialization.DefaultGradleLauncher$ConfigureBuild.run(DefaultGradleLauncher.java:249)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
	at org.gradle.initialization.DefaultGradleLauncher.configureBuild(DefaultGradleLauncher.java:167)
	at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:126)
	at org.gradle.initialization.DefaultGradleLauncher.executeTasks(DefaultGradleLauncher.java:109)
	at org.gradle.internal.invocation.GradleBuildController$1.call(GradleBuildController.java:78)
	at org.gradle.internal.invocation.GradleBuildController$1.call(GradleBuildController.java:75)
	at org.gradle.internal.work.DefaultWorkerLeaseService.withLocks(DefaultWorkerLeaseService.java:152)
	at org.gradle.internal.invocation.GradleBuildController.doBuild(GradleBuildController.java:100)
	at org.gradle.internal.invocation.GradleBuildController.run(GradleBuildController.java:75)
	at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
	at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
	at org.gradle.tooling.internal.provider.ValidatingBuildActionRunner.run(ValidatingBuildActionRunner.java:32)
	at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner$1.run(RunAsBuildOperationBuildActionRunner.java:43)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:336)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor$RunnableBuildOperationWorker.execute(DefaultBuildOperationExecutor.java:328)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.execute(DefaultBuildOperationExecutor.java:199)
	at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:110)
	at org.gradle.launcher.exec.RunAsBuildOperationBuildActionRunner.run(RunAsBuildOperationBuildActionRunner.java:40)
	at org.gradle.tooling.internal.provider.SubscribableBuildActionRunner.run(SubscribableBuildActionRunner.java:51)
	at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:47)
	at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:30)
	at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:39)
	at org.gradle.launcher.exec.BuildTreeScopeBuildActionExecuter.execute(BuildTreeScopeBuildActionExecuter.java:25)
	at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:80)
	at org.gradle.tooling.internal.provider.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:53)
	at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:57)
	at org.gradle.tooling.internal.provider.ServicesSetupBuildActionExecuter.execute(ServicesSetupBuildActionExecuter.java:32)
	at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:36)
	at org.gradle.tooling.internal.provider.GradleThreadBuildActionExecuter.execute(GradleThreadBuildActionExecuter.java:25)
	at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:43)
	at org.gradle.tooling.internal.provider.ParallelismConfigurationBuildActionExecuter.execute(ParallelismConfigurationBuildActionExecuter.java:29)
	at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:69)
	at org.gradle.tooling.internal.provider.StartParamsValidatingActionExecuter.execute(StartParamsValidatingActionExecuter.java:30)
	at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:59)
	at org.gradle.tooling.internal.provider.SessionFailureReportingActionExecuter.execute(SessionFailureReportingActionExecuter.java:44)
	at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:45)
	at org.gradle.tooling.internal.provider.SetupLoggingActionExecuter.execute(SetupLoggingActionExecuter.java:30)
	at org.gradle.launcher.daemon.server.exec.ExecuteBuild.doBuild(ExecuteBuild.java:67)
	at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
	at org.gradle.launcher.daemon.server.exec.WatchForDisconnection.execute(WatchForDisconnection.java:37)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
	at org.gradle.launcher.daemon.server.exec.ResetDeprecationLogger.execute(ResetDeprecationLogger.java:26)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
	at org.gradle.launcher.daemon.server.exec.RequestStopIfSingleUsedDaemon.execute(RequestStopIfSingleUsedDaemon.java:34)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
	at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:74)
	at org.gradle.launcher.daemon.server.exec.ForwardClientInput$2.call(ForwardClientInput.java:72)
	at org.gradle.util.Swapper.swap(Swapper.java:38)
	at org.gradle.launcher.daemon.server.exec.ForwardClientInput.execute(ForwardClientInput.java:72)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
	at org.gradle.launcher.daemon.server.exec.LogAndCheckHealth.execute(LogAndCheckHealth.java:55)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
	at org.gradle.launcher.daemon.server.exec.LogToClient.doBuild(LogToClient.java:62)
	at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
	at org.gradle.launcher.daemon.server.exec.EstablishBuildEnvironment.doBuild(EstablishBuildEnvironment.java:82)
	at org.gradle.launcher.daemon.server.exec.BuildCommandOnly.execute(BuildCommandOnly.java:36)
	at org.gradle.launcher.daemon.server.api.DaemonCommandExecution.proceed(DaemonCommandExecution.java:122)
	at org.gradle.launcher.daemon.server.exec.StartBuildOrRespondWithBusy$1.run(StartBuildOrRespondWithBusy.java:50)
	at org.gradle.launcher.daemon.server.DaemonStateCoordinator$1.run(DaemonStateCoordinator.java:295)
	at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
	at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.EOFException: SSL peer shut down incorrectly
	at sun.security.ssl.InputRecord.read(InputRecord.java:505)
	at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:983)
	... 118 more
"Install Android SDK Build-Tools 27.0.3 (revision: 27.0.3)" failed.
Checking the license for package Android SDK Platform 27 in /usr/lib/Android-sdk/platform-tools/licenses
License for package Android SDK Platform 27 accepted.
Preparing "Install Android SDK Platform 27 (revision: 3)".
"Install Android SDK Platform 27 (revision: 3)" ready.
Installing Android SDK Platform 27 in /usr/lib/Android-sdk/platform-tools/platforms/android-27
"Install Android SDK Platform 27 (revision: 3)" complete.
"Install Android SDK Platform 27 (revision: 3)" finished.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':server'.
> Failed to install the following SDK components:
      build-tools;27.0.3 Android SDK Build-Tools 27.0.3
  Install the missing components using the SDK manager in Android Studio.


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 7m 40s
ninja: build stopped: subcommand failed.

@rom1v
Copy link
Collaborator

rom1v commented Jun 25, 2018

Observed package id 'platform-tools' in inconsistent location '/usr/lib/Android-sdk/platform-tools/platform-tools1' (Expected '/usr/lib/Android-sdk/platform-tools/platform-tools')

There is a problem with your Android SDK instalation. Just for info why did you install it in /usr/lib/?

Anyway, you can use the prebuilt server so that you don't have to build it with the Android SDK.

@Vitalic66
Copy link

Thx that worked.

Just another problem with input. From mouse on pi i can control my phone but from touchpanel on pi there is no reaction.

Mouse moves on pi but nothing happends.

@rom1v
Copy link
Collaborator

rom1v commented Jun 25, 2018

Thx that worked.

👍

from touchpanel on pi there is no reaction.

See #22.

@rom1v rom1v closed this as completed Jun 25, 2018
@scott87
Copy link

scott87 commented Oct 3, 2018

Hello,
I have tried this on windows and like it been looking for something like this for a while. Im now trying to use this with raspberry pi. whats the best way to do this??? Could someone give me a simple basic guide to get this going on a Pi. Im runninga fresh latest raspbian at the moment. Thanks in advance any help would be great.

@brendanwalker
Copy link

@scott87 I had luck on the Raspberry Pi 3 with this tutorial:

https://www.linuxuprising.com/2019/03/control-android-devices-from-your.html

I was was using scrcpy for a silly hardware project to get video streaming from the OculusQuest VR headset to the back of my head:

https://www.youtube.com/watch?v=Wm-bfn3tqLM

That said I had to set the RasPi to 800x600 and go full screen to get decent framerate. I launched scrcpy with the following settings for that video:

scrcpy --fullscreen --no-control --bit-rate 2M --crop 1024:768:288:336

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

No branches or pull requests

5 participants