Moving Android Virtual Device (AVD) from one computer to another - android

I am trying to clone my AVD to another computer with no much luck.
I want all the application installed on it will be saved together with the data.
I tried to follow some instructions I found on the web but they don't work for me.
Simply copying the avd files including changing the ini files simply causing the AVD to load in a 'vanilla' mode where all the apps and data is lost...
Note, that doing so on my computer works so i can save a copy in that manner. I guess there is another configuration somewhere that I am missing but it is not in the avd folder.
any pointers?
Thanks!

Finally i found my problem and answer here: PANIC: Broken AVD system path. Check your ANDROID_SDK_ROOT value
apparntly the AVD has hard coded base files in the qemu image files. I had to use the HEX editor to solve it.

I have solved same problem by creating same virtual device on same API, run it first time, than copy several ini-files from new AVD to transferred one.

Related

Moving the default folders(.AndroidStudio2.X and .gradle ) to D disk:

I want to move Installed AndroidStudio from C: disk to another.
I've successfully(by standard way) .android folder, sdk folder(with it's environment variable) and installation path. However, I cant handle these ones:
c:\users\user\.AndroidStudio2.2
c:\users\user\.gradle
when I move these folders to d:\myfolder and changing every occurrence of c:\users\user\.AndroidStudio2.2 to d:\myfolder\.AndroidStudio2.2 (with TextCrawler), and changing .gradle location in AndroidStudio, it doesnt help.
In C:\user\user there is still created (upon running AStudio) .AndroidStudio2.2 folder. And running Emulator causes errors, because it cant find anything options in C:\users......
plus, I have uncommented and set the path values (in installation/bin/idea.properties) to d:\myfolder, but still no help.
Having dome something similar in the past, I find that moving drives on most software applications is still a big pain. However, I found that creating symlinks was helpful, as the software will "think" it's accessing the files at a location, but in reality they are stored in another.
I successfully did this in the past with Visual Studio and the concept is pretty much the same with Android Studio. You need to create a symlink as follows:
mklink /J "d:\myfolder\.AndroidStudio2.2" "c:\users\user\.AndroidStudio2.2"
Now when Android studio read or write the contents in c:\users\user\.AndroidStudio2.2, it will be in reality going to your d drive, which provided that it's accessible by the c drive, should make it all work.
You should be able to do that with the other folders as well. The benefit of doing it this way is that you're not constrained to the path the file is stored, which means that if you change computers or decide to store everything on the c drive again, you can just remove the symlink.
Hope this helps you.

Create a virtual device appear an error "The skin directory does not point to a valid skin"

My SDK tools to version 24.2
and SDK with Android 4.4W.2 (API 20).
I used Android Virtual Device (AVD) to simulate Android wear devices.
but appear error "The skin directory does not point to a valid skin"
I just had to close the dialog window and try creating the emulator again
Did you choose skin? Do like my captures, It works. Firstly, choose Android x86. Secondly, click ADVANCE SETTINGS to select CUSTOM SKIN DEFINITION.
I clicked on the ... button and chose my $ANDROID_SDK/skins (~/Library/Android/sdk/skins on my mac) directory, and then I was able to choose the appropriate skin.
I had this same error "The skin directory does not point to a valid skin." when creating an Android wear virtual device using AVD manager launched from Android Studio.
Solution for me was to pick the "Wear OS Round" skin option instead of the "Wear OS Round Chin" in previous screens.
The hardware file must be missing if you are getting this error. Make sure to add them by going to the previous page as shown in the attached image, click on New Hardware Profile, and click on Next.
Your problem should then be sorted.
In the case you create the device manually just by screen size, android studio might give you this error. Under advanced options you can explicitly select no skin to make the error go away.
None of the other answers helped me. I was UNable to find the correct directory because the Library is a hidden folder on Apple OS and for some reason Android Studio won't let me access hidden folders. So I had to link the hidden directory inside of a visible one:
Hidden folder: /Users/user_name/Library/Android/sdk/skins/pixel_2
I created a new UNhidden folder called: /Users/user_name/development/skin
The code I used to link it is:
ln -s /Users/timothy_brinkley/Library/Android/sdk/skins/pixel_2 skin
Screenshot of what the new shortcut looks like in the Finder
A bit of a face palm but in case it helps someone else.
I recently had this problem and it was because I didn't realize the skin I downloaded had two zip files inside of it for two different colored emulators. So, not only was I one level too high, Android Studio also didn't know what to do with those zip files.
Once I unzipped them and pointed to one, the error went away.

Accessing files from genymotion sd card

I have been using genymoton for quite some time now.
Could someone pls. tell me if there is a way by which I can access the files present in the sd card of genymotion emulator?
Currently I have to upload them to google driver and then download on windows.
You can use shared folder for that. It is well explain on this Google+ post.
Here is the brief:
Go to your VirtualBox VM setting / Shared folder tab
Add a shared folder with the folder you want to shared, and check the "auto mount" option
Start your VM as usual from the Genymotion software
Your shared folder is available in the /mnt/shared directory (multiple shared folders are supported)
This is also possible using the Android Device Monitor.
You already have this if you have the Android SDK installed.
This method works for all connected devices, including emulators like genymotion.
In Android Studio, click the icon that says Android Device Monitor in the toolbar.
(This is also available from Eclipse or you can just type monitor in the command line after moving to the tools folder of your installed sdk)
In the Android Device Monitor, go to the File Explorer tab.
Make sure you have a device selected on the left side.
Find the desired file and select it.
For the sdCard you might need to open the storage folder and open the sdcard there.
Click the button on top that says "Pull a file from the device".
Make sure you select Pull, not Push. Unless if you want to put new files on your device ofcourse.
Save the file to your computer...
and voila! The file from your genymotion is now among your other files on your computer. Ready to be used however you like.
Or alternatively you can also use a third party app like airdroid or any advanced file explorer to exchange files between your device and your computer.
(For installing third party apps you either need to find the apk or flash gapps on your genymotion first and go to the play store.)
Another way that I adopted, just install EsFileEx on genymotion.
Grab your files that you want to copy from e.g
/sdcard/WhatsApp/media/dp.jpeg
Swipe to LAN, here you can see your local machine as 10.0.3.2 or any IP. Here you can access your shared folder/drive of local machine/PC, past copied file here and you done!
NOTE! R/W permission should be set on shared folder/drive of local machine/PC
You can use the eclipse with the ADT plugin and browse the file system like any other android virtual emulators. I have been using this for a while, but eclipse crashes at some times.

Where does the android emulator data lies?

Where does the emulator data lie(the contacts, messages, saved images)?
Go to ddms,you can find the file explorer from that you will get application directry and sd card filed you can find all the detailed files there.
In ~/.android (that is your user directory/.android)
Each application stores its own data in its own private folder in /data/data on the emulator. Depending on the application it potentially can also store data on the /sdcard (e.g. downloaded images or whatever) which by convention should then be in /sdcard/Android/data/com.yourappspackage.and.so/ so that it gets cleaned up with uninstall but many apps also throw stuff all over the sd card (although they should not..)
More is on the dev site e.g. at http://developer.android.com/guide/topics/data/data-storage.html
All this is the same for the emulator as well as the real device. The emulator is just a virtual machine running on qemu.
You can use File Explorer tool in eclipse or ddms to View The data in the emulator
else use terminal to view the data using the command,
adb shell
Thank you,
Ganapathy.

How to restart Android emulator and preserve system data

Is it possible to preserve system data (not SD card data) on Android emulator when it is shutdown?
My specific problem is that I am trying to import a new root certificate into the /system/etc/security/cacerts.bks file, but that requires a restart, and when I do restart the emulator the file gets reverted to original state.
The file is a part of the system image, and is not a part of the files created under .avd folder.
Found a link on how to backup/modify a system image. The comments are not in English, but the commands are pretty straightforward.
I think that I once managed to do this by finding a temporary file that contained the modified /system image of the running emulator, and saving a copy which I later substituted for the initial image in an avd that I made to hack on.
Unfortunately I don't remember where I found the temp file. Playing with it at the moment the file called out in the avd seems to be changing and I can't find indication of any other candidates that are open. Perhaps what I did was copy that while the emulator was still running? At the moment dummy files I create in /system after remounting it writable seem to persist across emulator destruction and recreation without any effort on my part.
Additionally, are you sure that an actual reboot of the emulator is needed, that simply using the adb shell to 'stop' and then 'start' the android framework won't do the trick?

Categories

Resources