Wifi has been enabled on my android device. Usually to connect an available network, I input username and password from UI. Is it possible to do it via ADB or shell script?
            Asked
            
        
        
            Active
            
        
            Viewed 4,643 times
        
    2
            
            
        - 
                    the question is nice and i also want to connect but don't know the answer – Trikaldarshiii Sep 22 '13 at 18:12
- 
                    I don't think so, you don't have API. through Java or NDK C native – Maxim Shoustin Sep 22 '13 at 18:23
- 
                    if you have root you can do this: http://stackoverflow.com/questions/8708886/connecting-to-wi-fi-using-adb-shell – Leonidos Sep 22 '13 at 22:26
- 
                    you can use `adb shell input` and try out through UI – Rilwan Sep 23 '13 at 17:22
3 Answers
0
            
            
        you can enable/disable wifi from command line with:
adb shell svc wifi enable|disable
regarding specifying the username & password.. hm... maybe this can help: How do I program android to look for a particular network? (Issues Following Simple Tutorial)
 
    
    
        Community
        
- 1
- 1
 
    
    
        Marcel Tricolici
        
- 442
- 3
- 14
-2
            
            
        yes of course its possible I also tried this and found this-> How can I connect to Android with ADB over TCP? i hope this will help you :)
 
    
    
        Community
        
- 1
- 1
 
    
    
        Sebastian Walla
        
- 1,104
- 1
- 9
- 23
-3
            
            
        Install ADB over WIFI Widget, add it to your homescreen, enable it. you will be presented with your IP address
open the terminal and try
 adb connect <IP>:<PORT>
 
    
    
        Kirill Kulakov
        
- 10,035
- 9
- 50
- 67
