首頁 收藏 QQ群
 網(wǎng)站導(dǎo)航

ZNDS智能電視網(wǎng) 推薦當(dāng)貝市場

TV應(yīng)用下載 / 資源分享區(qū)

軟件下載 | 游戲 | 討論 | 電視計(jì)算器

綜合交流 / 評測 / 活動(dòng)區(qū)

交流區(qū) | 測硬件 | 網(wǎng)站活動(dòng) | Z幣中心

新手入門 / 進(jìn)階 / 社區(qū)互助

新手 | 你問我答 | 免費(fèi)刷機(jī)救磚 | ROM固件

查看: 30173|回復(fù): 1
上一主題 下一主題
[交流&討論]

安卓電視如何使用adb操作WiFi相關(guān)指令?附教程方法

[復(fù)制鏈接]
跳轉(zhuǎn)到指定樓層
樓主
發(fā)表于 2024-7-11 10:04 | 只看該作者 回帖獎(jiǎng)勵(lì) |倒序?yàn)g覽 |閱讀模式 | 來自河北
很多人想通過安卓電視來操作里面的WiFi去更改區(qū)域或者開adb,但是不知道安卓電視如何使用adb操作WiFi相關(guān)指令?今天就給大家分享下教程。



一、安卓電視如何使用adb操作WiFi相關(guān)指令?附教程方法


沒有系統(tǒng)原生設(shè)置應(yīng)用又需要調(diào)試WiFi功能時(shí),可以使用如下指令來驗(yàn)證WiFi相關(guān)功能

最常用的就是 svc wifi enable/disable,再使用wpa_supplicant/wpa_cli來驗(yàn)證,但對于AP功能就沒辦法驗(yàn)證了,其實(shí)Android有組很強(qiáng)大的shell指令集,包含各個(gè)方便,這里只記錄下平時(shí)使用的WiFi相關(guān)指令

1.adb shell cmd wifi -h

查看WiFi所有指令以及參數(shù)

2.打開關(guān)閉WLAN

adb shell cmd wifi set-wifi-enabled enabled

adb shell cmd wifi set-wifi-enabled disabled

3.掃描WiFi

adb shell cmd wifi start-scan             //掃描

adb shell cmd wifi list-scan-results    //查看掃描結(jié)果

4.連接WiFi

adb shell cmd wifi connect-network TP-LINK_5G_0FE1 wpa2 12345678

//TP-LINK_5G_0FE1 連接WiFi名稱

//wpa2 加密方式

//12345678 密碼

5.查看WiFi狀態(tài)

adb shell cmd wifi status

6.打開關(guān)閉熱點(diǎn)

adb shell cmd wifi start-softap ap_ssidxx wpa2 12345678 -b5

// ap_ssidxx  熱點(diǎn)名稱

// wpa2 加密方式

//12345678 密碼

//-b5 5G頻段

adb shell cmd wifi stop-softap

其他可以指令可以使用adb shell cmd wifi -h查看,如果需要連接WiFi以外的相關(guān)指令可以使用adb shell cmd -l(小寫L)

  1. Wi-Fi (wifi) commands:
  2.   help or -h
  3.     Print this help text.
  4.   get-country-code
  5.     Gets country code as a two-letter string
  6.   set-wifi-enabled enabled|disabled
  7.     Enables/disables Wifi on this device.
  8.   set-scan-always-available enabled|disabled
  9.     Sets whether scanning should be available even when wifi is off.
  10.   list-scan-results
  11.     Lists the latest scan results
  12.   start-scan
  13.     Start a new scan
  14.   list-networks
  15.     Lists the saved networks
  16.   connect-network <ssid> open|owe|wpa2|wpa3 [<passphrase>] [-m] [-d] [-b <bssid>]
  17.     Connect to a network with provided params and add to saved networks list
  18.     <ssid> - SSID of the network
  19.     open|owe|wpa2|wpa3 - Security type of the network.
  20.         - Use 'open' or 'owe' for networks with no passphrase
  21.            - 'open' - Open networks (Most prevalent)
  22.            - 'owe' - Enhanced open networks
  23.         - Use 'wpa2' or 'wpa3' for networks with passphrase
  24.            - 'wpa2' - WPA-2 PSK networks (Most prevalent)
  25.            - 'wpa3' - WPA-3 PSK networks
  26.     -m - Mark the network metered.
  27.     -d - Mark the network autojoin disabled.
  28.     -b <bssid> - Set specific BSSID.
  29.   add-network <ssid> open|owe|wpa2|wpa3 [<passphrase>] [-m] [-d] [-b <bssid>]
  30.     Add/update saved network with provided params
  31.     <ssid> - SSID of the network
  32.     open|owe|wpa2|wpa3 - Security type of the network.
  33.         - Use 'open' or 'owe' for networks with no passphrase
  34.            - 'open' - Open networks (Most prevalent)
  35.            - 'owe' - Enhanced open networks
  36.         - Use 'wpa2' or 'wpa3' for networks with passphrase
  37.            - 'wpa2' - WPA-2 PSK networks (Most prevalent)
  38.            - 'wpa3' - WPA-3 PSK networks
  39.     -m - Mark the network metered.
  40.     -d - Mark the network autojoin disabled.
  41.     -b <bssid> - Set specific BSSID.
  42.   forget-network <networkId>
  43.     Remove the network mentioned by <networkId>
  44.         - Use list-networks to retrieve <networkId> for the network
  45.   status
  46.     Current wifi status
  47.   set-verbose-logging enabled|disabled
  48.     Set the verbose logging enabled or disabled
  49.   add-suggestion <ssid> open|owe|wpa2|wpa3 [<passphrase>] [-u] [-m] [-s] [-d][-b <bssid>]
  50.     Add a network suggestion with provided params
  51.     Use 'network-suggestions-set-user-approved com.android.shell yes' to approve suggestions added via shell (Needs root access)
  52.     <ssid> - SSID of the network
  53.     open|owe|wpa2|wpa3 - Security type of the network.
  54.         - Use 'open' or 'owe' for networks with no passphrase
  55.            - 'open' - Open networks (Most prevalent)
  56.            - 'owe' - Enhanced open networks
  57.         - Use 'wpa2' or 'wpa3' for networks with passphrase
  58.            - 'wpa2' - WPA-2 PSK networks (Most prevalent)
  59.            - 'wpa3' - WPA-3 PSK networks
  60.     -u - Mark the suggestion untrusted.
  61.     -m - Mark the suggestion metered.
  62.     -s - Share the suggestion with user.
  63.     -d - Mark the suggestion autojoin disabled.
  64.     -b <bssid> - Set specific BSSID.
  65.   remove-suggestion <ssid>
  66.     Remove a network suggestion with provided SSID of the network
  67.   remove-all-suggestions
  68.     Removes all suggestions added via shell
  69.   list-suggestions
  70.     Lists the suggested networks added via shell
  71.   set-connected-score <score>
  72.     Set connected wifi network score (to choose between LTE & Wifi for default route).
  73.     This turns off the active connected scorer (default or external).
  74.     Only works while connected to a wifi network. This score will stay in effect until you call reset-connected-score or the device disconnects from the current network.
  75.     <score> - Integer score should be in the range of 0 - 60
  76.   reset-connected-score
  77.     Turns on the default connected scorer.
  78.     Note: Will clear any external scorer set.
  79.   start-softap <ssid> (open|wpa2) <passphrase> [-b 2|5|6|any]
  80.     Start softap with provided params
  81.     Note that the shell command doesn't activate internet tethering. In some devices, internet sharing is possible when Wi-Fi STA is also enabled and isassociated to another AP with internet access.
  82.     <ssid> - SSID of the network
  83.     open|wpa2 - Security type of the network.
  84.         - Use 'open' for networks with no passphrase
  85.         - Use 'wpa2' for networks with passphrase
  86.     -b 2|5|6|any - select the preferred band.
  87.         - Use '2' to select 2.4GHz band as the preferred band
  88.         - Use '5' to select 5GHz band as the preferred band
  89.         - Use '6' to select 6GHz band as the preferred band
  90.         - Use 'any' to indicate no band preference
  91.     Note: If the band option is not provided, 2.4GHz is the preferred band.
  92.           The exact channel is auto-selected by FW unless overridden by force-softap-channel command
  93.   stop-softap
  94.     Stop softap (hotspot)
  95.   set-ipreach-disconnect enabled|disabled
  96.     Sets whether CMD_IP_REACHABILITY_LOST events should trigger disconnects.
  97.   get-ipreach-disconnect
  98.     Gets setting of CMD_IP_REACHABILITY_LOST events triggering disconnects.
  99.   set-poll-rssi-interval-msecs <int>
  100.     Sets the interval between RSSI polls to <int> milliseconds.
  101.   get-poll-rssi-interval-msecs
  102.     Gets current interval between RSSI polls, in milliseconds.
  103.   force-hi-perf-mode enabled|disabled
  104.     Sets whether hi-perf mode is forced or left for normal operation.
  105.   force-low-latency-mode enabled|disabled
  106.     Sets whether low latency mode is forced or left for normal operation.
  107.   network-suggestions-set-user-approved <package name> yes|no
  108.     Sets whether network suggestions from the app is approved or not.
  109.   network-suggestions-has-user-approved <package name>
  110.     Queries whether network suggestions from the app is approved or not.
  111.   imsi-protection-exemption-set-user-approved-for-carrier <carrier id> yes|no
  112.     Sets whether Imsi protection exemption for carrier is approved or not
  113.   imsi-protection-exemption-has-user-approved-for-carrier <carrier id>
  114.     Queries whether Imsi protection exemption for carrier is approved or not
  115.   imsi-protection-exemption-clear-user-approved-for-carrier <carrier id>
  116.     Clear the user choice on Imsi protection exemption for carrier
  117.   network-requests-remove-user-approved-access-points <package name>
  118.     Removes all user approved network requests for the app.
  119.   clear-user-disabled-networks
  120.     Clears the user disabled networks list.
  121.   send-link-probe
  122.     Manually triggers a link probe.
  123.   force-softap-channel enabled <int> | disabled
  124.     Sets whether soft AP channel is forced to <int> MHz
  125.     or left for normal   operation.
  126.   force-country-code enabled <two-letter code> | disabled
  127.     Sets country code to <two-letter code> or left for normal value
  128.   set-wifi-watchdog enabled|disabled
  129.     Sets whether wifi watchdog should trigger recovery
  130.   get-wifi-watchdog
  131.     Gets setting of wifi watchdog trigger recovery.
  132.   get-softap-supported-features
  133.     Gets softap supported features. Will print 'wifi_softap_acs_supported'
  134.     and/or 'wifi_softap_wpa3_sae_supported', each on a separate line.
  135.   settings-reset
  136.     Initiates wifi settings reset
  137.   add-request <ssid> open|owe|wpa2|wpa3 [<passphrase>] [-b <bssid>]
  138.     Add a network request with provided params
  139.     Use 'network-requests-set-user-approved android yes' to pre-approve requests added via rooted shell (Not persisted)
  140.     <ssid> - SSID of the network
  141.     open|owe|wpa2|wpa3 - Security type of the network.
  142.         - Use 'open' or 'owe' for networks with no passphrase
  143.            - 'open' - Open networks (Most prevalent)
  144.            - 'owe' - Enhanced open networks
  145.         - Use 'wpa2' or 'wpa3' for networks with passphrase
  146.            - 'wpa2' - WPA-2 PSK networks (Most prevalent)
  147.            - 'wpa3' - WPA-3 PSK networks
  148.     -b <bssid> - Set specific BSSID.
  149.   remove-request <ssid>
  150.     Remove a network request with provided SSID of the network
  151.   remove-all-requests
  152.     Removes all active requests added via shell
  153.   list-requests
  154.     Lists the requested networks added via shell
  155.   network-requests-set-user-approved <package name> yes|no
  156.     Sets whether network requests from the app is approved or not.
  157.     Note: Only 1 such app can be approved from the shell at a time
  158.   network-requests-has-user-approved <package name>
  159.     Queries whether network requests from the app is approved or not.
  160.     Note: This only returns whether the app was set via the 'network-requests-set-user-approved' shell command
  161.   qca-list-ifaces
  162.     Lists active STA/AP interfaces (could be bridge interfaces). Command to set bridge iface will only apply to the first internal iface
  163.   qca-set-txpower <iface> <power in dBm>
  164.     Sets max txpower in dBm, and <iface> is from 'qca-list-ifaces'
  165.   qca-set-ani-level <iface> <auto|fixed> [<ofdmlvl>]
  166.     Sets ani level, and <iface> is from 'qca-list-ifaces'
  167.   qca-get-thermal-info <iface>
  168.     Gets thermal info, and <iface> is from 'qca-list-ifaces'
  169.   qca-dump-thermal-events
  170.     Dump thermal events from driver/firmware after boot
  171.   qca-set-congestion-report <iface> <enable|disable> [<threshold> [interval]]
  172.     Sets congestion report, and <iface> is AP iface from 'qca-list-ifaces'
  173.   qca-dump-congestion-events
  174.     Dump congestion events from driver/firmware after boot
復(fù)制代碼

以上就是我對“安卓電視如何使用adb操作WiFi相關(guān)指令?附教程方法”得內(nèi)容分享,如果還有其他問題可以在評論區(qū)留言。



相關(guān)閱讀:

上一篇:什么軟件看電視劇全部免費(fèi)?2024免費(fèi)看電視劇的軟件合集
下一篇:如何使用ADB工具卸載電視預(yù)裝app、去廣告、修改默認(rèn)桌面
沙發(fā)
發(fā)表于 2024-7-11 10:05 | 只看該作者 | 來自山東
學(xué)到了
您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規(guī)則

Archiver|新帖|標(biāo)簽|軟件|Sitemap|ZNDS智能電視網(wǎng) ( 蘇ICP備2023012627號 )

網(wǎng)絡(luò)信息服務(wù)信用承諾書 | 增值電信業(yè)務(wù)經(jīng)營許可證:蘇B2-20221768 丨 蘇公網(wǎng)安備 32011402011373號

GMT+8, 2024-12-27 09:25 , Processed in 0.062481 second(s), 13 queries , Redis On.

Powered by Discuz!

監(jiān)督舉報(bào):report#znds.com (請將#替換為@)

© 2007-2024 ZNDS.Com

快速回復(fù) 返回頂部 返回列表