termux - Termux:API

要讓 termux 可以獲取手機資訊或是跟手機進行互動,可以安裝 Termux:API application。


然後在 termux 安裝 termux-api。

pkg install termux-api


Termux:API 提供如下功能:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
termux-battery-status
Get the status of the device battery.

termux-brightness
Set the screen brightness between 0 and 255.

termux-call-log
List call log history.

termux-camera-info
Get information about device camera(s).

termux-camera-photo
Take a photo and save it to a file in JPEG format.

termux-clipboard-get
Get the system clipboard text.

termux-clipboard-set
Set the system clipboard text.

termux-contact-list
List all contacts.

termux-dialog
Show a text entry dialog.

termux-download
Download a resource using the system download manager.

termux-fingerprint
Use fingerprint sensor on device to check for authentication.

termux-infrared-frequencies
Query the infrared transmitter's supported carrier frequencies.

termux-infrared-transmit
Transmit an infrared pattern.

termux-location
Get the device location.

termux-media-player
Play media files.

termux-media-scan
MediaScanner interface, make file changes visible to Android Gallery

termux-microphone-record
Recording using microphone on your device.

termux-notification
Display a system notification.

termux-notification-remove
Remove a notification previously shown with termux-notification --id.

termux-sensor
Get information about types of sensors as well as live data.

termux-share
Share a file specified as argument or the text received on stdin.

termux-sms-inbox
List received SMS messages.

termux-sms-send
Send a SMS message to the specified recipient number(s).

termux-storage-get
Request a file from the system and output it to the specified file.

termux-telephony-call
Call a telephony number.

termux-telephony-cellinfo
Get information about all observed cell information from all radios on the device including the primary and neighboring cells.

termux-telephony-deviceinfo
Get information about the telephony device.

termux-toast
Show a transient popup notification.

termux-torch
Toggle LED Torch on device.

termux-tts-engines
Get information about the available text-to-speech engines.

termux-tts-speak
Speak text with a system text-to-speech engine.

termux-vibrate
Vibrate the device.

termux-volume
Change volume of audio stream.

termux-wallpaper
Change wallpaper on your device.

termux-wifi-connectioninfo
Get information about the current wifi connection.

termux-wifi-enable
Toggle Wi-Fi On/Off. termux-wifi-enable false or termux-wifi-enable true.

termux-wifi-scaninfo
Get information about the last wifi scan.


像是 termux-battery-status 可以取得電池資訊。


termux-camera-info 可以取得相機資訊。


termux-clipboard-set 可設定資料到剪貼簿。


termux-clipboard-get 可取得剪貼簿內的資料。