So I do a lot of development for Android these days and a lot of it involves reformatting my phone repeatedly, and then that leads to me re-entering my wifi password each time. This, over the course of a lot of time, is adding up to quite a lot of time spent entering my wifi password.

So what I am looking for is a way to get past that without having to download an app. Is there a way to get internet to my device on boot, without entering my wifi credentials. I'll take any way that's much faster, if I can transmit my password via NFC, if I can share it from another device, if I can wire my internet through USB directly. I have not found a way to do any of these things without installing additional apps. Also, I need to consider security still, so getting rid of the wifi password is also not an option, sadly.

  • Can you use a text file on your SD card? A factory reset wouldn't erase that.
    – ale
    Sep 27 '13 at 14:39
  • @AlEverett text file on my sd card... I certainly could, but is there a way for me to have the password read? If I have to browse to the text file, copy and paste the password in android, that won't end up saving me a lot of time sadly :( Sep 27 '13 at 15:03

This is a suggestion, it may not meet all your critera and not all routers support it.

  • Set a second SSID on the router which isn't broadcast
  • Have a simple password on this SSID with a minimal number of characters
  • Implement MAC lockdown on this SSID
  • Enter the MAC of your phone as the only approved connection

Your router will only accept connections from specific MAC addresses on the new SSID, even if others guess your password.

  • I would much rather something that uses bluetooth, nfc, sharing, and doesn't have me messing around with corporate wifi but the more I think about it, the more I believe this may be the only way to do it. Sep 27 '13 at 15:32

Android's debugging bridge adb supports backup/restore:

adb backup -f wifisettings.bak

presents you a message on screen which you need to confirm (and maybe enter a passphrase) to create the backup.

adb restore wifisettings.bak

restores it. Just set up your phone to a very simple initial state (nothing else besides the wifi settings, or so). Then backup. adb also supports partial backups (adb -f backup.bak com.app.name), but the wifi settings are not part of a particular app, at least I haven't figured out which package to backup to catch the wifi settings.

Another way: Is your phone rooted? Then "adb push stored_wpa_supplicant.conf /data/misc/wifi/wpa_supplicant.conf" will restore your password file.

  • So, my phone is rooted and this may work. Ill give this a shot, I think this solution would work nicely as i can include it into my flashing script. Sep 27 '13 at 23:18
  • adb push may not work out of the box on newer phones due to access rights, you may need to push to the /sdcard first, then copy using a second adb shell su command (the phone's adb daemon may not run as root any more on newer custom Android versions, so you can't directly write the wpa_supplicant.conf using adb push. Also note to restore the correct ownership and access rights of that config file; you may need to reboot the phone afterwards, too.
    – ce4
    Sep 28 '13 at 0:08
  • So I tried this out. Since I am developing on AOSP I'm unable to use the backup method, since I will have made changes to AOSP and I don't want to undo those in the restore. Instead I tried to push and pull methods, but I am unable to use those anymore given the current state of my phone. So while I think pushing and pulling on a rooted device would be best, I can't do it sadly. Oct 2 '13 at 19:12
  • I also tried this and noticed that (using Samsung Note 2) the backup does not contain WiFi settings. I assume this is because the phone is not rooted (and the backup process does not execute as root).
    – wojciii
    Jul 14 '14 at 8:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.