5 ADB 與應用互動

2021-10-19 10:56:28 字數 1241 閱讀 2039

主要是使用am命令,常用的如下:

command

用途start [options]啟動 指定的activity

startservice [options]啟動 指定的service

broadcast [options]傳送 指定的廣播

force-stop停止 相關的程序

引數很靈活,和寫 android 程式時**裡的 intent 相對應。

用於決定 intent 物件的選項如下:

引數含義

-a指定action,比如 android.intent.action.view

-c-n

adb shell am start [options]

adb shell am start -n com.tencent.mm/.ui.launcherui
adb shell am startservice [options]

adb shell am stopservice [options]

adb shell am broadcast [options]

adb shell am force-stop 
adb shell am send-trim-memory  

pid: 程序 id

level: hidden、running_moderate、background、 running_low、moderate、running_critical、complete

命令示例:

adb shell am send-trim-memory 12345 running_low
表示向pid=12345 的程序,發出level=running_low 的收緊記憶體命令。

adb 5 與應用互動

主要是使用am命令,常用的如下 command 用途start options 啟動指定的 activity startservice options 啟動指定的 service broadcast options 傳送指定的廣播 force stop 停止相關的程序 引數很靈活,和寫 androi...

iOS應用喚醒與互動

實現應用之間的跳轉通訊需要了解最重要的是url schema 本來我想說幾句我的理解,後來看到了網上別人的見解之後,發現自己確實是麻瓜,文章 個人目前的理解url scheme就是為了應用之間通訊和互動而存在的 現在舉個例子說說怎麼用呢 nsstring urlstr url absolutestr...

iOS webview與H5的互動

元件採用私有 cocoapods 來實現,並採用了 local pods 的方式,可以在本地不提交 的情況下,元件與呼叫方實現除錯。元件間的頁面間跳轉支援 openurl 的方式,由 oneroute 模組進行管理,頁面在 void load 方法中完成註冊,oneroute 內部儲存乙份 url ...