Android Studio - Android Device Monitor - Empty View - android

I am trying to use the Android Device Monitor within Android Studio, but somehow I managed to remove all views.
I have tried resetting the perspectives, Window->Show View->(Any View), and even re-installing Android Studio but nothing shows up.
Does anyone know how to reset the Device Monitor back to it's default views? (With the devices on the left, and the heap/threads/allocation views on the right.)
Thanks for your help!

I've experienced this same problem by using Window -> Reset Perspective. One should expect this to fix this issue, not break it. Go figure.
In any case, the DDMS workspace preferences are stored in %USERPROFILE%\.android\monitor-workspace (e.g. C:\Users\my_user\.android\monitor-workspace).
Just delete that folder and you're good to go.

Note that you'll need to enable 'show hidden files' in the finder if you are on a mac. Then, the workspace directory is in users/your_username/.android/monitor-workspace.
See http://ianlunn.co.uk/articles/quickly-showhide-hidden-files-mac-os-x-mavericks/ for how to show hidden files.

On Windows:
Go to C:\users\my_user\.android\monitor-workspace)
Close android device monitor
Delete all files/folders inside of monitor-workspace folder
Run android device monitor again
Where "my_user" is your user folder.

That screenshot looks like you are running Windows. So, you could go to C:\Users\user3106174\ and delete the directory named .android (or something similar).

Related

Android studio database inspector does not show any databases

I am on Android studio 4.1 beta 1 . I installed my app on my device and opened Database Inspector and nothing shows up . Am I supposed to do anything else ?
I am using room database . I can see the database on device . Why is the database not showing up in database inspector?
In my case, it showed me the same process a lot of times. And none of them worked.
The solution was Invalidating the Cache:
File -> Invalidate Caches/Restart -> Invalidate and restart
After that everything started working again.
If you are using Android Studio Arctic Fox | 2020.3.1 then Database Inspector is under App Inspection. As below.
A workaround is to restart your device. Works for me
I solved this problem by uninstall and then installing app again. Formerly when I had face to this issue, I could run database inspector just by close/open app but now it start working just by uninstalling
Update
after more working with database inspector I understand some times it just needs a few seconds to connect and no need to do anything else
I face 2 cases:
First time connect to my device and database does not show, then i do an action to modify database -> database will show.
After I use ADB Idea to clean app data or uninstall (or go to settings and clear cache or uninstall app) -> database does not show -> restart device -> database will show
Looks like its problem with device . If you have some custom rom installed then you might run into this issue . Link to the issue tracker https://issuetracker.google.com/issues/159432618
Well here is what was happening with me -
Android Studio wouldn't pick up my connected device at all with the message "Error initializing adb : android debug bridge not found" when I tried to use Device File Explorer.
Turned out my project level sdk wasn't set correctly. Fixing that worked.
File -> Project Structure
In Project, select valid Project SDK
In Modules -> myapp_android -> Dependencies, select a valid Module SDK.
You should now be able to select connected devices from the database inspector. Flush your cache and restart (File -> Invalidate Caches/Restart and select "Invalidate Caches and Restart") for good measure.
In My Case, I forgot to open the database view inside the Database Inspector window as mentioned in the screenshot. Click on the database menu option as highlighted in yellow.
In my case I was using an emulator and I came to know that its mentioned and configured storage was about full.
So I just wiped all data of emulator and restarted the app inspection tab now this time I was able to view the db tables in the inspector window.
Still so many problems with this how did it make it into stable? open the database inspector close your app reopen your app, app crashes,
Start your app open the database inspector restart your app, database inspector is gone cannot be brought back without uninstalling and reinstalling your app
Great
Enable the "keep database connection open". I think its not showing because of .close(). See the image for your reference.
See image
I faced the same problem, I Open the Layout inspector and after that, I open the Database inspector, It works for me. seems like a bug of android studio
Follow these steps,
View -> Tool Windows -> App Inspection
Run the project
Then you can see the "Database Inspection"
Database Inspection in android studio arctic fox 2020.3.1 patch 3
had to restart emulator and started working again
I face this issue on many devices. Kill the app process and run again. The application should be in the foreground.
Every time I faced with this issue, I'd unplugged the usb cable, then plugged it again. Then make sure the database inspector window is open. After that, every time the database is accessed, it'd appear in the window
In my case, I had two databases in assets under the same directory and only one was showing on the inspector no mater how many times I killed and restarted the process. In the end I found that it was not showing up because I needed to store the second database file in a separate folder
structure
assets > folder > db_file.db
assets > other_folder.db > other_db_file.db
such that the folder and the database file had the same name.
Example
assets > my_database.db > my_database.db
After that, both databases showed up on the database inspector
I was emptying the cache (cache and code_cache) at each startup of my application.
When I did comment the line and stop deleting the cache, and unplug/plug back the phone, I got the database inspector showing my tables back again.
Select debug build variant.
Keep the device connected and deploy the app on the device.
Deleting app cache in simulator worked for me ;)

How To snapshot sd card memory in Android emulator?

I want to make two snapshots in Android emulator.
The first is before running an app.
The second one is after running the app.
I want to see the following changes:
New files added
Files that have been removed
changes in existing files.
I tried to search a command in adb but there isn't something concrete.
I'm searching something like the program regshot but for android.
Thanks.
Open android studio,
1.select Android device monitor from toolbar.
2.Select your emulator from left side pane.
3.For screenshot,in left side pane selection screen-capture option(camera icon).
For files, select file explorer tab from right side pane.
Select storage option --> SdCard
I hope it 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.

blank android studio "can't load settings from file workspace.xml"

When i open android studio it shows me blank screen like i don't have any projects with a yellow message at the top corner that says "can't load setting from file workspace.xml..."
After i tried to delete the workspace.xml file as suggested here and open android studio again the message didn't appear but it was still without any projects. Yesterday everything worked fine and i can still see my project data on the windows explorer. Can someone please tell me how to fix this issue.
go to your user folder
[SYSDRIVE]:\Users[your username] (ex. C:\Users\aman)
In this folder there should be a folder called .AndroidStudioBeta or .AndroidStudio (notice the period at the start - so on some OSes it would be hidden).
Delete this folder (or better yet, move it to a backup location - so you can return it if something goes wrong).
this will solve your problem.

DDMS has blank screen

when I last used the DDMS from Android Studio I tried open *.hprof file, but the whole screen changed to blank.
Now the screen is always blank. I reinstall Android Studio, Eclipse and of course SDK, but with no effect.
Can you someone tell me how to reapir it?
Thank you
I had this problem too, and I arrived at it the same way (trying to open a heap dump *.hprof file). Resetting the perspective does not work.
How I fixed it:
go into .android folder in your home directory
there should be a monitor-workspace folder; move it to a backup directory (or delete it)
restart DDMS
You should be able to reset the perspective with a right-click on the DDMS button.

Categories

Resources