Android Studio and android device monitor - android

I just switched from Eclipse to Android Studio. For what I saw since now the new IDE has a lot more features than Eclipse, and I like using the new IDE for my app development work.
I just can't understand one thing: in Eclipse, there is the very useful DDMS perspective, from where you read Logcat and do a lot of other things, like using the very useful dump view hierarchy function, which allows you to take a dump of the UI and inspect it to understand what is shown where in your layout.
I'm not seeing nothing similar in Android Studio, and after making a lot of research it seem that the only way you have to do this is opening the Android device monitor from the "Tools" menu.
But doing this way the ADB connection get broken, because it is being used by Android Studio, and Android Device Monitor wants to use it. The result is that if you are debugging your app you can't open android device monitor unless you want to lose your debug status.
I think this is not acceptable and I'm sure there must be some better way to use Android Device Monitor tools together with Android, is that possible?
Thank you

Actually I found a solution, I don't know if it is the best way (I keep thinking that android studio MUST integrate device monitor in a better way )
As stated in the question, starting device monitor from the menu tools causes android studio disconnect the device, but if you open the android studio's built in terminal (View > Tool Windows > terminal) and just type "monitor" it starts device monitor without detaching the device from android studio (you will get a warning on device monitor saying that there was a problem attaching the debugger, but don't care about that)
hope this will help some one

There are several ways you can find the DDMS tool using android studio. Eclipse is not needed for that as the tool is a separate program that comes with the android SDK.
Click on the Android Device Monitor Icon in the toolbar in Android Studio
Open the monitor.bat file (on a windows machine, this is located in [path-to-sdk]/sdk/tools)
Type monitor in the terminal in Android Studio or in any command prompt. (thanks SimonVeloper)
Open it via the tools menu. Tools->Android->Android Device Monitor (thanks sebweisgerber)
This will open the DDMS tool and will automatically connect to connected devices.
Normally you will be able to view your logcat output through this tool and not in android studio anymore. If this doesn't work for you make sure your devices is properly connected and restart the tool.

To open the Android device monitor simultaneously with Adb, Run the montior through the command prompt instead of visting to the Tools->Android->Android device monitor
To run via the Command line interface navigate to the :
Android/Sdk/tools/ and then run the monitor (for linux run -> sudo ./monitor)

Android studio ,Android device monitor opens but you cannot display Logcat or device another functionality,Just go to your android studio tools option tick Enable ADB integration then you can open other ADM screen.This worked for me.

I faced problem in android device monitor . I could not find file explorer menu , device list in android device monitor so i
deleted hidden *.android* folder in the home directory in linux using the following command:
`$ sudo -r ./android`
After deleting this hidden folder your android device monitor will be set to default state.

Related

No connected devices found; please connect a device

I just open my flutter project in android studio but android studio cannot detect any device. I already installed two emulator from AVD manager but still I face with this error
Mostly this happens when your Android SDK path is not configured.
To do this you can do it as follow:
First of all make sure make sure you followed the installation process
Go to File -> Project Structure select Project from left tab and select <No SDK>
Then from the devices list click on one of the AVDs to run
Make sure your build gradle correctly done
Run flutter doctor to check if devices are connected
Run your project
I found that the old virtual devices created from the Kotlin projects can't be used with Flutter. You need to recreate a new one for it to appear in the toolbar drop menu like the image below

How to open Android Device Monitor in latest Android Studio 3.1

Recently I updated my android studio, after the update, I am unable to find android device monitor option in the tools section. In the previous update it was there in tools->android->android device monitor. But now in the updated version, it is not present. You can check screenshot of my android studio.
If you want to push or pull your files from devices monitor now android studio offers something better then android monitor. Just take a look at right side of your studio there is an option device file explorer. Open it and you are good to go. Select your device from top dropdown and rest of everything is pretty much the same as it was in android monitor. Below is the screen Shot attached to give you the exact location and idea.
Now you can use device file explorer instead of device monitor. Go to
view > tool windows > device file explorer
screenshot: opening device file explorer in android studio 3.1.3
More details
Click View > Tool Windows > Device File Explorer or click the Device File Explorer button in the tool window bar to open the Device File Explorer.
Select a device from the drop down list.
Interact with the device content in the file explorer window. Right-click on a file or directory to create a new file or directory, save the selected file or directory to your machine, upload, delete, or synchronize. Double-click a file to open it in Android Studio.
Android Studio saves files you open this way in a temporary directory outside of your project. If you make modifications to a file you opened using the Device File Explorer, and would like to save your changes back to the device, you must manually upload the modified version of the file to the device.
screenshot: The Device File Explorer tool window
When exploring a device's files, the following directories are particularly useful:
data/data/app_name/
Contains data files for your app stored on internal storage
sdcard/
Contains user files stored on external user storage (pictures, etc.)
Note: Not all files on a hardware device are visible in the Device
File Explorer. For example, in the data/data/ directory, entries
corresponding to apps on the device that are not debuggable cannot be
expanded in the Device File Explorer.
To start the standalone Device Monitor application, enter the following on the command line in the android-sdk/tools/ directory:
monitor
You can then link the tool to a connected device by selecting the device from the Devices pane. If you have trouble viewing panes or windows, select Window > Reset Perspective from the menu bar.
Note: Each device can be attached to only one debugger process at a time. So, for example, if you are using Android Studio to debug your app on a device, you need to disconnect the Android Studio debugger from the device before you attach a debugger process from the Android Device Monitor.
reference : https://developer.android.com/studio/profile/monitor.html
=> You Can change minSdkVersion 16 And open Device File Explorer
Device File Explorer work same as a Android Device Monitor
See Below Image:
From Android Studio 3.1 Device Monitor available from the command line only.
In Android Studio 3.1, the Device Monitor serves less of a role than
it previously did. In many cases, the functionality available through
the Device Monitor is now provided by new and improved tools.
See the Device Monitor documentation for instructions for invoking the
Device Monitor from the command line and for details of the tools
available through the Device Monitor.
To start the standalone Device Monitor application, enter the following on the command line in the android-sdk/tools/ directory:
monitor
To start the standalone Device Monitor application, enter the following on the command line in the android-sdk/tools/ directory:
monitor
But remember
Most of the Android Device Monitor componenets are deprecated after 3.0
For detail info visit this link
To get it to work I had to switch to Java 8 from Java 10 (In my system PATH variable) then go to
C:\Users\Alex\AppData\Local\Android\Sdk\tools\lib\monitor-x86_64 and run monitor.exe.
jdk max version is 1.8.0_144
then run monitor
As said in "Testing the game on your Android device", I followed these three steps
With the game still running on your device, return to your computer.
Navigate to the directory containing the Android SDK Tools.
Navigate to tools and double click the application called monitor.
This was prompting the following error
I've also tested using cmd and the same error persisted
To fix it, I had to go to AndroidSDKTools\tools\lib\monitor-x86_64 and double click in the monitor application
And then the Android Device Manager just started as normal
You still can run it from File explorer on Windows 10 with the proper path. You just need to go to C:\Users\user\AppData\Local\Android\Sdk\tools\lib\monitor-x86_64 and double click the file monitor.
If you want to use in the cmd just the 'monitor' command you have to add this folder (in my case with android studio 3.4.1 and win10) to your Environment variables. So, press the start button and then type Edit the system environment variabes click it and System properties window should open. Then go to
Environment variables => System variables => path
press the Edit button for path and add the new value
C:\Users\user\AppData\Local\Android\Sdk\tools\lib\monitor-x86_64
click 'Ok', 'Ok' and 'Ok' and restart the cmd window if you had it opened and type 'monitor' and it should open the monitor as well.
Hope it helps!
PD: This answer was based on this answer https://stackoverflow.com/a/55077068/5360905 from Tiago Martins Peres
ADM was deprecated in 3.1 version of android studio and removed from Android Studio 3.2. Android Device Monitor have been replaced by new features and to start Android Device Monitor application in android studio 3.1 and lower, following the commend line android-sdk/tools/ directory:
monitor
If you're looking for the Hierarchy Viewer tool, it has been changed to Layout Inspector:
https://developer.android.com/studio/debug/layout-inspector.html
Android Device Monitor was deprecated in Android Studio 3.1 and removed from Android Studio 3.2
Use Android Profiler introduced in Android Studio 3.0 to measure the cpu utilisation, network, memory etc,. To open Android Profiler: View -> Tool Windows -> Profiler.
Android Device Monitor has been replaced by some new feature which you can find here.
According to developer docs, it's deprecated now. Please follow these docs:
developer link
On Android Studio 3.1 and above, you can push photos to the emulator, by first starting the emulator. Then select “Device File Explorer” from the menu at the top of the screen: View/Tool Window/Device File Explorer
Then look in the folder titled “sdcard” and you will see a folder titled “Pictures”, click on it.
Then right click it and select “Upload” and navigate to the photo on your computer, to the photo you would like to push onto the emulator. The restart the emulator.
See photo below:
example of uploading a photo to emulator
Check this link out.
Open your terminal and type: Android_Sdk_Path/tools
Run ./monitor

Android Device monitor disabled

I'm just getting started with Android development and was setting up Android Studio on my mac. (Following the instructions here)
When trying to run a simple hello world application and trying to learn my way around the IDE, I noticed the "Android Device monitor" disabled. Any ideas how I can fix this? This should be important when debugging apps hence the question.
I'm not sure what other info might be important for this question. I did make a few changes in the SDK manager, but they were just installing more components on top of what was already installed.
Once you open a valid project, the buttons become enabled.
Note that, even if the option is disabled, you can still bring up the Device Monitor by running the monitor.bat file in the tools directory of the Android SDK. (On Windows you can just double click the file or run it from a cmd shell.)
This problem occurs to me today. And I just click the button on the pic.
Problem solved.
and If this didn't work ,you can check this list in your Android Studio
1.Tools->Android->Enable ADB Integration
2.If you open DDMS, CLOSE it .
If these didn't work too, check the official file.
https://developer.android.com/studio/profile/am-basics.html

android studio - emulator doesn't work and genymotion doesn't get recognized

I'm building an app in Android Studio (beta) 0.8.9, though I can't seem to get emulators running. I've made a Nexus 4 and 5 emulator through the options, but I can't seem to get them started. It shows this in the Run App tab.
Waiting for device.
"C:\Program Files (x86)\Android\android-studio\sdk\tools\emulator.exe" -avd smallEmulator -netspeed full -netdelay none
So either it's not starting up, or I'm just an impatient SOB.
I've also downloaded Genymotion and started up an emulator through that, but now Android Studio doesn't recognize the emulator anymore. I try to run my app and check for any running devices, but it doesn't show up, despite the fact that it actually is running.
I've added the Genymotion plug-in, to no avail. No idea what went wrong.
I also have a One Plus One, which I'm not sure how I can debug on that. They don't seem to have drivers for that and haven't immediatly found anything on Google so far.
Any help would be much appreciated.
EDIT: I fixed my problem. I used Genymotion to fix the problem. The running emulator wasn't turning up, because the android SDK's weren't linked to one another. Genymotion and Android Studio used different ones. So I edited Genymotion's settings to use the same one of AS and now it works!
First of all, update android studio. Check if the emulators run from the AVD manager outside Android Studio, I mean by starting it up manually from ur SDK installation folder (AVD Manager.exe) . Check the path of ur emulator in .ini file in C:>Users>user-name >.android>avd. U can make a system variable for ur SDK folder "ANDROID_SDK_HOME" and place the .android folder's content there (the whole .android folder). Sometimes "resetting the adb" after u run emulator may work.
There may be an easier fix than what was previously mentioned. Try opening Android Studio, go to File, Settings, plugins. Select the “Browse Repositories” button at the bottom of the page. Scroll down the displayed page to find “Genymotion”; select it and install it.
When it has installed, restart Android Studio. Again, go to File, Settings, then go to Other Settings. Genymotion should show up as an option. There will be a field that asks for the path to the Genymotion folder.
Mine was: C:\Program Files\Genymobile\Genymotion. At any rate, enter the path, click Apply or OK and Android Studio should recognize Genymotion (You may need to restart AS once again). Now you should have a small red icon on Android Studios tool bar; when you hover over it a pop up that identifies it as “Genymotion Device Manager”. Click on it, select a device to load, click start and allow the virtual device to start completely. Now run your Android Studio project; the Android Studio “Device Chooser” will pop up. You should see the Genymotion device you’d started previously, select it and you’re good.
Hope this helps…

'Titanium.API.INFO' is not displaying in console

I am using Windows 7.
but Ti.API.INFO not displaying in console. I changed log level also but still its not display in console can some one help how to show info..
Android device is working fine but not displaying INFO in it also.
and emulator is not launching also.
Ti.API.info('splash function run');
Maybe you can find your answer in this post
Now, my 2 cents, sometimes there is a problem running the emulator when you have your phone plugged at the same time. You could try unplugging your device first.
But perhaps, debugging with the emulator isn't what you want. I recommend to start the ddms tool. And use a query to search what you need, like one of these: tag:ti, tag:tia, tag:tiapi
In order to do that, open a terminal and go to your android sdk folder, cd tools, and run ddms command. You can find where is your android sdk folder looking into Titanium Studio -> Preferences -> Studio -> Platforms -> Android.
Edit
Another option is to run titanium commands from a terminal pointing to your project folder:
cd "path/to/your/project/folder"
# in case of using the emulator
ti build -p android
# in case of using your device
ti build -p android -T device
Android device does not show console on titanium for seeing the result on android one possible solution could be alert that results
alert('I am alert');
Thanks

Categories

Resources