Virtual device related - Android Studio

I am learning how to develop android apps. So to debug, I need a device. I tried Genymotion, but it is not working on my PC. So instead, I set up a virtual device on virtualbox and that is running pretty good, but I don't know how to connect it to Android Studio for debugging and testing purposes. Please help me out. If irrelevant, delete the post. Thank you in advance.

shagunc96 said:
I am learning how to develop android apps. So to debug, I need a device. I tried Genymotion, but it is not working on my PC. So instead, I set up a virtual device on virtualbox and that is running pretty good, but I don't know how to connect it to Android Studio for debugging and testing purposes. Please help me out. If irrelevant, delete the post. Thank you in advance.
Click to expand...
Click to collapse
Why don't you use the virtual device already present in Android Studio?
Go to Tools --> android --> AVD manager
you can view the devices that are present in android studio. If you want create a new virtual device you can do so by clicking on "+ create virtual device".
in order to run your code on this device, Run your app by clicking on the play button, you will then get a pop up window. Click on Launch Emulator. Then in the "Android virtual device" drop down menu, select the device you want then press OK.

Dreamerz Studio said:
Why don't you use the virtual device already present in Android Studio?
Go to Tools --> android --> AVD manager
you can view the devices that are present in android studio. If you want create a new virtual device you can do so by clicking on "+ create virtual device".
in order to run your code on this device, Run your app by clicking on the play button, you will then get a pop up window. Click on Launch Emulator. Then in the "Android virtual device" drop down menu, select the device you want then press OK.
Click to expand...
Click to collapse
It's too slow and is not working properly.... idk why, but virtualbox runs good

Related

[Q] DDMS cannot find ADB

I am trying to fix the WiFi on my Captivate. This thread here tells how to do it. Unfortunately when I run DDMS I get the error "Failed to get the adb version: Cannot run program "adb": CreateProcess error=2, The system cannot find the file specified." I have tried installing the SDK on both a Windows 7 64-bit and XP 32-bit machine. I get the same error on both machines. I have tried both the generic Galaxy S drivers and the Captivate drivers. Any suggestions? Here are the instructions I've followed in case you don't want to read the other thread:
1. Install the SDK -> Android SDK | Android Developers
(make sure the <SDK>/tools path is added to the windows path variable. My Computer -> Properties -> Advanced -> Environment Variables -> System variable -> add the SDK path at the end of Path variable )
2. On your phone, please enable (tick mark) "USB debugging" under "Settings" -> "Applications" -> "Development"
3. Connect your phone using USB to PC/Laptop. Close phone manager application if it comes up on the PC.
4. Run "ddms.bat" from <SDK>/tools directory. The DDMS application will come up and it should readily connect to your phone. (in the main screen, under Name, you should find the phone ID and SW ver. no.)
5. Go to menu Device -> File Explorer. New window will come up.
6. Here go to data -> wifi directory. You will see a file bcm_supp.conf.
7. Though it is not possible to read this file, you should be able to delete it. (at least I could delete it). You can delete the file by selecting it and then pressing red "-" on top left of the window.
Thanks!
Post in q and a.
sent from my craaazy fast cappy running di11igaf v2.5 at 1280mhz!!!
silverslotcar said:
Post in q and a.
sent from my craaazy fast cappy running di11igaf v2.5 at 1280mhz!!!
Click to expand...
Click to collapse
Yes, Q&A would be the proper location for this thread.
Sent from my GT-I9000 using XDA App
Ok, sorry, although I just figured out the problem. The Path should have the platform-tools directory instead of the tools directory because that's where adb is located. I corrected that and it loaded right up. Unfortunately, when I click on the + sign for the Data folder it doesn't show me anything Guess I'm going to have to do a factory reset after all.
automagrt said:
I am trying to fix the WiFi on my Captivate. This thread here tells how to do it. Unfortunately when I run DDMS I get the error "Failed to get the adb version: Cannot run program "adb": CreateProcess error=2, The system cannot find the file specified." I have tried installing the SDK on both a Windows 7 64-bit and XP 32-bit machine. I get the same error on both machines. I have tried both the generic Galaxy S drivers and the Captivate drivers. Any suggestions? Here are the instructions I've followed in case you don't want to read the other thread:
1. Install the SDK -> Android SDK | Android Developers
(make sure the <SDK>/tools path is added to the windows path variable. My Computer -> Properties -> Advanced -> Environment Variables -> System variable -> add the SDK path at the end of Path variable )
2. On your phone, please enable (tick mark) "USB debugging" under "Settings" -> "Applications" -> "Development"
3. Connect your phone using USB to PC/Laptop. Close phone manager application if it comes up on the PC.
4. Run "ddms.bat" from <SDK>/tools directory. The DDMS application will come up and it should readily connect to your phone. (in the main screen, under Name, you should find the phone ID and SW ver. no.)
5. Go to menu Device -> File Explorer. New window will come up.
6. Here go to data -> wifi directory. You will see a file bcm_supp.conf.
7. Though it is not possible to read this file, you should be able to delete it. (at least I could delete it). You can delete the file by selecting it and then pressing red "-" on top left of the window.
Thanks!
Click to expand...
Click to collapse
Hi,
I am going crazy with this crap, I am not impressed how google put this **** together.
I can see you managed to fix the issue of ddms not finding adb but I didnt. Can you please explain in more details? I searched everywhere over the internet but everybody just says "add the path". Fine. Then what....?
I added a new path in the environmental system variables called "SDK" and points to:"C:\program files\Android\android-sdk-windows\platform tools\. Still no joy. What am I doing wrong?
thanks
Did you reboot after adding the path?
And I didn't realize that Google had changed the SDK path to "platform-tools" with their latest release. Just plain dumb imo as folks have been so used to it being in just the "tools" location.

[SDK] Android SDK addon for Motorola Atrix4G

Anyone that is in need of it .. attached here is the Motorola Atrix4G addon for the Android SDK .. also the instructions for installation and execution.
http://www.mediafire.com/?73hkz09wr0l1kqe
Installing and Using Motorola SDK Add-ons
A Motorola SDK add-on, when added to the Android™ SDK, allows you to run and debug your applications on an emulated Motorola handset. Note that while the device image that the add-on presents does not necessarily reflect the look of the actual device, from a functional standpoint it should be a fairly faithful emulation of the actual handset.
Installing the add-on
To install the Motorola SDK add-on, unzip it, and copy the resulting directory to the directory named add-ons within the Android SDK that you are using (if you are using MOTODEV Studio for Android and are not sure where it placed the Android SDK, check the SDK Location field in the Android preferences dialog).
** NOTE: If MOTODEV Studio for Android or Eclipse™ were running when you copied the SDK add-on, you will need to restart it for the add-on to be recognized by your development environment.
Using the add-on
In order to run or debug your applications on an emulated Motorola handset, you must first create an AVD that has its AVD Target set to reference the SDK add-on. You can then deploy your applications to it. When creating your projects, you can either target the emulated Motorola device specifically (which you would do if your application runs only on that device), or you can select a more general, compatible target such as Android 1.5. The following sections detail the steps involved in each of these tasks.
Creating an AVD
To create an AVD named "Motorola" using the command line, do the following (you may need to be within the Android SDK's "tools" directory):
android list targets
The details for each possible target are listed, starting with a unique ID number that identifies that target. Make note of the ID number for the Motorola add-on you want to target.
android create avd -n Motorola -t target-ID
For target-ID supply the ID number for the target you obtained from the previous step.
To create it from within MOTODEV Studio for Android:
Select Android AVD Manager from the Window menu. The Android Virtual Devices Manager dialog appears.
Enter Motorola (or whatever name you want to give the new AVD) in the Name field.
From the Target list, select the target named for the Motorola device you are targeting.
From the Skin list, select the skin named for your target device.
If you want the emulated device to have an SD card, in the SDCard field either specify the path and filename to a file containing an existing SD card image, or specify a size (such as 64M) to create a new, empty SD card image. Leave this field blank if the device isn't to have an SD card.
Click Create AVD.
Click Finish to close the dialog.
When creating Run or Debug configurations, you can now select this new AVD when choosing a target device.
**NOTE: If your newly-created AVD does not appear in the Device Management view, click Refresh, which is located in the top right corner of that view.
Starting the AVD
If you start a Run or Debug configuration that specifies a Motorola SDK add-on AVD as the target device, the AVD will be automatically launched for you. If you want to start the AVD without deploying an application to it, you can do so either from the command line or from within MOTODEV Studio for Android. From the command line, the following command will start the AVD named "Motorola":
emulator -avd Motorola
To start it from within MOTODEV Studio for Android, select the AVD from within the Device Management view and click Start.
Targeting the Motorola device
If your application is designed specifically for a Motorola device, select the corresponding Motorola SDK add-on as the project target when creating the project.
To change an existing project so that it targets the SDK add-on from an Eclipse-based IDE such as MOTODEV Studio for Android:
Right-click the project in the Package Explorer and select Properties.
From the list of properties select Android.
The project build target is shown in the right side of the dialog; select the one named for your target device.
If you are not using an Eclipse-based IDE you can change your project's target with the android update project command; see Google's developer documentation on developing in other IDEs.
Awesome exactly what I was looking for!! Thanks for the Info looking foward to working with this more. XD
Djazin said:
Awesome exactly what I was looking for!! Thanks for the Info looking foward to working with this more. XD
Click to expand...
Click to collapse
You're welcome
What features does the addon add? I'm assuming nothing I can play with right now because the main app I'm working on now is in Necessitas/Qt, but when I get back to playing with Eclipse what could this do?
Hmm, that's weird. Maybe I'm missing something, but why set up a mediafire link for it when it's freely available from the Motorola development website?
Plus if you download it from there, you can get install directions, USB drivers, motodev studio, and even some sample apps...

[Q]Screenshot taker!

Hi all!
Im looking for an application that can take screenshot for Xoom!
Please post here if you know!
Thanks!
I use Screenshot ER on my Xoom...hope this helps.
keunhuvac said:
Hi all!
Im looking for an application that can take screenshot for Xoom!
Please post here if you know!
Thanks!
Click to expand...
Click to collapse
If you are rooted, Screenshot ER I believe is the only one that works properly on the Xoom:
http://forum.xda-developers.com/showthread.php?t=995707
If you are not rooted, you will need to use the SDK method below:
You have to have the Android SDK loaded on your computer:
http://developer.android.com/sdk/index.html
You will also need Java Development Kit installed (make sure you download the proper version for your OS. Use Windows for 32-bit and Windows x64 for 64-bit):
https://cds.sun.com/is-bin/[email protected]_Developer
You run the ddms.bat file from the Android SDK tools folder in a CMD window (to see if there are any errors). While you can just double click the file, if it doesn't bring up the application window, there may be an error that will not be displayed unless you launch it from a CMD window. If you didn't change the default installation path when installing the Android SDK, you will find the ddms.bat in C:\Program Files\Android\Android-SDK\tools.
The Xoom will need to be in debug mode under Settings > Applications > Development. When you launch ddms.bat successfully, a window will launch and you select your device from the list and choose Device > Screen Capture. You do not have to be rooted.
If you still have problems especially getting the computer to recognize the Xoom in debug mode, follow the instructions here:
http://www.motorola.com/Support/US-EN/S ... bid=987654
OK! Thank you for helping me!
I already rooted and run tiamat 1.4.2!!

[Q] How to setup ADB driver for Windows 8?

Has anyone been able to set up ADB drivers for Kindle Fire HD 7 for windows 8?
Kindle was rooted but when i switched to windows 8 i got some random 7.2.1 user update that i thought i had already gotten and now root is gone and i cant seem to get ADB driver to install, any ideas?
I installed the same way as I did on my Windows 7 box. Just follow the instructions posted here: https://developer.amazon.com/sdk/fire/connect-adb.html
I am also trying to get the adb drivers installed, i used the guide you said to use and still it wont allow me to install the driver, just says the driver installation did not complete... =\ 64 bit windows 8 pro
Ustan1337 said:
I am also trying to get the adb drivers installed, i used the guide you said to use and still it wont allow me to install the driver, just says the driver installation did not complete... =\ 64 bit windows 8 pro
Click to expand...
Click to collapse
Try this if you have not already.
1. Connect your Kindle Fire to your computer's USB port using the USB cable.
2. From the Start menu, right-click Computer and select Manage.
3. In the left pane, under Computer Management, expand System Tools, and click Device Manager.
4. In the right pane, locate and expand Other devices.
5. Right-click the device name Kindle and click Properties.
6. In the Kindle Properties window, on the Driver tab, click Uninstall, then Confirm, and then unplug your device from your computer.
7. Then run the kindle fire adb drivers again.
8. Then plug in your kindle.
9. To confirm the device has been installed, from Start, click Control Panel, and then select Device Manager. In Device Manager, under Kindle Fire, the device will be included as Android Composite ADB Interface.
I did the above...it looks like its going to install but then i get the message 'install failed' during the setup....
I got Win 8 64bit. Delete the "signed_" part of "signed_kindlefirewinusba64/x86" files you'll be able to install it manually from the device manager.
However I still wasn't able to root my KF2 but that seems to be a different issue since the device is recognized as adb device in the device manager.
I've already got 2 versions of those files in the install directory 2 with the 'signed_' and 2 without?
Signed Drivers
Hey I installed the drivers through this:
1.Use the windowskey +I keyboard shortcut to bring the Chrams and click Change PC settings.
2.Navigate to General and under Advanced Startup, click Restart Now.
3.Now Windows 8 will restart in the advanced menu options, click on Troubleshoot.
4.Click on Advanced options.
5.Next, click the Startup Settings option from the menu.
6.The Startup Settings. From this page simply click Restart.
7.Now Windows 8 will reboot, but instead of going to the Desktop it will start in the Startup Settings page, from here hit F7 or the number 7. Then Windows will boot in a mode that will allow you to install unsigned device drivers in the operating system.
After this just install the drivers and your Kindle will connect with ADB
Hope that helps
Regards
Matr3x
source: pureinfotech.com/2012/09/05/installing-unsigned-drivers-in-windows-8-step-by-step/
Matr3x said:
Hey I installed the drivers through this:
1.Use the windowskey +I keyboard shortcut to bring the Chrams and click Change PC settings.
2.Navigate to General and under Advanced Startup, click Restart Now.
3.Now Windows 8 will restart in the advanced menu options, click on Troubleshoot.
4.Click on Advanced options.
5.Next, click the Startup Settings option from the menu.
6.The Startup Settings. From this page simply click Restart.
7.Now Windows 8 will reboot, but instead of going to the Desktop it will start in the Startup Settings page, from here hit F7 or the number 7. Then Windows will boot in a mode that will allow you to install unsigned device drivers in the operating system.
After this just install the drivers and your Kindle will connect with ADB
Hope that helps
Regards
Matr3x
source: pureinfotech.com/2012/09/05/installing-unsigned-drivers-in-windows-8-step-by-step/
Click to expand...
Click to collapse
This worked perfectly, thankyou very much
followed all instructions, doesn't work.
Drivers say they are installed. Computer does not recognize kindle.
Wasting waaaaaay too much time trying to figure this out. Giving up and trying on windows 7.

[Q] Any easy way to completely copy the state of one Moto X to another?

I got a new phone with a wood back and will be selling my old one soon. Is there an easy way to completely clone my old phone's contents onto my new one?
Could try doing an NAND backup on the old one. Then putting it in the same directory of the new one. The directory would be /twrp/backups/(some numbers assigned to be your phones ID)/backup name.
Your ID will change, but you should be able to use that backup to restore on the new phone.
Sent from my XT1060 using xda app-developers app
---------- Post added at 01:20 PM ---------- Previous post was at 01:17 PM ----------
You might have to make an NAND on the new phone to have the recovery make the new filepath
Sent from my XT1060 using xda app-developers app
kkeller87 said:
Could try doing an NAND backup on the old one. Then putting it in the same directory of the new one. The directory would be /twrp/backups/(some numbers assigned to be your phones ID)/backup name.
Your ID will change, but you should be able to use that backup to restore on the new phone.
Sent from my XT1060 using xda app-developers app
---------- Post added at 01:20 PM ---------- Previous post was at 01:17 PM ----------
You might have to make an NAND on the new phone to have the recovery make the new filepath
Sent from my XT1060 using xda app-developers app
Click to expand...
Click to collapse
Thanks. This requires root, right? I haven't rooted either of the phones, although I would if it sped this process up. It's something that I eventually want to do anyway.
beelbeel said:
Thanks. This requires root, right? I haven't rooted either of the phones, although I would if it sped this process up. It's something that I eventually want to do anyway.
Click to expand...
Click to collapse
Yea. Sorry. A custom recovery/safestrap is required. I kinda assume anyone who's on XDA has it. Without root I'm not entirely sure how to do it any other way than manually.
Sent from my XT1060 using xda app-developers app
Without root the best you can do is mybackup pro or titanium backup. They will back up app data but not the apps themselves. Get your new phone, download your apps, restore app data from mybackup.
I wrote this before, but this is how you can backup your apps and their data with a computer and without root. Moto X's have Motorola Migrate that can move over some settings.
This process can take a bit to explain, so sorry for the long post.
First, you'll need to install Oracle’s Java Development Kit, which the Android SDK requires. Download and install the 32-bit version. The Android SDK wants the 32-bit version, even if you're using a 64-bit version of Windows.
Next, download the Android SDK from Google. Extract the .zip folder to a location of your choosing, but remember where you put it. If you have the option to open extracted contents in a new window, do so.
Okay, now open the Android SDK Manager (you may have to open a subfolder or two) with administrative rights. You do this by right clicking on the .exe and choosing the option "Run as administrator". A window will pop up, click yes, and after a small wait, the SDK Manager will open.
Now within the SDK Manager, under the tools section, check the box for Android SDK Platform-tools and click Install. This can take some time depending on your Internet connection. Once installed, go back to the open window where you clicked the SDK Manager .exe and navigate to the folder named "Platform Tools". If you're unsure where this is, the SDK Manager has the path of install located near the top.
Now let's get the phone ready. If you can, charge your device to its fullest. Now go into the settings, scroll down to 'development options'. Near the top of this menu, make sure the toggle switch is in the 'on' position. Now scroll down to USB debugging, and tick the box. Tap "OK" when the message shows up. Now plug the smaller end of the USB cable (preferably the one that came with your phone) into the bottom of the phone and the other into an open USB port of your computer. It's best to use a 2.0 USB port (no blue end) and if on a desktop, a port located in the rear.
If your computer starts installing any drivers, let it do this. Once that's finished, go to the window with the Platform Tools folder open. You should see a few files, two named "ADB" and another "Fastboot". Now hold your Shift key, right click in an open area, and choose the option "Open command window here". You may release the shift key at this time.
We're almost done. To make sure your tablet is seen by the computer type:
Code:
adb devices
One device should be listed. If you see no devices, adb can’t communicate with your device because its driver isn't installed properly. In this case, go back to the SDK Manager and download the USB drivers. You may also need to restart your computer.
Assuming you're up and working, type:
Code:
adb backup -apk -shared -all -f C:\backup.ab
This backs up all the installed apps (APK files) and shared storage (SD card) data to the C:\backup.ab file on your computer.
After running this command, you'll have to agree to the backup on the device. You can also encrypt the backup with a password here, if you like (leave it blank if you don't want encryption). Depending on how much data there is to back up, this can take some time. The device will let you know when it's done.
Now for the restoration process:
On the new device, make sure USB debugging is enabled. On the computer, follow the same steps for opening the adb command window. Ensure adb can see the device, then type:
Code:
adb restore C:\backup.ab
On the device, you will need to confirm you want to do a full restore. If you encrypted the backup, enter in the password, then hit "Restore my data". If you didn't add encryption, then leave that area blank. Once the restoration is done, you're good to go.
Thanks for the replies.
Hikikomori-Otaku said:
I wrote this before, but this is how you can backup your apps and their data with a computer and without root. Moto X's have Motorola Migrate that can move over some settings.
This process can take a bit to explain, so sorry for the long post.
First, you'll need to install Oracle’s Java Development Kit, which the Android SDK requires. Download and install the 32-bit version. The Android SDK wants the 32-bit version, even if you're using a 64-bit version of Windows.
Next, download the Android SDK from Google. Extract the .zip folder to a location of your choosing, but remember where you put it. If you have the option to open extracted contents in a new window, do so.
Okay, now open the Android SDK Manager (you may have to open a subfolder or two) with administrative rights. You do this by right clicking on the .exe and choosing the option "Run as administrator". A window will pop up, click yes, and after a small wait, the SDK Manager will open.
Now within the SDK Manager, under the tools section, check the box for Android SDK Platform-tools and click Install. This can take some time depending on your Internet connection. Once installed, go back to the open window where you clicked the SDK Manager .exe and navigate to the folder named "Platform Tools". If you're unsure where this is, the SDK Manager has the path of install located near the top.
Now let's get the phone ready. If you can, charge your device to its fullest. Now go into the settings, scroll down to 'development options'. Near the top of this menu, make sure the toggle switch is in the 'on' position. Now scroll down to USB debugging, and tick the box. Tap "OK" when the message shows up. Now plug the smaller end of the USB cable (preferably the one that came with your phone) into the bottom of the phone and the other into an open USB port of your computer. It's best to use a 2.0 USB port (no blue end) and if on a desktop, a port located in the rear.
If your computer starts installing any drivers, let it do this. Once that's finished, go to the window with the Platform Tools folder open. You should see a few files, two named "ADB" and another "Fastboot". Now hold your Shift key, right click in an open area, and choose the option "Open command window here". You may release the shift key at this time.
We're almost done. To make sure your tablet is seen by the computer type:
Code:
adb devices
One device should be listed. If you see no devices, adb can’t communicate with your device because its driver isn't installed properly. In this case, go back to the SDK Manager and download the USB drivers. You may also need to restart your computer.
Assuming you're up and working, type:
Code:
adb backup -apk -shared -all -f C:\backup.ab
This backs up all the installed apps (APK files) and shared storage (SD card) data to the C:\backup.ab file on your computer.
After running this command, you'll have to agree to the backup on the device. You can also encrypt the backup with a password here, if you like (leave it blank if you don't want encryption). Depending on how much data there is to back up, this can take some time. The device will let you know when it's done.
Now for the restoration process:
On the new device, make sure USB debugging is enabled. On the computer, follow the same steps for opening the adb command window. Ensure adb can see the device, then type:
Code:
adb restore C:\backup.ab
On the device, you will need to confirm you want to do a full restore. If you encrypted the backup, enter in the password, then hit "Restore my data". If you didn't add encryption, then leave that area blank. Once the restoration is done, you're good to go.
Click to expand...
Click to collapse
Thanks for the detailed response. I actually use a mac, and I might have to do some research to see what parts of this process still apply. I may also just investigate other methods of transferring most (perhaps not all) of the data.
beelbeel said:
Thanks for the detailed response. I actually use a mac, and I might have to do some research to see what parts of this process still apply. I may also just investigate other methods of transferring most (perhaps not all) of the data.
Click to expand...
Click to collapse
This may help with getting adb to work on your Mac http://forum.xda-developers.com/showthread.php?t=1917237 Otherwise you could use an application like VMware Fusion to virtually run a Windows OS on your Mac. I know you can get evaluation copies of Windows to use that don't require a product key (they only work for 90 days though).

Categories

Resources