Xamarin Emulator - Remove Previous Deployments - android

I'm developing a medium sized Xamarin application, with intensive data processing. I can do about 10 deployments before the internal disk space is to full. I did some searching and came across this one question - same issue but I'm looking for an actual solution.
"There is not enough storage space on the device to store package" when starting Android emulator
It's not feasible for me to wipe the device when this error occurs due to the nature of the application. Is there away to wipe out the previous deployments but retain the application data and not uninstall the application or wipe the emulator?
Thanks!

Start the emulator via the cmd-line and use the -partition-size (in MB) to increase the size of the "internal storage" (the default size that Xamarin starts it with is 512mb). This will be reflected with the Storage section of Setting on the emulator.
i.e.
emulator.exe -avd Pixel_XL_API_26_PlayStore.avd -partition-size 4096
Note: To avoid the partition being reset, do not change to a value less than what you were using, increasing the size is always safe(?)....
re: https://developer.android.com/studio/run/emulator-commandline

Related

Android Studio using 100% of disk

I have just installed Android Studio to follow a react native project and everytime I try to use the program the disk usage goes to 100%.
I've chosen Pixel 2 as the phone and android Q and R as the versions.
The program works well until I click the "play" button to start emulating the android OS.
Then the phone image starts loading the android OS but it's just too slow to do anything with the emulated phone.
I have tried reinstalling the program.
I have tried disabling firewall and windows defender.
I have tried using different versions of android ex.: Q and R.
I have 8GB of RAM
HD of 465GB
Intel Core i3-4150 #3.50GHz
GeForce GTX 750 Ti 2gb
I also tried to increase memory size for android studio on file studio.vmoptions.
From this
-Xms128m
-Xmx800m
To this
-Xms256m
-Xmx1024m
I have also created a gradle.properties file with
org.gradle.daemon=true as I saw in another question but none of the things above worked.
I have no more clue on what else I could do.
Your emulator required big memory to launch it and as per your PC configuration so you build an emulator for N and use pixel phone not pixel 2 okay.
hopefully, they resolve your issue.
Disk Usage on Task Manager is not the volume of disk being used.
It is fraction of speed of data transfer from your Disk to RAM.
Usually Hard Disk has lower Read/Write speeds and act as bottleneck for the performance of PC. There is no problem with your Android Studio or any other software. Any Software that requires a lot of Read/Write operations on your Disk will show 100% Disk Usage. You cannot do anything with that.
Unless you replace your computer Hard Disk Drive(HDD) with Solid State Drive(SSD). Because Solid State Drives has very high Read/Write Speed than Hard Disk Drives.
For Now you can use your Android Device for testing rather using an emulator, it will save your computer resources used by emulator.
I know this answer will not help you right now. But this is the correct answer and reality. Go Checkout the Difference between HDD and SSD in Google.

Unable to run emulator: AVD 'Nexus_5X_API_28'

I have 8GB RAM and there are a lot of installed programs on my hard drive. I have only 2GB remaining on my C: drive.
Everything was running fine until I installed "Bluestack", now I get the following error:
ERROR: Not enough disk space to run AVD 'Nexus_5X_API_28'. Exiting..
Seems like a good time to sit down and do some spring cleaning on your hard drive.
Also if you need to increase the RAM of your Android Studio emulator (not that that will necessarily help in this particular situation) try this:
Go to Tools->Android->AVD Manager, there's something a like pencil to edit your AVD click on that, then in the pop-up window click Show Advanced Settings and there you can change the RAM size.
You have installed bluestack which reduces your storage. AVD needs free space for running. Because it has to store a lot of things in the time of testing/running app on it. Without available storage how could it save data? you have to delete some files from your hard drive for making storage for the emulator

Why can't I boot an AVD from Eclipse with 1024 MB of RAM?

So, like a lot of people starting Android development with Eclipse, even with a fast machine, I notice that the emulator runs frustratingly slow.
I search SO for any tips to make it run faster and I run across this question, whose top answer suggests a couple of things, including making the AVD have more RAM. They suggest 1024MB:
Sounds good. But when I try to launch it, I get this:
Failed to allocate memory: 8
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
If I set it to 512MB (up from the default 256MB) it launches fine.
But why, on a Windows 7 x64 machine with 12GB of physical RAM can I not allocate 1024MB to an AVD? Is it an Eclipse limitation? Emulator limitation? Java limitation? I presume the person in that other question got it working but I've yet to figure out how and most of the responses I see elsewhere say "yeah dial it down to 512MB" which is not the answer I'm looking for.
From Galaxy s3 emulator:
There is a common problem when setting up the AVD that you have to manually edit the config file to fix. File is located at C:\Documents and Settings\username\.android\avd\name_of_avd.avd\config.ini
Change the memory settings from
hw.ramSize=1024
to
hw.ramSize=1024MB
(Do not enable word wrap in notepad).
Save the file and reopen the avd.
This worked for me.
Weird, but this worked for me on Windows 7 x64 machine with 16GB of RAM. You do have to add MB at the end of "hw.ramSize" in config.ini.
I had the same problem like OP wrote. Also, if you need 2 gigabytes of RAM, write 2048MB and simulator will run from Eclipse.
I have the same problem occasionally, and I'm unable to tell you exactly why this problem occurs, but it seems that the AVD won't start if it has been allocated more then an X percentage of your available RAM at the time of starting.
If you lower the given amount by just 50mb, you'll often notice it will run just fine. Or, similarly, if you close a few programs to save some RAM, it will also boot up perfectly fine.
I know it's not ideal, but I suggest to just lower the allocated RAM in small amounts until it boots up. I wish I could give a better answer but I haven't been able to find a reason myself either.
Try starting the AVD without Eclipse to remove that Factor.
This can be done by navigating to your SDK-Path/tools and open Android(.bat?) and then select the AVD manager.
I would recommend opening a command shell, navigating to the path and then run
emulator -avd AVDNAME -scale 0.7 -no-boot-anim
You can also try starting it without the scale parameter or maybe even a lower number.
On Windows, emulating RAM greater than 768 may fail depending on the system load
Open C:\Users\your user.android\avd\yourAVD.avd\config.ini
change
hw.ramSize=1024
to
hw.ramSize=1024M
this worked for me :-)
hope it will help!

Android emulator is very very slow

My laptop: Intel Core 2 Duo CPU, 2GHz, 1GB RAM.
I created a target with SD Card 512MB, Device RAM size 512, snapshot enabled. I waited for 30 minutes but the emulator doesn't ends up loading. It keeps showing a flash word "Android" on the black screen.
Before running the emulator, I closed most other programs.
What's wrong with it? This is very frustrating. :(
What is your CPU and RAM usage during startup? Do you have a lot of IO swapping occurring? Considering that Windows needs at least 512 to run right half of the time and Eclipse is a memory hog you probably just need more RAM.
It shouldn't take more than 5-10min at most to build the emulator on initial startup. The SD card size has no effect on memory usage, it's not loaded into memory, it just creates a larger image file for the sdcard. Setting the emulator to have 256mb of ram will help, but in general when I have the same problem I just close down the emulator window and re-start it. Sometimes it just gets hung-up on creation and isn't a memory issue (I have 16gb of ram and still have the problem from time to time)
You're assigning the emulated Android instance half of the physical memory on your machine. Get more memory.
Emulator is in general very slow, and the higher the OS version on the emulator, the slower it gets. I'm a game developer, and with my AMD Athlon X3 2.90 GHz with 4GB RAM it gives me 5-6 fps. I tried to open one of my apps on Honeycomb emulator, and it was really terrible. It opened, but I couldn't do anything with it. So the best answer is purchasing a real device.
I've experienced the same thing and in my case I had to set "Min SDK Version" when creating the project in Eclipse. Without this setting the emulator didn't start.
Android Development Tools (ADT) 9.0.0 (or later) has a feature that allows you to save state of the AVD (emulator), and you can start your emulator instantly. You have to enable this feature while creating a new AVD or you can just create it later by editing the AVD.
Also I have increased the Device RAM Size to 1024 which results in a very fast emulator.
Refer the given below screenshots for more information.
And for speeding up your emulator you can refer to
Speed up your Android Emulator!:
The native Android emulator is really slow. It's much faster if you use Android on a virtual machine. You can follow my detailed guide on setting it up. http://www.bobbychanblog.com/2011/07/faster-android-emulator-alternative-using-virtualbox/

Installing application on SD-card in Android sdk 2.2

I am facing this problem and finding solution for this issue since last 2 weeks.
Right now i have developed an android application for the client perpose, whose size is 54 MB, from which 52 MB of only Images/Photos.
[Edit: I need to keep images in "drawable" folder ]
So i want to install it in sd-card on Android SDK 2.2 for that i have already set android:installLocation="preferExternal" in the AndroidManifest.xml file. I have created 256MB sd-card while creating an avd , heap size - 192 , ram size - 192
but it still showing me an error:
[2010-08-27 17:58:28 - demo_test]
Failed to upload demo_test.apk on
device 'emulator-5554'
[2010-08-27
17:58:28 - demo_test]
java.io.IOException: Unable to upload
file: No space left on device
[2010-08-27 17:58:28 - demo_test]
Launch canceled!
Edit:
Is this memory related issue of internal memory or external memory?
What i have to do to run application and still test with emulator?
How do i install application in sd-card in Android sdk 2.2?
Is the sd-cards size really 256MB? I sometimes forget the suffix and end up with.. something very small.
You can also always raise the sizes to like 512, 256,266 and try again to be certain it's something else.
Also, Logcat output would be nice too.
Edit: As it seems, you cant just "install" the app on the SDcard even if you have 30+Gigabyte free on it. Installation depends also on the internal memory of the phone even in 2.2.
Example: Nexus one has 512mb internal memory. The android os takes the needed ram for the camera, gpu, kernel etc leaving a user with only around 190MB app space (which will be even lower due to apps already installed etc).
HTC Hero on the other hand has only 288mb internal memory, leaving it with a very small "app size ram".
Depending on the phone, 90mb app will install to SDcard on nexus one, but won't on Hero due to memory limitations.
The reason you are getting that error is that, after the android os takes the needed ram out of those 192MB, the "app size ram" is not enough to hold that 50+mb application.
I thought that installLocation would install directly to SD, but that is not the case.
Vidar Vestnes blog confirmed what I described above by performing a test with different app sizes on his HTC Desire..
A better approach would be to put your resources in their own directory on the SD card. Then your app can load them when it needs.
I suggest you try increasing the internal memory available (screenshot says 43MB), in case the .apk is being copied there first before it is installed to the SD card by the OS.
Assuming you need the images on your device instead of on the cloud, the easiest way would be to make the app connect to a server of yours and download a zip containing all the images on its first run. Until devices get a larger "app ram size" this might be your only solution.
You can use the following:
adb shell pm setInstallLocation 2
from the android-sdk/tools directory to force the emulator to install to your sd card, whatever its size -- preferably large enough to hold your app(s), obviously.
If you want to go back to the default installation location (phone app memory), do:
adb shell pm setInstallLocation 0
You can also use these adb commands on your phone / tablet.
Once you have set up the emulator to install to the sd card, you can then go into Settings --> Applications --> Manage Applications, choose the app you want to be on the sd card, and the "Move to SD Card" button will no longer be grayed out.
you can check if the sd card is really mounted and enough space is available by the running
adb shell df
command in the android-sdk/tools directory
it shows you which partitions are currently mounted, how big they are and how much free space is available

Categories

Resources