adb shell 後續繼續輸入命令

2021-07-02 20:54:50 字數 413 閱讀 2864

在python中,使用os.system是每次都啟動乙個新的程序,但使用adb shell後,後續要輸入的命令就是要在原來程序上輸入的,下面列出我知道 的兩個解決方案吧,

一、通過在system中一次整合輸入所有的命令,達到在adb shell 後輸入命令的方式

os.system('adb shell su -c "cat /data/data/***.kdb >/sdcard/%s"' %temp_upload_file)
這個就是拷貝乙個檔案到sdcard目錄下的方法

二、使用python的subprocess模組

其實這個模組是取代os.system/os.popen的,這個模組的可以啟動乙個新的程序,而已還能不斷的住裡傳引數,還有輸出結果,這裡先說明下,自己再試試,到時候把結果住這裡貼出來。

CTCall簡介(後續會繼續補充)

使用ctcall需要匯入coretelephony.framework框架。ctcall的基本使用 1 初始化call cfstringref number cfstr 15555555555 ctcallref call ctcalldial number 建立並撥號 ctcallhold cal...

字串函式 後續繼續補充

a sdfgewa 索引 下標 切片 a 0 2 strip 去除空格 tab鍵等 split 分割函式 split s 以空格,換行以及製表符進行分割,可以自己指定,可以指定切割的次數 replace 替換函式 replace old new 1 第乙個舊的值,第二個是新的值,可以指定替換的次數 ...

C 通過匿名管道操作adb shell的輸入輸出

我封裝了乙個類cadbshell,用於方便地來操作adb shell命令,使用方法 cadbshell shell shell.start shell.runcmd su ncd data data n shell.runcmd cd strpackagename nls shell.stop 標頭...