I am trying to make a simple GPS app so I want to check it on my device emulator.
So, I enable the ADB integration in android studio through Tools>android>enable ADB integration, then I open the device monitor, and then from there I open an emulator from window>Android Virtual Device Manager.
I then press the green arrow to run my app, it launches on the emulator, but from some reason, in the device monitor emulator, all the options are disabled as follows on this picture:
all options are disabled
any ideas what to do so I can change the coords?
See this answer about debugging your greyed out Location Controls in AVD Manager. Even though its pre Android Studio, the suggested tools/ folder in the SDK folder still applies. (Here's Tips on finding SDK location if needed.)
You might also try these methods from the Android API Guides. The third method near the bottom of the page, which uses telnet in terminal, is my favorite.
Related
I'm new to the Android OS and I am having trouble interacting with a virtual device. I've installed the Android SDK + Java + Eclipse and I'm trying to get a virtual device running and debug an apk I have.
I create a AVD and start it up and get this basic screen below but none of the other Android OS options you'd see on a standard phone. I can't even really control this device as the buttons seem to have no effect. I can't get into settings or see default installed applications, etc..
What am I doing wrong? I'd expect to have a basic clean Android OS startup when I launch these virtual devices but I get this funky screen and can't do anything with it, controls don't seem to work.
Worth noting I am doing this from a VMWare Workstation running Windows 2012 R2, not sure if there are issues if I'm running this all in a VM.
UPDATE:
OK so it appears I was using the Android 4.4W which I think is for wearable devices and why the OS was basically empty. I changed it to Android 4.4.2 x86 by cloning a Nexus 5 and now I just get a blank screen when I try to start the emulator. Here is a screenshot, any ideas?
Update:
You are using Android Wear API target, please try with regular android API (L preview or API 19 or below). I was able to reproduce your issue if i used Android Wear Target, it works if i used non-wear target. Android wear target is for 'wear' device types.
When configuring the AVD, you can pick different "skins" , please see below highlighted in redbox
If you are using a custom (or vendor) defined device type, go into AVD Manager -> Device Definitions and double-click your device entry, it will open the below window, make sure Buttons tab says Software
You can also navigate the emulator UI with keyboard shortcuts, often quicker this way.**
A. Ashoke is right about using skins, you may choose a skin when you create or edit the emulator. Here is a screen-shot. Check the 'skin' dropdown. (It may not be available for some 'devices' you select here.
You are using VMWare, so you might be behind a proxy. You may need to provide proxy, using following steps -
Click on Menu
Click on Settings
Click on Wireless & Networks
Go to Mobile Networks
Go to Access Point Names
Here you will Telkila Internet, click on it.
In the Edit access point section, input the "proxy" and "port"
Also provide the Username and Password, rest of the fields leave them blank.
When you will load it for the first time, it may again ask for your credentials. So provide there as well.
My Device shows up on the Android Device Chooser as:
Serial Number -- Ige-vm670-A0000028F1773B
AVD NAME -- N/A
Target -- 2.2.1 (with a green check mark next to it!)
State -- Online
Everything seems fine..So, I press the "OK" button on the bottom right hand corner of the Device Chooser screen. When I do this the Device Chooser closes and the Launching bar in eclipse eventually finishes, but then the application never starts on my phone!! :(. Am I missing something? I tried using different USB cables, switching from USB 3.0, and checking if there is enough memory on my phone but nothing seems to work :(. PLease help this newbie!! I'd much appriciate it!! ALso, i'm running eclipse in windows 8.
following steps may help you
1)Restart your Device
2)Go to application settings and enable the USB debugging.
3)also enable other application to run on your device.
4)make sure that device status is online on android device chooser.
5)make sure that your device appear in device list in android Eclipse.
If above steps wont help you then try to run your project on emualator.And if emulator fails to launch your project then you need to see the android console
Enabling SD-Card access may result failure of connecting to the device.
Please try to switch MTP on instead of either PTP or SD-Card
i m starting (or at least trying to) developing android application(s) and I m using eclipse for it along the android sdk.
Now I m wondering if there's a faster way to "test" and tryout something newly writen in the code than starting it in the emulator?
I'm wondering because I m running on 8gb ram and q9550 (quadcore) and it takes some time (let's say 20secs) to upload and start the apk and now
I'm wondering if this really is the only way to test since it requires huge amount of time, especially when I'm trying something new which doesn't work and thus I'm always gotta run it like this let's say like 20 times until I figure out what's wrong with my code...
You can connect your android phone using USB debugging mode and debug your code. If you can't do that, you can export an apk file (which is quick) and use dropbox/gmail to send it to your phone. I am not a big fan of emulator :)
Here's how to enable usb debugging
http://www.groovypost.com/howto/mobile/how-to-enable-usb-debugging-android-phone/
I would recommend running on your device rather than the emulator.
http://developer.android.com/tools/device.html
In short:
Turn on "USB Debugging" on your device.
On the device, go to Settings > Applications > Development and enable USB debugging (on an Android 4.0 device, the setting is located in Settings > Developer options).
Set up your system to detect your device.
If you're developing on Windows, you need to install a USB driver for adb. For an installation guide and links to OEM drivers, see the OEM USB Drivers document.
If you're developing on Mac OS X, it just works. Skip this step.
If you're developing on Ubuntu Linux, there is a detailed guide in the link above.
Now in eclipse, your device should be available to run on.
In the eclipse toolkit, you have the option to run it directly on a device. It's rather quick to do so.
Enable USB debugging as well as installation of apk from sources other than the market. Then assuming you have already setup the required drivers/settings to connect to your phone via ADB, you should be able to run it on the device and debug. In the run dialog, it will list all available devices and you can simply select the one you want to use.
If you already have a run entry (i.e. you've already run your application),
select your project
click Run -> Run Configuration
You should be in your application run configuration (on the left under Android Application -> Your_App).
In the Target tab, you should be able to select your device. It will likely already be in "Automatically pick compatible device...". On my setup, it will run directly on my phone if it's the only available device. You can select Always prompt to pick device which will let you choose every time.
Eclipse plugin (ADT) information: http://developer.android.com/tools/help/adt.html
Information about setting up your device: http://developer.android.com/tools/device.html
I know android emulator is too slow.
You can either use device or
try bluestacks it saves lots of time.
User device only when you want to test your app for particular device.
Here is what you are looking for :
http://developer.android.com/tools/device.html
To summarize:
Plug your phone to your computer with a USB cable.
Make sure the drivers are installed and your phone properly connected.
Make a Ctrl + F11 from eclipse.
It will build the apk, transfer it to your phone and then launch it automatically.
If you have unit tests, Robolectric lets you run them without using the emulator or the device.
you can download bluestacks as emulator, as it is really fast.
after then make settings in eclipse as window->preferences->android->build -> then uncheck the 3rd checkbox written as "skip packaging and...", then apply and restart the eclipse to take effect.
now open the bluestacks in background and just double click the apk file in bin folder of eclipse and bluestack will install it in 2 to 3 secs and you can directly see the result.
NOTE here that you have to only save the file ,you working on in eclipse and only double click on apk, and result will directly appears to bluestacks. Without uninstalling and reinstalling apk in bluestacks.
and you can delete your apk also, it automatically immediately create
a fresh version of apk (thus not required) as soon as you save all your files apk will be updated.
Google BlueStacks.
It runs on Windows and it's really fast.
I'm quite new to Android and have been using an AVD to debug my app so far. However, I want to start checking the media options and therfore need to start using my Android phone. How do I get Eclipse to load my app to my phone instead of my AVD?
First you need to enable USB debugging on your phone, then connect it to your computer via USB. Then eclipse should automatically start debugging on your phone instead of the AVD.
just for additional info,
If your apps is automatically run on emulator,
right click on the project, Run As -> Run Configuration,
then on the Run Configuration choose on the Manual.
after that, if you run your apps you will be prompted to chose where you want to run your apps, there will be listed all the available device and emulator.
I had the same problem, and have not been able to get Eclipse in Windows 7 to recognise the device. The device is correctly configured, Windows 7 recognises it on the USB port, and I edited the Run settings in Eclipse to prompt for a device, and it is just not there.
I ran it with the following steps:
Connect the device to the computer with USB.
Ensure the device is not locked (ie. timed out in the UI). I have to keep unlocking it while I'm working.
Wait for Windows to recognise the USB device, and when the autoplay menu comes up select Open device to view files. It should open up the file system in the device, in Explorer.
In Explorer go to the Eclipse workspace and find the apk file from the build (eg. MyFirstApp.apk)
Copy the apk file to the Downloads directory on the device
On the device, use the My Files app (or similar) to open the Downloads directory.
Click the downloaded file (My First App.apk) and Android offers to install it
Select install
The app is now in the installed Apps. Run it.
A second method is to mail the apk file to the device and then download and install it. (Credits to a post on SO which I can't find now).
A third method is to use DropBox. This requires installation of DropBox on the PC and on the device (from the play store) but once both are set up it runs very smoothly. Just share a DropBox folder between the two devices, and then drop the APK into that folder on the PC, and open it on the device. With this method you don't need a USB connection, and can also install the APK on multiple devices. It also assists the management of multiple development versions (by making a separate sub-folder for each version).
In Eclipse:
goto run menu -> run configuration.
right click on android application on the right side and click new.
fill the corresponding details like project name under the android tab.
then under the target tab.
select 'launch on all compatible devices and then select active devices from the drop down list'.
save the configuration and run it by either clicking run on the 'run' button on the bottom right side of the window or close the window and run again
You don't have to do anything really except prepare your phone to be able to run debug and usb apps :
http://developer.android.com/guide/developing/device.html
then simply launch your app from eclipse and your device will be used if you don't have a simulator running.
First of all, Enable USB debugging on your device.
On most devices running Android 3.2 or older, you can find the option under Settings > Applications > Development.
On Android 4.0 and newer, it's in Settings > Developer options.
In eclipse go to Run Configuration and select Always prompt to pick device
Some people may have the issue where your phone might not immediately get recognized by the computer as an emulator, especially if you're given the option to choose why your phone is connected to the computer on your phone. These options are:
charge only
Media device (MTP)
Camera file transfer (PTP)
Share mobile network
Install driver
Of these options, choose MTP and follow the instructions found in the quotes of other answers.
Hope this helps!
goto run menu -> run configuration.
right click on android application on the right side and click new.
fill the corresponding details like project name under the android tab.
then under the target tab.
select 'launch on all compatible devices and then select active devices from the drop down list'.
save the configuration and run it by either clicking run on the 'run' button on the bottom right side of the window or close the window and run again
For those who are trying to find how to enable debugging on devices running Jelly Bean 4.2 (e.g Google Nexus), you have to go to Settings > Apps > About tablet and tap the text "Build number" 7 times slowly. Go back to the now available Settings > Developer options and check USB debugging as stated in previous posts.
Check to see if the Andriod Device is installed on PC. See steps below. The 'Other device' will change to 'Andriod Device' once the USB drive is installed. The browse path should be
\extras\google\usb_driver\
not the sub directories under it. Otherwise the installation will not find the package.
To install the Android USB driver on Windows 7 for the first time:
Connect your Android-powered device to your computer's USB port.
Right-click on Computer from your desktop or Windows Explorer, and select Manage.
Select Devices in the left pane.
Locate and expand Other device in the right pane.
Right-click the device name (such as Nexus S) and select Update Driver Software. This will launch the Hardware Update Wizard.
Select Browse my computer for driver software and click Next.
Click Browse and locate the USB driver folder. (The Google USB Driver is located in \extras\google\usb_driver.)
Click Next to install the driver.
connect your device to system and set you device debug mode on when you run your application Android Virtual Device AVD will select device there you will see your connected device select your mobile device and thats all refer this link to set your device debugging mode on
http://developer.android.com/training/basics/firstapp/running-app.html
The USB drivers in \extras\google\usb_driver didn't work for me.
However the official drivers from Samsung did:
http://developer.samsung.com/android/tools-sdks/Samsung-Andorid-USB-Driver-for-Windows
Note: I'm using a Samsung Galaxy S2 with Android 4.0 on Windows 7 64bit
What I did, by reading all of above answers and it worked as well: 7 deadly steps
Connect your android phone with the pc on which you are running eclipse/your map project.
Let it install all the necessary drivers.. When done, open your smart phone, go to: Settings > Applications > Development > USB debugging and enable it on by clicking on the check button at the right side.
Also, enable Settings > Unknowresoures
Come back to eclipse on your pc. Right click on the project/application, Run As > Run configurations... >Choose Device>Target Select your device Run.
Click on the Target tab from top. By default it is on the first tab Android
Choose the second radio button which says Launch on all compatible deivces/AVDs. Then click Apply at the bottom and afterwards, click Run.
Here you go, it will automatically install your application's .apk file into your smart phone and make it run over it., just like on emulator.
If you get it running, please help others too.
Thanks this helped. It was a little tricky getting the USB debugging option enabled on the Samsung G3 after the update.
See below
Instructions on Samsung G3 Jellybean
Settings
Click --> About the phone
Tap on the build number
“You are now 4 steps away from being a developer.” Keep tapping until it says “You are now a developer.”
Go back to Setting-->System --> Developer option: Enable USB Debugging
Step by step:
Connect your phone to computer via USB
Enable USB debugging on your phone: Settings -> Applications -> Development -> USB debugging
Change Run configuration in your Eclipse project:
right click -> Run As -> Run Configurations. In the Target tab choose Always prompt to pick device (or Manual). Then Apply, Run.
In the new window you should see your connected phone.
Yes! You can Debug Android Application While you are developing them follow these steps..
Make sure that you have PC suite of the mobile manufacturer. For Example:if you are using samsung you should have samsung kies
1.Enable USB debugging on your device:Settings > Applications > Development > USB debugging
2.Enable Unknownresources:Settings>Unknowresoures
3.Connect your device to PC
4.Select your Application Right click it: RunAS>Run configurations>Choose Device>Target Select your device Run.
You can also without using debugging cable.For that you need to install Airdroid in your device.After installing enter the link in your browser and Drag and Drop .apk file.
Happy Coding!
First you need to set your device to debugging mode. On Android 4.X that means as described in another answer in another question:
Open up your device’s “Settings”. This can be done by pressing the Menu button while on your home screen and tapping “System settings”
Now scroll to the bottom and tap “About phone” or “About tablet”.
At the “About” screen, scroll to the bottom and tap on “Build number” seven times. [Note this is no joke]
Make sure you tap seven times. If you see a “Not need, you are already a developer!” message pop up, then you know you have done it correctly.
Done! By tapping on “Build number” seven times, you have unlocked USB debugging mode on Android 4.2 and higher. You can now enable/disable it whenever you desire by going to “Settings” -> “Developer Options” -> “Debugging” ->” USB debugging”.
The next step is to connect your device to your computer via the USB cable.
The next step is to install a USB driver for it. On the official website you find a list with sources for drivers for phones from various different companies.
Eclipse now should give you the phone as a choice when you click on Run and it presents you possible device to launch.
In some case Eclpise will tell you Target Unknown which prevents you from using the device. If that's the case you might have to restart the phone. You might also have to check and recheckUSB debugging, till the phone asks you to allow your particular computer to do usb debugging.
I'd like to check for memory leaks in my Android app using the DDMS feature in Eclipse. When I launch an emulated device, the threads display properly for the emulated device, starting with 8600 and up.
However, when I connect my Droid to the PC, the device shows up just fine in DDMS. The logcat is generated correctly, and I can view the file structure. However, threads do not display. I get "no client selected" in the Threads pane, and there is no drop-down icon next to the device listing.
Do I need to change some particular setting in Eclipse? Is this maybe a driver issue?
Eclipse Preferences (OSX) > Android > DDMS > check Thread Updates Enabled by Default
Add Android Device view to get device pan(e) noted above
Set android:debuggable=true (two g's) in app tag as noted above
Run your app in emulator
Select device in device pane
Click the update threads button
Enjoy
Make sure you have android:debuggable="true" in you application tag in the manifest file
This is expected behavior. The issue is your droid is not in debug mode. Notice that in the Devices pane, beside the version number, debug is stated against the emulated device but not in the case of the droid.
From what I have found so far - on the droid, only an app can be run in debug mode; and only this will be listed under your device in DDMS.
I don't know how to run(/boot) the entire droid in debug mode, or if it is possible. So far as it appears, there is no way to boot an entire real device in 'debug' more.
Go to DDMS
Select device in device pan
Look at header of this pane. You can see update threads
You can see thread and updates from device
If you use Intellij Idea like me - run monitor from tools-> android, other way Idea built in ADB conflict with ddms.
On Android Studio :
On the DDMS (Dalvik Debug Monitor Server) Screen:
Show View -> and then select the profiling view you need.