mirror of
https://github.com/barry-ran/QtScrcpy.git
synced 2025-09-26 03:09:06 +00:00
feat: support audio on mac
This commit is contained in:
parent
fb632ffb25
commit
ff7db18d5f
2 changed files with 48 additions and 3 deletions
|
@ -80,7 +80,7 @@ bool AudioOutput::runSndcpyProcess(const QString &serial, int port)
|
||||||
params << QString("%1").arg(port);
|
params << QString("%1").arg(port);
|
||||||
m_sndcpy.start("bash", params);
|
m_sndcpy.start("bash", params);
|
||||||
#endif
|
#endif
|
||||||
/*
|
|
||||||
if (!m_sndcpy.waitForStarted()) {
|
if (!m_sndcpy.waitForStarted()) {
|
||||||
qWarning() << "AudioOutput::start sndcpy.bat failed";
|
qWarning() << "AudioOutput::start sndcpy.bat failed";
|
||||||
return false;
|
return false;
|
||||||
|
@ -89,7 +89,7 @@ bool AudioOutput::runSndcpyProcess(const QString &serial, int port)
|
||||||
qWarning() << "AudioOutput::sndcpy.bat crashed";
|
qWarning() << "AudioOutput::sndcpy.bat crashed";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1 +1,46 @@
|
||||||
echo aaaa
|
#!/bin/bash
|
||||||
|
|
||||||
|
echo Begin Runing...
|
||||||
|
SNDCPY_PORT=28200
|
||||||
|
SNDCPY_APK=sndcpy.apk
|
||||||
|
ADB=./adb
|
||||||
|
|
||||||
|
serial=
|
||||||
|
if [[ $# -ge 2 ]]
|
||||||
|
then
|
||||||
|
serial="-s $1"
|
||||||
|
SNDCPY_PORT=$2
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Waiting for device $1..."
|
||||||
|
$ADB $serial wait-for-device
|
||||||
|
echo "Find device $1"
|
||||||
|
|
||||||
|
sndcpy_installed=$($ADB $serial shell pm path com.rom1v.sndcpy)
|
||||||
|
if [[ $sndcpy_installed == "" ]]; then
|
||||||
|
echo Install $SNDCPY_APK...
|
||||||
|
$ADB $serial uninstall com.rom1v.sndcpy
|
||||||
|
$ADB $serial install -t -r -g $SNDCPY_APK
|
||||||
|
echo Install $SNDCPY_APK success
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo Request PROJECT_MEDIA permission...
|
||||||
|
$ADB $serial shell appops set com.rom1v.sndcpy PROJECT_MEDIA allow
|
||||||
|
|
||||||
|
echo Forward port $SNDCPY_PORT...
|
||||||
|
$ADB $serial forward tcp:$SNDCPY_PORT localabstract:sndcpy
|
||||||
|
|
||||||
|
echo Start $SNDCPY_APK...
|
||||||
|
$ADB $serial shell am start com.rom1v.sndcpy/.MainActivity
|
||||||
|
|
||||||
|
while ((1))
|
||||||
|
do
|
||||||
|
echo Waiting $SNDCPY_APK start...
|
||||||
|
sleep 0.1
|
||||||
|
sndcpy_started=$($ADB shell 'ps | grep com.rom1v.sndcpy')
|
||||||
|
if [[ $sndcpy_started != "" ]]; then
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
echo Ready playing...
|
Loading…
Add table
Add a link
Reference in a new issue