android studio - manually download system image for emulator - android

Good day,I'm a student and I'm trying to create a virtual device in Android Studio, however my home internet is too slow to download a System Image, there is an internet cafe near me that has very fast internet and I plan to download the System Image there by accessing in my browser this link : https://dl.google.com/android/repository/sys-img/google_apis/x86-25_r08.zip
From this message in the window where Android Studio downloads the System Image for Android Nougat
To install:
- Google APIs Intel x86 Atom System Image (system-images;android-25;google_apis;x86)
Preparing "Install Google APIs Intel x86 Atom System Image".
Downloading https://dl.google.com/android/repository/sys-img/google_apis/x86-25_r08.zip
However I do not know how to install it in android studio. How am I able to install it myself on android studio and make an emulator?
Many thanks.

In windows: First locate your android-sdk. By default it's in your C:\Users\Your.name\AppData\Local\
in it's root folder. where you can find: SDK Manager.exe, make a folder name it "system-images", my api 25 image is at system-images\android-25\google_apis\x86_64\Files
Hope you can Figure it out. Comment if you have any problem.

In mac OSX:
~/Library/Android/sdk/system-images/android-[API_VERSION]/[API_TYPE]/x86
Replace [API_VERSION] with Android version you are downloading and the [API_TYPE] can either be google_apis_playstore or google_apis depending on whether the image you are downloading comes with Google Play or not.

On Windows 10:
Download the file from e.g.:
https://dl.google.com/android/repository/sys-img/google_apis/x86-27_r09.zip.
Extract the zipped file.
Copy (OR Cut, not recommended) the contents of the extracted folder e.g.: x86.
Find the android-sdk folder. By default, it should be located at C:\Users\[YOUR USER NAME]\AppData\Local\Android\Sdk.
Look for a folder named system-images. Create system-images if it doesn't exist. Depending on the file you downloaded, create
subfolders within system-images. E.g.:
system-images->android-27->google_apis.
Paste within google_apis.
Restart Android Studio and the system image should be selectable.
Shout if you need any further assistance.

FOR WINDOWS:
To get the exact path of the system-image, try to download from android studio first, after 1% download, stop the download and go to your sdk path.
E.g. C:\Users\TBR\AppData\Local\Android\Sdk, you will see a folder name "system-images"
this folder was created from the part download, open the sub-folder till you get to the last sub-folder.
E.g. C:\Users\TBR\AppData\Local\Android\Sdk\system-images\android-27\google_apis\x86
i.e x86 is last sub folder (delete any content in this last sub-folder)
Download the system images manually, unzipped and copy the whole content, then paste it into your last sub-folder.
Download link for android-27 - https://dl.google.com/android/repository/sys-img/google_apis_playstore/x86-27_r03.zip
Go back to android studio and you will see the system-image there now.

For Windows 10:
Download the file from e.g.: https://dl.google.com/android/repository/sys-img/google_apis/x86-27_r09.zip. or Any other System Image
After Completion of Download
Extract the zipped file.
Copy extracted folder e.g.: x86.
Find the android-sdk folder. It is located at C:\Users\{your username}\AppData\Local\Android\Sdk\
Find the folder system-images. Create system-images if it doesn't exist.
Create subfolders within system-images. E.g.: system-images/android-27
Check in link, if it has google_apis or google_apis_playstore:
https://dl.google.com/android/repository/sys-img/google_apis/x86-27_r09.zip.
or
https://dl.google.com/android/repository/sys-img/google_apis_playstore/x86-27_r09.zip.
Paste within google_apis if link has google_apis or Paste it in google_apis_playstore folder.
The Complete path of system image file :
C:\Users\{Your UserName}\AppData\Local\Android\Sdk\system-images\android-30\google_apis\x86
or
C:\Users\{Your UserName}\AppData\Local\Android\Sdk\system-images\android-30\google_apis_playstore\x86
Restart Android Studio and the system image should be selectable.
============= Good Luck ❤❤❤ =============

I have faced the same issue when manually installing an android-wear image. For android-wear images the directory structure looks like this.
<your_android_sdk_location>/system-images/android-<version>/android-wear/<extract_downloaded_android-wear_image_here>
example: For this wear image https://dl.google.com/android/repository/sys-img/android-wear/x86-28_r03.zip
<your_android_sdk_location>/system-images/android-28/android-wear/x86
Don't forget to restart the Android Studio!

Actually, if you extract downloaded zip archive, system will never find it.
You have to click in 'Download' tag, then in folder
%ANDROIDSDK%/system-images/android-25/
^^^ version of SDK you use
if google-api then additional folder 'google_apis' will be created .install file with the path, where archive is located.
Usually it is
C:\Users[YOUR USER NAME]\AppData\Local\Temp\PackageOperation01
Put there your zip archive and go to Download link again.
After that, it will not start download, but will start to check and unzip operation.
This resolves offline installation issue.

find the logfile for the android device manager (on my machine it was here: C:\Users(user name)\AppData\Local\Xamarin\Logs\16.0). At the end of the logfile (named like 2021-07-21_16-03-19.18380.devicemanager.log), you'll see it reference a path it's trying to download from and to. Here's what my log message looked like:
[21-07-21 21:03:29.66] [ProgressMonitor] Step "Downloading Google Play Intel x86 Atom System Image v9" did begin for AVD: pixel_2_pie_9_0_-_api_28, totalWork: 918028186
[21-07-21 21:03:29.67] Downloaded file '<USER_HOME>\AppData\Local\Temp\xamarin-android-sdk\x86-28_r09.zip' not found for Android SDK archive 'https://dl.google.com/android/repository/sys-img/google_apis_playstore/x86-28_r09.zip'
[21-07-21 21:06:08.50] [ProgressMonitor] downloading did report error with exception: System.TimeoutException: The operation has timed out. AVD Name: pixel_2_pie_9_0_-_api_28
So I went to the https://dl.google.com/android/repository/sys-img/google_apis_playstore/x86-28_r09.zip link and manually downoaded the file and copied it to <USER_HOME>\AppData\Local\Temp\xamarin-android-sdk\x86-28_r09.zip and clicked retry from the failed attempt inside the android device manager, and voila, it worked after 2 days of messing around with it.

For me the problem was that currently Android Studio doesn't list older system images (older than 29) in the "Create Device" wizard, and that even if the relevant system images have been downloaded already.
The workaround I found was to download system images and create emulator devices from the command line. This works even if you don't have the Android Studio - you just need the Android SDK installed.
To download a system image, go into the directory where the Android SDK is installed (by default this is at ~/Android/SDK on Linux), then in your terminal type: ./cmdline-tools/latest/bin/sdkmanager --list - this will list all the available system images, even very old ones (I see the oldest SDK is 10). They should have the path (the text in the first column) labeled with this format: system-images;android-<sdk-version>;<type>;<architecture> (there are also other stuff aside from system images, lets ignore these for now).
To download the system image you want, type ./cmdline-tools/latest/bin/sdkmanager --install "<path>" where "<path>" would be the first column from the available package list from the step above.
Then to create an emulator virtual device for this image, use the command line as well: type ./cmdline-tools/latest/bin/avdmanager create avd -d <device-type> -k '<system-image-path> -n '<device-name>', where:
"<device-type>" would be the name of the device you want to emulate, for example "pixel_4a" to emulate a Pixel 4a - use avdmanager list device to get the list of devices.
"<system-image-path>" would be the same path you used to download the system image, for example system-images;android-23;google_apis;x86_64.
"<device-name>" would be whatever name you want to be shown in Android Studio's "Device Manager" view.
For example: ./cmdline-tools/latest/bin/avdmanager create avd -d pixel_4a -k 'system-images;android-23;google_apis;x86_64' -n 'Pixel_4a_API_23'
If you had Android Studio running while doing all of that, you'd need to stop and restart it. If you want to copy the created files to another machine, you'd need to copy your entire Android SDK installation directory (or possibly only the "system-images" folder inside the SDK installation directory) and also the content of the Android SDK AVD configuration directory - if you created any AVDs - this would be ~/.android/avd under Linux.

Go to the AVD Manager in Android Studio (it is in the toolbar and looks like a tablet with an Android on it), then click on "Create Virtual Device" once a window called "Android Virtual Device Manager" pops up. Next, choose the device you want to pick, and then click "Next". You will then be able to download a system image.

Related

How to install AVD separately and use it in Android Studio

I downloaded an AVD out of android studio, now I want to use it in it, how can I do that?
the link I downloaded is:
https://https:/dl.google.com/android/repository/sys-img/google_apis/x86-26_r10.zip
Thank you
after extracting your sys-image..go to your sdk folder find system-images, then create a folder of the image and paste it in there i.e mine is
C:\Users\yourname\AppData\Local\Android\sdk\system-images\android-26
Okay the process of installing an externally downloaded system image is not super complex and #whack_panther had the idea right.
To make everything work with an external installation you do need to unzip the x86 folder from the downloaded system image to:
C:\Users\USERNAME\AppData\Local\Android\sdk\system-images\android-26\google_apis
In order to find this folder in Windows ensure that you have your hidden folders visible.
The download you provided is API-26 and the Release name is O, keep this in mind because this is where I ran into confusion at first as I already had many sys-images downloaded on my system for development purposes.
What I did:
I removed all of my downloaded system images and then placed only the new system image from link you provided in the directory listed above to ensure we were looking at the same data. When I did this, the only available system image that would not require an additional download when I attempted to create a new AVD from the AVD Manager GUI located under “Tools” in the Android Studio menu was:
Release Name: O | API Level: 26 | ABI: x86 | Target: Android 8 (Google APIs)
Which is the system image downloaded from the link you provided.
Then set everything up as usual with your externally downloaded system image using the prompts in the AVD Manager and you should be good to go. Also note that here I was required to create a New Hardware Profile to enable the option to use the newly downloaded system image, I would bet this is because there are settings in the download that do not apply to the built-in hardware profiles
One note: The folder you provided appears to have variations already available from Android Studio so I would suggest looking through the options in the AVD manager before you stick with the idea of downloading external images for these purposes, doing so is obviously supported but it may not be needed so there is no reason to make things more challenging for yourself unless it is completely necessary.
Extract the zip at below location :
C:\Users\username\AppData\Local\Android\Sdk\system-images\android-26
Go to AVD Manager and refresh the system image page. It will be detected/

Android SDK - Install system image packages offline

due to IT restrictions I cannot use to package-install-automation of the Android SDK.
To be able to create an emulator in Androids' AVD manager, I first of all need a system image for my target device.
But regarding the below screenshot I haven't installed any.
So can anyone tell me:
1. where to get an system image for Android 6.0 API Level 23
2. how to install this system image manually/offline
Thank you in advance!
Firstly select the system image to be downloaded in android studio sdk, then it will start downloading the image and will say Downloading from <url>. Copy that URL and download from some download manager like IDM and after downloading, extract the files in system-images folder.
The directory structure pattern is sdk-folder/system-images/android-<api_number>/google_apis/x86 (or armeabi-v7a).
So, extract in correct pattern and then open the android studio sdk, you will see that the package is installed.
Now, you can make a virtual device from the downloaded system image.
SDK manager does not work for you?
In any case, there are several sites which can be used to download Android SDK system images:
https://web.archive.org/web/20191210131925/http://ady.my/viewer/system-image/
http://www.hariadi.org/android/manual-download-of-android-sdk-components/
Or alternatively Hard way :
for Windows, using the SDK Manager,
First make sure you have download caches enabled,then fetch/reload the packages. Then go to My Computer and open folder .android: =>
C:/Users/your_username/.android/
(Make sure you have enabled "show hidden files" option)
In there try to locate several xml file in cache dir. Those xml files contains URLs and other data of all the sdk package. Every package available in sdk manager can be downloaded through appropriate URL from there.
Open XMLs in IE and try to find what you need. Then you can use URLs from there and you're good to go.
Hope this helps
you can follow this link for manually installing the System Images for emulator, i just installed Android 6.0 (sysimg_x86-23_03) so that i can still render Marshmallow layouts in Eclipse.
These are the sites from where you can download them offline.
Mostly you will require Intel x86 System image or Intel x86_64.
First, but on this site every version of System image is most recent so you can download :
Intel x86-23_r0X from here (Revisions are from 03 to 09)
Intel x86_64-23_r0X from here (again, Revisions are from 03 to 09))
Hope i helped those who are looking for solution for older Intel System Images for Android 6.0.
For those with difficulty in finding the correct path to install. The path will depend whether the image is a playstore image or not.
You can figure out by looking at the images download link:
If the download link is inside the folder google_apis, e.g:
https://dl.google.com/android/repository/sys-img/google_apis/<api-file-name>.zip
Your folder structure should look like:
sdk-folder/system-images/android-<api_number>/google_apis/
But if the download link is inside the folder google_apis_playstore, e.g:
https://dl.google.com/android/repository/sys-img/google_apis_playstore/<api-file-name>.zip
Then your folder structure should look like:
sdk-folder/system-images/android-<api_number>/google_apis_playstore/

How to copy files to Android emulator instance

How am I able to push .txt files to the emulator using Android Studio?
One easy way is to drag and drop. It will copy files to /sdcard/Download. You can copy whole folders or multiple files. Make sure that "Enable Clipboard Sharing" is enabled. (under ...->Settings)
Update (May 2020):
Android studio have new tool called Device File Explorer. You can access it in two way:
By clicking on Device File Explorer icon in right bottom corner of android studio window.
If you could not find its icon, inside Android Studio press shift button twice. Quick search window will appear, then type Device File in it and Device File Explorer will appear in search result and you can click it.
Then you can navigate to folder which you want to push your file in it. Right click on that folder and select upload(or press Ctrl+Shift+O). Select file you want to upload and it will upload file to desired location.
Push file using adb.exe:
In Android 6.0+, you should use same process but your android application cannot access files which pushed inside SDCARD using DDMS File Explorer. It is the same if you try commands like this:
adb push myfile.txt /mnt/sdcard/myfile.txt
If you face EACCES (Permission denied) exception when you try to read file inside your application, it means you have no access to files inside external storage, since it requires a dangerous permission.
For this situation, you need to request granting access manually using new permission system in Android 6.0 and upper version. For details you can have a look in android tutorial and this link.
Solution for old android studio version:
If you want to do it using graphical interface you can follow this inside android studio menus:
Tools --> Android --> Android Device Monitor
Afterward, Android Device Monitor(DDMS) window will open and you can upload files using File Explorer. You can select an address like /mnt/sdcard and then push your file into sdcard.
You can use the ADB via a terminal to pass the file From Desktop to Emulator.
adb push <file-source-local> <file-destination-remote>
You can also copy file from emulator to Desktop
adb pull <file-source-remote> <file-destination-local>
How ever you can also use the Android Device Monitor to access files. Click on the Android Icon which can be found in the toolbar itself. It'll take few seconds to load. Once it's loaded, you can see a tab named "File Explorer". Now you can pull/push files from there.
Android Device monitor is no longer available in android studio.
If you are using android studio 3.0 and above.
Go to "Device File Explorer" which is on the bottom right of android studio.
If you have more than one device connected, select the device you want from the drop-down list on top.
mnt>sdcard is the location for SD card on the emulator.
Right click on the folder and click Upload. See the image below.
Note: You can upload folder as well not just individual files.
I am using Android Studio 3.3.
Go to View -> Tools Window -> Device File Explorer.
Or you can find it on the Bottom Right corner of the Android Studio.
If the Emulator is running, the Device File Explorer will display the File structure on Emulator Storage.
Here you can right click on a Folder and select "Upload" to place the file
I usually use mnt - sdcard - download folder.
Thanks.
After you drag and drop your files from Desktop to Emulator like this answer here :
https://stackoverflow.com/a/44885506/3904109
Your location of files will be
Android 19, 21, 22 /storage/sdcard/Download
Android 23, 24, 25, 26, 27, 28, 29, 30 /storage/emulated/0/Download
Open command prompt and give the platform-tools path of the sdk.
Eg:- C:\Android\sdk\platform-tools>
Then type 'adb push' command like below,
C:\Android\sdk\platform-tools>adb push C:\MyFiles\fileName.txt /sdcard/fileName.txt
This command push the file to the root folder of the emulator.
refer johnml1135 answer, but not fully work.
after self investigate, using official docs, it works now:
and use Drag and Drop actually worked, but use android self installed app Download, then you can NOT find the copied file, for not exist so called /sdcard/Download folder.
finally using other file manager app, like
ES File Explorer
then can see the really path is
/storage/emulated/0/Download/
which contains the copied files, like
/storage/emulated/0/Download/chenhongyu_lixiangsanxun.mp3
after drag and drop more mp3 files:
adb push [file path on your computer] [file path on your mobile]
on windows 10 , android studio emulator.
be on the directory yourFile.xml is.
on terminal, command:
adb push yourFile.xml \C:\Users\yourUN\.android\avd\Pixel_4_API_29.avd\mnt\sdcard
Pixel_4_API_29 is the emulator name , choose the device you are using on emulator
Just need to drag and drop to the corresponding directory in the ADB

Eclipse 64-bit - Android Virtual Device Manager Failed to create SD card

I am running Windows 7 64-bit and Eclipse also 64-bit with the latest ADT plugin installed and the Android ADK. All installed as instructed on the Android SDK site.
When I try to create a new AVD I get the following messages.
[Date *Time* - SDK Manager] Failed to create the SD card.
[Date *Time* - SDK Manager] Failed to create sdcard in the AVD folder.
I have tried different SD card sizes thinking It may be something to do with storage space allocation but that doesn't seem to be the case as my hard-drive has a lot of space left. Considering I have admin rights on my account it shouldn't be that it can't create a folder either. I really have no idea what is going wrong here and all I have been able to find on this are post on Ubuntu, which haven't been much help.
I found similar issue on my windows. Seems like this happen for 64 bit machines only. To solve this, make sure you have full access permission to all files under the Tools folder in Android SDK directory.
For linux/ubuntu, execute the following
chmod -R 777 ../tools
For windows, goto Android SDK directory..
Right click Tools folder > Properties > Go to tab "Security" > Select "Users" > Edit > Select "full control", save and close it.
It should work after doing this
Go to the following directory in your computer:
C:\Users\.android\avd
Inside this directory you will find all files and directories with the definition and content of your avd machines-
Now do the basic troubleshooting steps:
-check if the avd directory exists and if it contains a file with the name "sdcard.img".
-if the file exists, try to rename it (to check if its locked) and then go to eclipse and ask to create a new sd card.
-if it fails, try to create manualy a file with that name to check premissions.
good luck
Close the emulator which is in open, and re-try. This worked for me.

Android SDK Setup.exe will not run

Running XP sp3 when i click SDK Setup.exe command line promt comes up and goes away fast and nothing else happens is there a fix for this ?
try making empty folders named 'platforms' and 'add-ons' without quotations in your android-sdk-windows folder and then running sdk setup.exe
worked for me just now
I just download the .zip file, opened the file and double-clicked the SDK Setup.exe and it loaded fine. A setup window popped up in the background, that does not happen to you at all?
EDIT:
Take a look into Installing the Android SDK and look over the System Requirements and make sure you have both JDK 5 or JDK 6 (which you do) and JRE 6
Run it from the System command prompt not the User command prompt, not sure if thats really what its called, but there are 2 separate command prompts. You want the one that has higher privelages.
UPDATE
Is your computer able to connect to https? That was an issue that was holding me back from installing android at first, however it is appropriate for the command prompt to disappear immediately.
Ok here is my own fix and recommending it to others save SDK kit unzip to C:\ then 1.) download the latest java currently java 6.0.18 from --> java web site save and run (I used c:\ for file locations to save and run from) 2.) download the latest "Eclipse IDE for Java Developers" from --> eclipse org downloads site 3.) go to my computer c:\ --> C:\Program Files\Java copy the jre6 folder or jre...what ever version you may have paste the folder into the folder name C:\eclipse rename the folder from jre6 to just "jre" this will allow eclipse to run, in eclipse click on the help tab click install new software add location http://dl-ssl.google.com/android/eclipse/ ok do restart go back into eclipse go to window tab preferences, expand android, browse c:\android-sdk-windows ok, window tab Android SDK and AVD manager, Available packages, select all, update, in same area go to virtual devices, new, name: Hi target: android 2.1, create AVD, Select and start, now you will have android 2.1 emulator working

Categories

Resources