删除规避弹窗的命令,增加linux环境下last目录的区分操作

Signed-off-by: deveco_xdevice <liguangjie1@huawei.com>
This commit is contained in:
deveco_xdevice 2023-08-10 12:17:09 +08:00
parent ba15202dd7
commit c51c6608b1
2 changed files with 11 additions and 5 deletions

View File

@ -693,8 +693,6 @@ class AppInstallKit(ITestKit):
if len(self.app_list) == 0:
LOG.info("No app to install, skipping!")
return
# to disable app install alert
device.execute_shell_command("setprop persist.sys.platformautotest 1")
for app in self.app_list:
if self.alt_dir:
app_file = get_file_absolute_path(app, self.paths,

View File

@ -15,8 +15,9 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
import getpass
import os
import platform
import sys
import tempfile
from dataclasses import dataclass
@ -66,8 +67,7 @@ def _init_global_config():
MODULES_DIR, "_core", "resource"))
# create xdevice temp folder
Variables.temp_dir = os.path.join(tempfile.gettempdir(),
"xdevice_data")
Variables.temp_dir = os.path.join(_get_temp_dir(), "xdevice_data")
if not os.path.exists(Variables.temp_dir):
os.makedirs(Variables.temp_dir)
@ -97,6 +97,14 @@ def _init_global_config():
_init_logger()
def _get_temp_dir():
name = platform.system()
if name == "Linux":
return os.path.join(tempfile.gettempdir(), getpass.getuser())
else:
return tempfile.gettempdir()
def _init_logger():
import time
from _core.constants import LogType