Slow android app installation even when not using emulator - android

Everywhere I look I can only find questions about how slow the emulator is.
I'm running my app on a real android device. The app has several short animations and totals around 63MB storage. I understand that the more space the app uses the longer the installation will take, but it still takes 3 to 4 minutes to install and run every time.
I'm debugging through USB 2.0 and would expect far better transfer speeds.
I also tried copying a video from my android device to my computer (also via USB), which also took up about 60MB of space, and it took over a minute -- I seemed to get about 1MB/s upload speed.
Are these speeds expected, or should they be faster?

Related

My app wont run on the emulator of android studio

emulator starts but there is no app on it besides it takes a lot of time to load. Is it because of windows?
If u have a device that runs on an Android operation system, you can run your app on that device, and it will be much faster. Andriod Studio and it's emulators require a lot of resources. So if you don't have a decent amount of RAM available for the program, it will slow down. If you still want to use the emulator,try closing applications you are not using. Like internet browsers, games, etc.. modify vitual memory pageing file size.

Android Emulator becomes very slow all of a sudden

I am using the Android version 4.0.3 on a Windows system. My emulator was working pretty well, however all of sudden it became very slow.
It is taking too much time in launching so most of the time launch gets cancelled or I have to start the emulator ahead of time.
If you are having long times in emulator startup, you can configure AVD to save a snapshot of emulator. This significantly improves startup time, although the shutdown time will increase due to the saving of snapshot.
If you are having a slow emulator in general (booting and running programs), and, if you are using a Intel x86 processor you can install Intel Hardware Accelerated Execution Manager from android SDK. This will improve emulator speed by more then 10 times compared to the standard emulator. It even faster then a mid range real device.
good luck.
The emulators, all of them, on every platform, are infamous for slow startups. Typically you start the emulator, wait 'til it is all the way up, and then run your program. Debugging on a real device is infinitely preferable.
Leaving the emulator open between program runs is a necessity.
One of my professors gave up and spent several thousand dollars on a new computer with a huge solid-state drive because he could not get an emulator window up in less than five minutes, and it was impacting his ability to teach courses based on the platform. I went the cheaper route and dropped $200 on a tablet. Either way, hardware is the real answer here.

Is my PC fault, or android emulator is slow

I'm on the learning stage of android and I have to run/debug my application in emulator very often. The thing is that between I press the debug button and until the application gets started on the emulator I have to wait 1-2 minutes.
Is this normal? My PC is a i5 with 8GB RAM.
The emulator is certainly not fast, but one thing you should do is to make sure you don't close the emulator. Leave it running, and then most of the initial startup time will be taken care of. The emulator is a real emulator (unlike the iOS simulator). Think of the startup time of the emulator as booting up your phone. You're not going to turn off and turn on your phone every time you want to use an app, so similarly with the emulator, just leave it on.
It’s not normal, but it’s as expected. The Android emulator continues to be very slow and basically unusable for development. You’re better off developing on a real device. (Deployment to real device is much faster with Android IDE than it is on Xcode/iOS.)
Google has stated that it is a known issue, but it’s not known if/when it actually will get fixed.
I have experienced startup times of 5-10 minutes for the emulator to start up. The startup time to start debugging your application is going to depend on the size of your application. It has to tranfser the .apk over each time you want to debug. If your application is full of large files this can be a long time. One time I put a video in my res/raw folder and it brought my application to 25 mb. This ended up taking around 5 minutes to start debugging.

Android Emulator for Tablet

My PC is core i-5 with 4gb RAM.
whenever i try to run an AVD in eclipse it comes fast, if i want to run an AVD for TAB it take 5 to 10 minutes. Is there any way to make it fast? Also some time it comes with blackscreen says open gl es API problem type something
Also after fast run, i dont close it, i use it same AVD for all run. But it becames slower after every installation or run by my app. so i have to close and restart my AVD, is there any solution for it. Also some time DDMS cant find AVD, while it was running in font.
Anyone face these problem? any tricks?
one another thing, some time app dont run automatically after installation, i have to select app in AVD's APPS
The Android emulator does not make use of multiple cores. Whether you have 1 or 8 cores doesn't matter. However, the speed of a single core does affect the speed of the emulator.
Having a processor with TurboBoost helps considerably, in my experience. Additionally, it is well known that the 3.X and above emulators are extremely slow by nature.
You could also try allocating more RAM to the AVD in it's setup. Reducing the screen size and resolution also helps in speeding up the emulator.
You can refer to this Google Group thread for details on why the emulator is slow, and how to speed it up.

Slow uploads to running Android emulator

I have searched but not found any queries or answers for my specific circumstance. I have a fast new machine with plenty of memory running Windows 7. I'm using the latest Eclipse and Android SDK.
When I run an app the emulator takes about 45 seconds to start (blazingly fast for the emulator!) from run initiation to running my app.
If I then change the app and re-run it on the still-running emulator, the time increases to 70+ seconds! As opposed to all other complaints people have, in my case restarting the emulator is faster than using the existing instance. I don't like that.
Here are the times:
2011-09-29 13:07:13 - hello Uploading hello.apk onto device 'emulator-5554'
2011-09-29 13:07:18 - hello Installing hello.apk...
2011-09-29 13:07:37 - hello Success!
on rerunning after changing the app to get it to reload:
2011-09-29 13:08:18 - hello Uploading hello.apk onto device 'emulator-5554'
2011-09-29 13:09:16 - hello Installing hello.apk...
2011-09-29 13:09:24 - hello Success!
As you can see, the upload to the emulator takes a mere 5 seconds when the emulator is freshly started. It takes nearly a minute with a running emulator! This is the cause of the extended re-running time. This doesn't change even when I uninstall the app on the emulator before re-running it.
Any ideas on what I could try to solve this? It appears to be some kind of communication problem, possibly with adb.
As others have posted, just clicking around in the emulator while uploading drastically improves the upload speed. I had the same problem and Googled for an answer, and trying out this trick helped me. I'm running a 2.3.3 AVD.
My new discovery is a small "hack" how you can make your upload faster. I realized that the cases when the upload was faster were caused by my interaction. So when I upload new app without active working with emulator, it is slow. But when I work with it (testing my application, exiting, opening applications list, etc.), the upload is MUCH faster - in my case approx. 15seconds instead nearly 2 minutes.
So I think, that the problem is somehow in performance settings of the emulator. When I do nothing, it thinks no big performance is needed, emulator is switched to some economic state, so also my upload is slow.
A better solution:
Go to Run -> Run Configurations... -> Target Tab -> Additional Emulator Command Line Options. Add there:
-netspeed full -netdelay none
Now close the emulator and run it again.
After doing this the time for uploading went from 2 minutes to 8 seconds.
Edit:
I have also found that quitting Skype makes my emulator upload much faster.
I have the same problem, I'm developing an android application which is like 4,6MB and it takes me like maybe 50-60 seconds to upload it on emulator and run it.I don't think this is a problem with the communication. The JVM is slow, that's why you need a time to upload your apk and run it.I don't think you can do anything about it, except you start testing your application on a device.
Play with the emulator while uploading your application. I totally agree with teepee. It reduced my waiting time from 4 minutes to 30 secs.
The fastest emulator you can get it's a VMWare machine with Android.
While developing my game, Elastic World, I was suffering from the same problem. After waiting minutes for the emulator to startup, the game was running at 20 FPS maximum. Even on low end android devices I could easily get 60 FPS. The upload speed was very slow.
So I moved to a VMWare Android machine, following the instructions from this site: http://www.android-x86.org/documents/installhowto/
The same game loop now runs at 250 FPS. (it's not playable at this speed and I have the game limited to max 60 FPS, but overriding this limitation it gives 250 FPS)
When Eclipse ends the build process I just have to wait 1 to 5 seconds for the game to appear on the virtual machine. And I'm running an old Core2Duo
This is not an issue with the AVD, it's eclipse the problem and I don't know if there is a way to change it within what we could call the jungle of parameters.
To be brief you can launch an emulator all by yourself in a console command
using the following :
emulator.exe -avd MyAVDName -netspeed full -netdelay none
Nice the parameters, why isn't Eclipse using it?
Some Eclipse coder should make it the default.
Another solution is to switch to IntelliJ IDEA. It will gloriously replace your old clunky IDE with a fresh and better one.
I know this is an old topic, but I think I actually have a solution to this issue.
First you need to boot the emulator without the netspeed arguments like follows:
emulator -avd <name>
Once it's started log in to the emulator using telnet. You can get the port from the top of the emulator window or by running adb devices and looking at the serial for the emulator which is in the form emulator-port (this is usually 5554 in most cases)
telnet localhost 5554
After you've logged in using telnet you need to issue the following command to force the emulator to use a very high network speed
network speed 500000
You can then check this setting in telnet using the following command
network status
Which should return
Current network status:
download speed: 500000000 bits/s (61035.2 KB/s)
upload speed: 500000000 bits/s (61035.2 KB/s)
If you now try to install the APK you should find the performance is dramatically increased. In my case it went from 260s to 18s.
Just thinking out loud:
I don't know this for a fact, but I'm wondering if this slow down is because Android applications each have their own instance of the Dalvik VM and run as a separate user and process. When you "think" you have closed your application, Android may be keeping the process (definitely the VM) alive in case you restart the application. This is similar to the pre-fetch behavior in windows.
When you re-run the application, after modifying the sources, Android perhaps has to destroy the cached instance. The additional delay you notice in the case of re-deployment in the same emulator instance may be because of the costs incurred in gracefully shutting down the VM and the application.
I get the same problem, but I'm convinced it has something to do with the O.S., because I uploaded the same application using a MacBook Pro and a Dell laptop, which is more powerful, given the hardware spec, however the upload time is significantly lower on the Mac.
On this Dell laptop with Windows, however, uploads to actual Android devices are way, way faster.
I thought it might be related to the "Google USB Driver package", that I haven't installed before, but after installing it, nothing really changed.
Try to set your emulator RAM to 1024.
Elaborating on what teepee said in an earlier post, I've found that if I muck with the already-running AVD during the uploading phase, it finishes MUCH quicker (5 seconds vs 60 seconds) and I'm installed and running in a fraction of the time. This is with a 4.0.3 AVD. Haven't tried the others yet.
The alternative ways:
Setting up a FTP server on your pc for hosting apk files, now you can download apk files by android emulator web browser and install app directly whitout using adb.
or
Install a samba client on android emulator and share apk files on your pc, then copy apk files to emulator and install app directly whitout using adb.
All of above ways are faster than adb install.
Silly question - did you try it on several AVDs? It is possible your one AVD is messed up in some way.
Do as much interaction with emulator as you can while uploading the apk on emulator, if you press random buttons of emulator while uploading it will upload early, before it took 5-6 mins to upload but now it take only 15 - 20 secs.
I have seen this too. Here is something that helped, assuming you've been using the same AVD.
Wipe the user data on the AVD. After doing this, it would load the app much faster again, a couple of seconds.
In a terminal/console I shell into the AVD with adb -e shell then go to the tmp directory where the apk is being uploaded cd /data/local/tmp then do ls -l to see the current file size. I've found that if I sit there and keep hitting up arrow then enter to quickly repeat the ls -l the upload speeds up dramatically. You can watch the progress as the file size increases.
This is probably similar to the effect of clicking around in the AVD others have mentioned.
I'm on a Mac. Not sure if it's the same on Windows or Linux.
This might work on windows,
start the Task manager --> processes tab--> look for emulator.exe,
right click and set priority to high
dont forget to set it to normal after your work is done.
also closing unwanted applications which require a lot of memory like chrome and firefox can be closed when not needed.

Categories

Resources