1/*
2 * Copyright (C) 2022 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *     http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16export class CmdConstant {
17  static CMD_TRACE_FILE_SIZE = 'hdc_std shell  stat --format=%s ';
18  static CMD_SHELL = 'hdc_std shell ';
19  static CMD_MOUNT = 'hdc_std shell mount -o remount,rw /';
20  static CMD_GET_PACKAGE = 'hdc_std shell bm dump -a';
21  static CMD_GET_PROCESS = 'hdc_std shell ps -A -opid,cmd';
22  static CMD_GET_APP_NMAE = 'hdc_std shell ps -A -ocmd';
23  static CMD_GET_CPU_COUNT = "hdc_std shell grep -c 'processor' /proc/cpuinfo";
24  static CMD_GET_HIPERF_EVENTS = 'hdc_std shell hiperf list';
25  static CMD_GET_VERSION = 'hdc_std shell param get const.product.software.version';
26  static CMD_GET_DEBUG_PROCESS = `hdc shell netstat -anp |grep Panda |grep -v grep | sed \'s/.* \\([0-9]*\\)\\/.*/\\1/\' |xargs -r ps -A -opid,cmd`;
27  static CMD_HDC_DEVICES = 'hdc_std list targets';
28  static CMD_MOUNT_DEVICES = 'hdc_std -t {0} shell mount -o remount,rw /';
29  static CMD_GET_PROCESS_DEVICES = 'hdc_std -t {0} shell ps -A -opid,cmd';
30  static CMD_GET_APP_NMAE_DEVICES = 'hdc_std -t {0} shell ps -A -ocmd';
31  static CMD_GET_CPU_COUNT_DEVICES = "hdc_std -t {0} shell grep -c 'processor' /proc/cpuinfo";
32  static CMD_GET_HIPERF_EVENTS_DEVICES = 'hdc_std -t {0} shell hiperf list';
33  static CMD_FIEL_RECV_DEVICES = 'hdc_std -t {0} file recv {1} ./';
34  static CMS_HDC_STOP = 'hdc_std -t {0} shell killall -2 hiprofiler_cmd';
35  static CMS_STOP = 'hdc_std shell killall -2 hiprofiler_cmd';
36  static CMS_HDC_CANCEL =
37    'hdc_std -t {0} shell killall hiprofilerd hiprofiler_plugins native_daemon hiperf hiebpf hiprofiler_cmd';
38  static CMS_CANCEL = 'hdc_std shell killall hiprofilerd hiprofiler_plugins native_daemon hiperf hiebpf hiprofiler_cmd';
39  static CMD_GET_VERSION_DEVICES = 'hdc_std -t {0} shell param get const.product.software.version';
40  static CMD_GET_DEBUG_PROCESS_DEVICES = `hdc_std -t {0} shell netstat -anp |grep Panda 
41  |grep -v grep | sed \'s/.* \\([0-9]*\\)\\/.*/\\1/\' |xargs -r ps -A -opid,cmd`;
42  static CMD_CLEAR_LONG_FOLD = 'hdc_std shell rm -r ';
43  static CMD_MKDIR_LONG_FOLD = 'hdc_std shell mkdir ';
44  static CMD_GET_LONG_FILES = 'hdc_std shell ls ';
45  static CMD_SET_FOLD_AUTHORITY = 'hdc_std shell chmod -R 777 ';
46  static CMD_UNAME = 'hdc shell uname -a';
47}
48