電話機のいくつかの設定をテストしています、そして残念ながら私が持っている唯一のコントロールは今ADBを通してそうです。私の問題は、次のコマンドを介して音楽ファイルの再生を開始できる間に、次の反復を実行できるようにすることはできません。
<事前> <コード> 9988776655443330別のadbコマンドを使用して再生を終了させることが可能であるかどうかわかりませんが、私には見えません -
電話機のいくつかの設定をテストしています、そして残念ながら私が持っている唯一のコントロールは今ADBを通してそうです。私の問題は、次のコマンドを介して音楽ファイルの再生を開始できる間に、次の反復を実行できるようにすることはできません。
<事前> <コード> 9988776655443330別のadbコマンドを使用して再生を終了させることが可能であるかどうかわかりませんが、私には見えません -
I'm testing some settings on a phone, and unfortunately the only control I have is through adb right now. My issue is that while I can start playback of a music file through the following command, I have no way of stopping it so I can perform the next iteration.
adb shell am start -a android.intent.action.View -d "file:///sdcard/Music/mediatest.mp3" -n "com.android.music/.MediaPlaybackActivity"
I don't know if it's possible to end the playback using another adb command, but it doesn't look like it to me - I see there are no Intents that seem to perform that function, nor any activities that are made to stop the media playback.
keyevent ジョブを実行します。
<事前> <コード> KEYCODE_MEDIA_PLAY_PAUSE1 KEYCODE_MEDIA_PLAY_PAUSE2
は<コード> 998877666544333 に対応しています。キーコードが見つかりますこちらまたは
あるいは、再生/一時停止オプションをフィーチャーしたアクティビティがフォアグラウンドにある場合は、次のことができます。
<コード> adb shell input touchscreen tap <X> <Y>
ここで、<コード> 99887665544335 および<コード>および<コード> 99887765544336 は、指を使って再生/一時停止のために実行するタップの座標です。私の答えを参照してくださいここそれらの取得方法を知るために(ステップ1と2 タスク&xposedの下の手順)追加)
または、以下を使用してアプリを完全に殺すことを選択できます。
<事前> <コード> adb shell am force-stop <PKG_NAME> Kitkat以上のコマンド 99887766544338
は、
KEYCODE_MEDIA_PLAY_PAUSE10
は、再生、一時停止、再生、ミュート、ヘッドスポーク、停止、次、前、巻き戻し、レコード、fast-forwordです。 (ソース)
Use KeyEvent to do the job.
adb shell input keyevent 85
85
corresponds to KEYCODE_MEDIA_PLAY_PAUSE
. More keycodes can be found here or here.
Alternatively, if the activity featuring Play/Pause options is in foreground then you can do:
adb shell input touchscreen tap <X> <Y>
where <X>
and <Y>
are the coordinates of the tap that you would perform for Play/Pause using your fingers. See my answer here to know how to obtain them (step 1 and 2 under Instructions for Tasker and Xposed Additions).
Or, you can opt to completely kill the app using:
adb shell am force-stop <PKG_NAME>
Kitkat and above has the command media
whose usage goes as,
adb shell media dispatch KEY
KEY
can be play, pause, play-pause, mute, headsethook, stop, next, previous, rewind, record, fast-forword. (Source)
ADBシェル内の「TOP」コマンドを使用して音楽プレーヤーを停止し、スーパーユーザー(ルート)アクセスを使用して音楽アプリのプロセスIDを強制終了しました。
I stopped music player using "top" command inside adb shell and killing the process id of music app with superuser(ROOT) access.
© 2022 cndgn.com All Rights Reserved. Q&Aハウス 全著作権所有