Preface
There're four application components in Android. They're Activities, Services, Broadcast receivers, and Content providers.There's only one component has User Interface. That's Activities. Activity Manger can help you to control the application components in Android. Let's take a look how to well use the Activity Manager for our work.
Introduction
There's a shell command called am, which performs the task by Activity Manager. The help of am, you can send the adb command - adb shell am when your computer are connect to your Android device.
usage: am [subcommand] [options]
usage: am start [-D] [-W] [-P
[--R COUNT] [-S] [--opengl-trace]
am startservice
am force-stop
am kill
am kill-all
am broadcast
am instrument [-r] [-e
[--no-window-animation]
am profile start
am profile stop [
am dumpheap [flags]
am set-debug-app [-w] [--persistent]
am clear-debug-app
am monitor [--gdb
am screen-compat [on|off]
am display-size [reset|MxN]
am to-uri [INTENT]
am to-intent-uri [INTENT]
am start: start an Activity. Options are:
-D: enable debugging
-W: wait for launch to complete
--start-profiler
-P
-R: repeat the activity launch
the top activity will be finished.
-S: force stop the target app before starting the activity
--opengl-trace: enable tracing of OpenGL functions
am startservice: start a Service.
am force-stop: force stop everything associated with
am kill: Kill all processes associated with
processes that are safe to kill -- that is, will not impact the user
experience.
am kill-all: Kill all background processes.
am broadcast: send a broadcast Intent.
am instrument: start an Instrumentation. Typically this target
is the form
-r: print raw results (otherwise decode REPORT_KEY_STREAMRESULT). Use with
[-e perf true] to generate raw output for performance measurements.
-e
common form is [-e
-p
-w: wait for instrumentation to finish before returning. Required for
test runners.
--no-window-animation: turn off window animations will running.
am profile: start and stop profiler on a process.
am dumpheap: dump the heap of a process. Options are:
-n: dump native heap instead of managed heap
am set-debug-app: set application
-w: wait for debugger when application starts
--persistent: retain this value
am clear-debug-app: clear the previously set-debug-app.
am monitor: start monitoring for crashes or ANRs.
--gdb: start gdbserv on the given port at crash/ANR
am screen-compat: control screen compatibility mode of
am display-size: override display size.
am to-uri: print the given Intent specification as a URI.
am to-intent-uri: print the given Intent specification as an intent: URI.
[-a
[-c
[-e|--es
[--esn
[--ez
[--ei
[--el
[--ef
[--eu
[--ecn
[--eia
[--grant-read-uri-permission] [--grant-write-uri-permission]
[--debug-log-resolution] [--exclude-stopped-packages]
[--include-stopped-packages]
[--activity-brought-to-front] [--activity-clear-top]
[--activity-clear-when-task-reset] [--activity-exclude-from-recents]
[--activity-launched-from-history] [--activity-multiple-task]
[--activity-no-animation] [--activity-no-history]
[--activity-no-user-action] [--activity-previous-is-top]
[--activity-reorder-to-front] [--activity-reset-task-if-needed]
[--activity-single-top] [--activity-clear-task]
[--activity-task-on-home]
[--receiver-registered-only] [--receiver-replace-pending]
[--selector]
[
Sample applications:
Force to stop working for specified package,
adb shell "am -force-stop PACKAGE"
Ex:
adb shell "am -force-stop com.android.browser"
In this case, if the browser is in the foreground, the browser would be stopped working and dismissed.
Note, the relative package would also be forced to stop working.
Trigger Android device to bring up the broswer and open a specified URL
adb shell "am start -a android.intent.action.VIEW -d url"
Within this command, start stands for doing something, -a stands for action, and -d stands for the data of action required.
Ex:
adb shell "am start -a android.intent.action.VIEW -d http://google.com"
This example represents a view action for opening a url.
Make a phone call
adb shell "am start -a android.intent.action.CALL -d tel:phone_number"
Within this command, action is to make a call - android.intent.action.CALL, and action data is tel:phone_number.
Ex:
am start -a android.intent.action.CALL -d tel:777
In this example, Android device would make a phone call with number 777.
Launch an activity with specified package name
adb shell "am start -n package/activity_name_or_full_activity_name_with_package"
Within this example, -n is followed by component name and the component would be launched by executing this command.
Ex:
adb shell "am start -n com.android.settings/com.android.settings.Settings"
In this example, the settings activity would be brought up to top screen.
Create a new contact by am
adb shell "am start -a android.intent.action.INSERT -t vnd.android.cursor.dir/contact -e name 'Android Auto' -e phone 1234567890"
Within the command, action is insertion, -t stands for MIME type of inserting data in contact, -e stands for extra key that is defined in Manifest XML file, the name is followed by -e for the extra key to be used for contact, and the value of extra key - name is followed by extra key - name. The parameters for -e phone 1234567890 has identical usage with -e name 'Anddroid Auto'. Contract app would fill the field of assigning extra keys for new contact in Android after executing above command. With respecting to action - android.intent.action.INSERT, it's necessary to have this configuration in Manifest XML. Or Android would do nothing for this command. That means in case you want to use this command on another activity, you need to check if this configuration's existed in Manifest XML file of the App you want to control.
There're a lot of parameters you can use for controlling Android. Above examples provided you some idea to extend your usage for your work
Bursa
回覆刪除Kırşehir
Muş
Mersin
Çanakkale
RN61A
van evden eve nakliyat
回覆刪除sivas evden eve nakliyat
çankırı evden eve nakliyat
bartın evden eve nakliyat
erzincan evden eve nakliyat
SSBZM
sivas evden eve nakliyat
回覆刪除erzurum evden eve nakliyat
bitlis evden eve nakliyat
mardin evden eve nakliyat
rize evden eve nakliyat
ZF62A
76743
回覆刪除düzce bedava görüntülü sohbet sitesi
yalova sohbet chat
adana kadınlarla sohbet
siirt random görüntülü sohbet
kocaeli rastgele görüntülü sohbet ücretsiz
mobil sohbet chat
ücretsiz sohbet odaları
karaman ücretsiz sohbet uygulaması
çankırı canlı sohbet siteleri ücretsiz
D84E2
回覆刪除Kadınlarla Sohbet Et
kadınlarla ücretsiz sohbet
edirne en iyi ücretsiz görüntülü sohbet siteleri
canlı sohbet bedava
burdur nanytoo sohbet
izmir sohbet
erzurum canli sohbet chat
çanakkale canli sohbet
kastamonu rastgele sohbet odaları
2079A
回覆刪除Youtube İzlenme Satın Al
Parasız Görüntülü Sohbet
Threads Yeniden Paylaş Hilesi
Bitcoin Çıkarma Siteleri
Instagram Takipçi Hilesi
Soundcloud Reposts Hilesi
Qlc Coin Hangi Borsada
Clubhouse Takipçi Satın Al
Bitcoin Nasıl Çıkarılır
BCE41
回覆刪除Bitcoin Yatırımı Nasıl Yapılır
Bone Coin Hangi Borsada
Binance Borsası Güvenilir mi
Bitcoin Kazanma Siteleri
Binance Kaldıraçlı İşlem Nasıl Yapılır
Bitcoin Nasıl Alınır
Facebook Sayfa Beğeni Satın Al
Nonolive Takipçi Hilesi
Binance Borsası Güvenilir mi
RFHJYTJUY
回覆刪除شركة كشف تسربات المياه بالقطيف
ergfrdhjtngjhgjk
回覆刪除شركة مكافحة حشرات بالاحساء
9AD76B28E7
回覆刪除takipçi satın al