GithubHelp home page GithubHelp logo

pr4bh4sh / adb-wifi-setting-manager Goto Github PK

View Code? Open in Web Editor NEW
56.0 3.0 10.0 147 KB

Control wifi connections on Android with adb

License: The Unlicense

Java 100.00%
android adb test-automation adb-android adb-commands wifi

adb-wifi-setting-manager's Introduction

adb-wifi-setting-manager

Control wifi connection with adb

Here are some use-cases

  1. Switch between wifi networks when running automation tests without manual intervention.
  2. You have 2 wifi networks, one fast and one slow and you want to create automated tests for the app's behaviour on low bandwidth.
  3. You have two Wi-Fi networks, one in the internal network and the other outside the internal network, and you want to test the app behaviour on both networks.
  4. You have several wifi networks, and you are too lazy to type the wifi passwords every time you set up a new Android phone. Just create a shell script or copy-paste the command to set up the new device.

Note

- This app is created for interacting with Wi-Fi networks while running automated tests.
- Due to the security measures of Android OS, this app can't manipulate(delete, update) existing
- wifi networks unless it was added by the 'adb-wifi-setting-manager' app.
- So if you wish to have full control of the SSID saved on the device with this app,
- please remove all saved Wi-Fi networks on your device manually and use this app for all action 
- e.g. adding, or removing new Wi-Fi networks.

Commands:


To download apk:

wget https://github.com/pr4bh4sh/adb-wifi-setting-manager/releases/download/1.0/adb-wifi-setting-manager-debug.apk

To install apk

adb install adb-wifi-setting-manager-debug.apk

To enable wifi:

adb shell 'am start -n 'com.adbwifisettingsmanager/.WifiSettingsManagerActivity' --esn enableWifi'

To disable wifi:

adb shell 'am start -n 'com.adbwifisettingsmanager/.WifiSettingsManagerActivity' --esn disableWifi'

To connect to saved wifi network:

adb shell 'am start -n 'com.adbwifisettingsmanager/.WifiSettingsManagerActivity' --esn connect -e ssid <ssid_name>'

To connect to new wifi network:

adb shell 'am start -n 'com.adbwifisettingsmanager/.WifiSettingsManagerActivity' --esn newConnection -e ssid <ssid_name> -e password <password>'

Connect to Wifi with user name and Password:

adb shell am start -n 'com.adbwifisettingsmanager/.WifiSettingsManagerActivity' --esn connect -e ssid <ssid_name> -e userName <user_name> -e password <password>'

Forget a saved Wi-Fi SSID

  1. Forget a specific SSID

    adb shell am start -n 'com.adbwifisettingsmanager/.WifiSettingsManagerActivity' --esn remove -e ssid <ssid_name>'

  2. Forget all SSID

    adb shell am start -n 'com.adbwifisettingsmanager/.WifiSettingsManagerActivity' --esn remove -e ssid 'all'' # you can put 'all' or 'All'

TODO

  • Add all adb commands in readme
  • Add proxy server support
  • Add support for more encryption types

Reference:

  1. https://github.com/steinwurf/adb-join-wifi
  2. https://github.com/bitweft/android-settings-manager

adb-wifi-setting-manager's People

Contributors

pauls0 avatar pr4bh4sh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

adb-wifi-setting-manager's Issues

Apk

Do you have an apk file?

Please Add support for Non-Encrypted Wifi

Hello, I'm going to use your app for Automatic Testing. However, I need my phones connecting to non-encrypted wifi. Could you please update the "connect to new wifi network" command?

for example, I can connect to a non-encrypted wifi using commands below:
adb shell am start -n 'com.adbwifisettingsmanager/.WifiSettingsManagerActivity' --esn newConnection -e ssid <ssid_name>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.