xref: /aosp_15_r20/external/libchrome/build/android/pylib/restart_adbd.sh (revision 635a864187cb8b6c713ff48b7e790a6b21769273)
1*635a8641SAndroid Build Coastguard Worker#!/system/bin/sh
2*635a8641SAndroid Build Coastguard Worker
3*635a8641SAndroid Build Coastguard Worker# Copyright 2014 The Chromium Authors. All rights reserved.
4*635a8641SAndroid Build Coastguard Worker# Use of this source code is governed by a BSD-style license that can be
5*635a8641SAndroid Build Coastguard Worker# found in the LICENSE file.
6*635a8641SAndroid Build Coastguard Worker
7*635a8641SAndroid Build Coastguard Worker# Android shell script to restart adbd on the device. This has to be run
8*635a8641SAndroid Build Coastguard Worker# atomically as a shell script because stopping adbd prevents further commands
9*635a8641SAndroid Build Coastguard Worker# from running (even if called in the same adb shell).
10*635a8641SAndroid Build Coastguard Worker
11*635a8641SAndroid Build Coastguard Workertrap '' HUP
12*635a8641SAndroid Build Coastguard Workertrap '' TERM
13*635a8641SAndroid Build Coastguard Workertrap '' PIPE
14*635a8641SAndroid Build Coastguard Worker
15*635a8641SAndroid Build Coastguard Workerfunction restart() {
16*635a8641SAndroid Build Coastguard Worker  stop adbd
17*635a8641SAndroid Build Coastguard Worker  start adbd
18*635a8641SAndroid Build Coastguard Worker}
19*635a8641SAndroid Build Coastguard Worker
20*635a8641SAndroid Build Coastguard Workerrestart &
21