Can I use an Android Studio emulator without internet access? - android

Basically, I have the same problem as this user (although I'm using Windows and not Linux): Android Studio emulator doesn't start without internet
The thread got no replies and I didn't want to spam the comment section because I didn't have an answer to offer.
If I try to start an emulator in Android Studio but have no internet connection, it shows "waiting for all devices to come online" and nothing happens. The emulator does not start.
Like with the user in the other thread, if I start it with internet access, cut the Wifi and keep using the emulator, it works without problems and I can update apps, even though I don't have an internet connection anymore.
Is it possible the use an emulator when you are not connected to the internet?

Internet is not mandatory to open an emulator in Android Studio unless you haven't created the device already. You can try following to fix it:
Go to File -> Invalidate Caches... or Invalidate Caches & Restart
Waiting for Target Device to Come Online

Related

Android debugger continually disconnects

I have never had an issue debugging in Android until I switched to my current workspace. It happens in both Eclipse and IntelliJ. Previously I had an issue where the phone would hang at the "Waiting to attach debugger" dialog. Somehow I fixed that so the debugger at least attaches to my app.
Now I can set a breakpoint and have the debugger stop at that point. After about 5-10 seconds it disconnects no matter what I do. I'm able to read a few values of variables in memory before everything disappears. My co-worker is able to debug the same app just fine using Eclipse and we haven't been able to figure out what is wrong or different between our workstations (besides me using IntelliJ). We might have different images for our laptops though.
Any ideas? I've had to use Log statements for now but they are just too slow compared to using an actual debugger. I've tried using different USB cables and that didn't make much of a difference. I've gone through the debugger settings and nothing seemed out of the ordinary. Other Q/A's on SO have mentioned the app silently crashing, but I'm ruling that out due to it debugging fine for my co-worker.
I've been having the same problem running IntelliJ IDEA build IC-133.193. I solved the problem with the following actions:
Quit IntelliJ
From a command line kill the adb server with adb kill-server
From a command start the adb server as superuser with sudo adb start-server
Restart IntelliJ
IntelliJ will start the adb server if it detects that it is not running. The key appears to be starting adb as superuser before starting IntelliJ.
[Update] This doesn't always work. The best solution I've found is to start the app on the device and then attach the debugger to the Android process through the Run menu. I haven't had any disconnections using this method.
I have been fighting for a few days with adb not seeing my device. After trying many other posted solutions, I discovered that the issue was with Chrome also trying to connect its debugger to a web view. If Chrome is connected using chrome://inspect, then adb seems to disconnect. Quitting Chrome resolves the issue. Then I can connect with Android Studio and then restart Chrome and reconnect. Hope this helps someone else.
This fixed it for me
Go to Power Options on your computer
Click 'Change plan setting' on your chosen plan.
Click 'Change advanced power setting' on your chosen plan.
Expand 'USB Settings' .
Expand 'USB selective suspend setting' and change it to disabled.
This issue occurs to me when I try to use a USB 3.0 port. Using a USB 2.0 it does not happen.
This happens to me when the cable connection is sensitive.

How can i start my app written with libgdx on my android device?

I have written some codelines with libgdx in eclipse and want to run them on my android device.(It's a tablet)
But i cant find out how to do this.
I even cant run it on the android emulator provided by the android sdk. I get an error that the app stopped unexpectedly.
The app is working fine with the desktop launcher...
I hope someone can explain me how to get it working on the emulator or on my android device.
I saw somewhere that simply connecting my device via usb should be enough that eclipse is able to create an temporary app on the device, but this also didnt work.
Regards
1st of all, download SamsungKies[latest], to get and install proper USB Drivers. Its important that it should be the latest, cuz there was a bug in the previous versions.
Now that you have the drivers, simply connect your device to your machine IN USB DEBUGGING MODE.
Go to your main activity, and run.
If it launches in an emulator, close the emulator, and again in main activity, select run configurations -> Android Applications -> target -> always prompt to pick device.
Run again, and it should install and run in your phone/tablet.
NOTE:The activity closes in emulator because, by default, the emulator doesn't support OpenGLES emulation, its too heavy for your CPU.
i know its kinda late, but i hope it helps others:)

android emulator does nothing, blinks in & out, or says too many instances running.

I've done everything to the 'T' in regards to installing the Android SDK/ADT. I've tried all methods to resolve this (adb kill, wipe data), but still nothing.
When I run it from the SDK manager, the loading process works, but once it is done, a flash of the emulator appears then quickly disappears.
Sometimes after it loads, nothing happens.
At the worst when it loads, I get the "too many emulator instances are running on this machine. Aborting" message.
I want to start making apps, but this seems to be the only thing stopping me!
Eclipse Indigo; r12, Windows 7 (64)
If you have Windows Firewall (or another software firewall) active, try temporarily turning it off and then running the emulator. If that clears up the problem, then you need to teach the firewall how to open up the ports the emulator needs.
Go through your services and kill anything you find from it, including the java runtime, then run the AVD Manager as Admin and start the emulator from there, that should fix it.
I try to always make a habit of running Eclipse as Admin too because it's needed for the Emu to run properly.

Android 2.1 Emulator Without Internet Connection

I have no Internet access in my Android Emulator.
The app I am developing needs Internet connection, but the Android Emulator have no internet connection. I also tried to use the native browser of the emulator, but it also does not work.
When I export my app to a real android, it works just fine.
I already tried to press F8 to turn on and off the "3G connection" in the emulator.
I already turned off the Windows Firewall, but it didn't work.
Data:
Windows 7 x64
Eclipse Plugin for Android
Android version 2.1
Try recreating the emulator instance. Sometimes the instances get corrupted and you get weird behavior like the one described by you above. The internet connection should work without any interaction in a fresh emulator instance.
If you are behind a firewall or you are using a proxy then things can get a bit more complicated but there are workarounds for those situations also.
Don't keep re-creating new instances of the same emulator. I had this problem before and created a brand new emulator (same settings as the other one), and it worked fine for some reason.
I had to set manually the DNS Server of my emulator.
To do that:
Within Eclipse I went to Run Configurations -> Target and added "-dns-server X.X.X.X" and everything worked fine afterwards. (obviously X.X.X.X was the IP address for my DNS server).
so i put this line: -debug-slirp -dns-server 192.168.178.1

Android Emulator SD Card Problem

I have a problem with the Android Emulator and its SD card. I am developing an application that writes files to /sdcard. Everything works fine, until I exit the emulator by clicking its close button. After restart the files are empty (size 0), but still in the directory. Of course, they have not been empty as long as the emulator runs.
This looks like a failed sdcard unplug, like with usb stick. But I am not sure, how the emulator treats the card exactly. I am starting the emulator from Eclipse, and get an error at exit, when I close the emulator.
The problem did not exist before I updated my Android plugin. I could use all my files after restarting the emulator. Moreover, the problem does not occur on the real thing. I am using the most recent Android stuff, and Eclipse 3.5.
I already tried deleting my emulators and creating a new one. I also tried shutting the emulator down with the red telephone button, but that did never complete. Of course, my app is not a service and has no threads pending at shutdown.
Any ideas, you friendly people out there?
I am currently seeing the same problem on mine using an API 4 emulator, but putting the apk on my actual android device it works fine. It only happens if I close the emulator and restart using "Debug As" or "Run As". My current workaround is to start the emulator before running / debugging my app... not shutting down the emulator prevents this from happening, although I wish I had a real fix.
The problem went away by itself. I have no idea, what caused the healing. I did not do anything particular. I just continued working.
Thanks for your attention.

Categories

Resources