first commit
This commit is contained in:
Executable
+83
@@ -0,0 +1,83 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
#use Modern::Perl;
|
||||
use List::Util 1.33 'any';
|
||||
|
||||
###########################
|
||||
# verify the parameter sent
|
||||
###########################
|
||||
my $num_args = $#ARGV + 1;
|
||||
if ($num_args != 2) {
|
||||
print 'Usage: androidscreen.plx last_ip phone';
|
||||
exit;
|
||||
}
|
||||
my $last_ip = $ARGV[0];
|
||||
my $cell = $ARGV[1];
|
||||
|
||||
unless ($last_ip > 0 and $last_ip < 256) {
|
||||
print 'IP has to be a valid value: 0-255';
|
||||
exit;
|
||||
}
|
||||
|
||||
my @choices = ('pixel7', 'p7side', 'motog');
|
||||
unless (any {$cell eq $_} (@choices)) {
|
||||
print "Invalid cell phone: ${cell}\n";
|
||||
print 'Allowed values are: ' . join(' ', @choices) . "\n";
|
||||
exit;
|
||||
}
|
||||
|
||||
######
|
||||
# vars
|
||||
######
|
||||
my @params = ();
|
||||
if ($cell eq 'pixel7') {
|
||||
@params = (
|
||||
# '--audio-source=playback', #??? stopped working!
|
||||
'--audio-dup',
|
||||
# '--require-audio',
|
||||
'--audio-codec=raw',
|
||||
'--audio-output-buffer=10',
|
||||
'--window-width=432', # 30%
|
||||
'--window-height=936'
|
||||
);
|
||||
} elsif ($cell eq 'p7side') {
|
||||
@params = (
|
||||
# '--audio-source=playback', #??? stopped working!
|
||||
'--audio-dup',
|
||||
# '--require-audio',
|
||||
'--audio-codec=raw',
|
||||
'--audio-output-buffer=10',
|
||||
'--window-width=936',
|
||||
'--window-height=432'
|
||||
);
|
||||
} elsif ($cell eq 'motog') {
|
||||
@params = (
|
||||
'--audio-source=playback',
|
||||
'--audio-dup',
|
||||
'--audio-codec=raw',
|
||||
'--audio-output-buffer=10',
|
||||
'--window-width=432', # 40%
|
||||
'--window-height=955'
|
||||
);
|
||||
} else {
|
||||
@params = (
|
||||
# '--audio-source=playback',
|
||||
# '--audio-dup',
|
||||
'--audio-codec=aac',
|
||||
#'--audio-output-buffer=10'
|
||||
);
|
||||
}
|
||||
|
||||
my $ip3 = '192.168.50';
|
||||
my $port = '5555';
|
||||
my $comm1 = "adb connect ${ip3}.${last_ip}:${port}";
|
||||
my $comm2 = "scrcpy -s ${ip3}.${last_ip}:${port} " . join(' ', @params);
|
||||
|
||||
######
|
||||
# main
|
||||
######
|
||||
# print $comm1 . "\n";
|
||||
qx {$comm1};
|
||||
|
||||
# print $comm2 . "\n";
|
||||
qx {$comm2};
|
||||
Executable
+6
@@ -0,0 +1,6 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
adb kill-server
|
||||
adb start-server
|
||||
sleep 2
|
||||
adb tcpip 5555
|
||||
Reference in New Issue
Block a user