- How to fix “Android Studio doesn’t see device” in Android Studio?
- How To Solve “Android Studio doesn’t see device”
- Method 1
- Method 2
- Method 3
- Method 4
- Device File Explorer missing in Android Studio [duplicate]
- 2 Answers 2
- android sdk missing system-images
- Device File Explorer option missing in Flutter Android Studio
- 10 Answers 10
- How do I check if an app is a non-system app in Android?
- 14 Answers 14
How to fix “Android Studio doesn’t see device” in Android Studio?
In Android Studio, sometimes the list of devices and emulators doesn’t list your physical device when you try to plug it in. Or you may have faces a situation when you plugged the phone in for the first time, no dialog appeared asking if you trust the computer. But the laptop is already allowed to connect to the mobile device. However, the button Run does not allow to deploy the app to the connected device because it thinks that there is no connected device. So you may get confused about what’s wrong with the device. Before doing anything, just check the following configuration. Configuring Your System to Detect Your Android Device
- Install the USB driver for your Android device.
- Enable USB debugging on your Android device.
- If necessary, install the Android development tools (JDK/SDK/NDK).
- Add your Android SDK to the RAD Studio SDK Manager.
- Connect your Android device to your development system using the USB cable provided with your device.
Even if you have done everything that is mentioned above, if you get this error “Android Studio doesn’t see device”, then you are on the right page. This article is for such programmers. In this article, there are five methods listed below to solve this issue.
How To Solve “Android Studio doesn’t see device”
Method 1
To change what your application defaults to when you click to run or debug in Android Studio, follow these steps:
Step 1: Go to the Run (on the left corner) then click on Edit Configurations.
Or you can just click here to find the “edit configurations” tab :
Step 2: Select the project. Find the Target Device section under the General tab on the Android Application page.
That seems to be where you toggle what the project builds too. If you’re importing a project it actually defaults to Emulator, not sure why. You can also select “Open Select Deployment Target Dialog” to list both connected as well as emulated devices.
Method 2
If Android Studio doesn’t even detect your device using ‘ADB devices’. then try to switch to PTP instead of MTP on your device. To do so, just click on “File transfer via USB touch for more options” in the notification area of the device.
and then choose the PTP option.
Then you will get a popup on your device regarding access. Just try restarting Android Studio to show up there as well though.
Method 3
On your device:
Go to settings/ developer settings / allow USB debug mode
If you might have the device currently connected to your PC, then ‘allow USB debug mode’ option is disabled. Just disconnect the device and the option should now be available. If you are using Android 4.2 and newer, the Developer options are hidden by default. To make it available, go to Settings > About phone and tap Build number seven times.
Return to the previous screen to find Developer options.
Method 4
You may need to restart ADB, from the terminal. To do so just type the below commands:
- adb kill-server
- adb start-server
or from ddms(If you are using Android Studio version My Personal Notes arrow_drop_up
Источник
Device File Explorer missing in Android Studio [duplicate]
I’m a beginner developer and I use flutter, I wanted to download databases inside my app in the emulator within Android Studio. But no matter where I search, I can’t find the Device File Explorer in the android studio, the only thing I find about it is in settings and it’s a completely blank page (there is only the path where to download things).
2 Answers 2
For Normal Android Development, it’s easy. Just go to
But in Flutter Development, it’s a little bit tricky.
First you have to Configure your Android Development with Flutter to see the Device Manager option.
Steps: Click on the bottom right option where it says Event Log and then Press Configure Now Done!
No go to the same path again which was
and here you can see the Device Manager is visible now.
You can just use your real device to test and It will be better.
- Just connect your mobile with usb to your computer.
- turn on USB debugging in developer mode.
- you will see a dialog box in mobile just allow and you are ready to use it.
Hope it will be helpful I suggest it coz once when I was trying my app in emulator it was working fine but when I have tested it on real device many things were not working and I have to start my project from scratch. So I suggest to test on real device and in addition you will easily get file explorer and more.
Источник
android sdk missing system-images
I’m trying to setup multiple target on a CI server (CentOS 64_x86) for automated Android app testing, which would run multiple emulator heedlessly. After extracting the latest SDK from http://dl.google.com/android/adt/adt-bundle-linux-x86_64-20130729.zip and run, android update sdk —no-ui I suppose I should have installed all existing component properly, but 2 problems found,
After selected «ARM EABI v7a System Image, Android API 18» and agreed «android-sdk-license-bcbbd656», it seems installed properly but next time I update sdk it shows up again and always installable. Note that I installed them through command line where no window UI available, not sure if any difference here.. (however the emulator for API 18 is working. )
Looking at the folder $SDK_PATH/system-images, only «android-18/armeabi-v7a» available, but compared to my another SDK installation on macbook, this same folder contains much richer content including whatever api available, not only API 18.
I guess this difference above caused my 3rd issue (for example on API 15 which don’t have a «system-images/android-18/armeabi-v7a»), when I run lator from an AVD like,
emulator -no-window -port 5554 -snapshot default -avd google_api_15
comparing to a normal output this should be
emulator: skin network speed: ‘full’ emulator: skin network delay: ‘none’ emulator: autoconfig: -kernel /home/bamboo_master/environment/adt/sdk/add-ons/addon-google_tv_addon-google-12/images/x86//kernel-qemu emulator: autoconfig: -ramdisk /home/bamboo_master/environment/adt/sdk/add-ons/addon-google_tv_addon-google-12/images/x86//ramdisk.img emulator: Using initial system image: /home/bamboo_master/environment/adt/sdk/add-ons/addon-google_tv_addon-google-12/images/x86//system.img emulator: autoconfig: -data /home/bamboo_master/.android/avd/google_api_15.avd/userdata-qemu.img emulator: autoconfig: -initdata /home/bamboo_master/.android/avd/google_api_15.avd/userdata.img emulator: autoconfig: -cache /home/bamboo_master/.android/avd/google_api_15.avd/cache.img emulator: autoconfig: -snapstorage /home/bamboo_master/.android/avd/google_api_15.avd/snapshots.img emulator: Physical RAM size: 1024MB
If my understanding is right that it’s due to system-image missing, is there a way to install them? Thanks.
Источник
Device File Explorer option missing in Flutter Android Studio
I want to view the database files in my adb device but the option of device file explorer is missing in android studio when flutter project is opened. But the same is visible when i open android module or simply an android project.I want to view the device files in flutter project itself
10 Answers 10
Open Flutter project and check the Event Log if Android framework is detected. If so, click Configure and you’re done.
- Click tab Modules on the left sidebar.
- Click your project and click the plus icon.
- Add Android in the Framework
I’m experiencing the same problem, and I haven’t found a real solution for it.
The least inconvenient workaround I’ve found is to create a new «blank» Android project, and then simply using «File -> Open Recent >» and open it in a new Android Studio window whenever I need to use the Device File Explorer.
You can still keep the Flutter project open in the existing Android Studio window and switch between them.
My solution. It is necessary to put android virtual device into root mode. For example сommand for windows 10 . First run you virtual device.
Then use previus solution — Open or create a new android native project , after Device File Explorer it will appear in View-> Tool Windows
The below steps works for me
Go to file>Project Structure>module inside module click on add icon and select Android and click OK
This will add the Device file explorer in android studio
I followed the advice at the top of this conversation (Add Android to File>Project Structure>Module). When I tried to start the Device File Explorer I also got the error message «Error initializing ADB: Android Debug Bridge not found»
I went back into File>Project Structure>Project and saw that Android SDK was missing. I do not know why it was not added when I created the Flutter 2.5 project with Web, Windows and Mobile targets. I added an SDK that matched my emulator (28, Pie). That added the ADB and the Device File Explorer. I admit that I am not sure this is the best answer, but it appears to work.
This fixes the problem for me:
- Open File -> Project Structure
- In Project, select valid Project SDK
- In Modules -> my_app-> Dependencies -> select a valid Module SDK.
Just found out the easier way to do that all stuffs. You can open the .idea/modules.xml folder in your root project folder. it will looks like something like this
add this module below the existing module
then it will look like this
If Device File Explorer option is not visible at the bottom right, Open AVD Manager
Make sure that the AVD is running, then press the Folder icon for your AVD:
Device File Explorer should be visible now:
It always shows error: Error initializing ADB: Android Debug Bridge not found when selecting Device File Explorer in flutter project here, so I have to open android module to access emulator files:
Step 1. Create a dummy android.iml file under android folder
Step 2. Click Open for Editing in Android Studio to open android module in another windows
Step 3. Start emulator from AVD manager
Step 4. Click on emulator tab, make sure the emulator appears here
Step 5. Click on Device File Explorer tab to access emulator files
Источник
How do I check if an app is a non-system app in Android?
I am getting a list of ApplicationInfo Objects with packageManager.getInstalledApplications(0) and attempting to categorize them by whether or not they are a system application.
For a while I have been using the technique described here, however after seeing that in my application, some of the apps were not in the non-system apps list (such as Facebook, which when available asks the system to install itself on the SD card). After next reading the actual documentation for ApplicationInfo.FLAG_SYSTEM, and understanding that it doesn’t actually filter system apps, I am now looking for a new approach.
My guess is that there is a large gap between UIDs of System and non-system apps that I can gather to make this distinction, but as of yet I have not found an answer. I also looked into other flags, such as ApplicationInfo.FLAG_EXTERNAL_STORAGE , however I am supporting API 1.5.
Does anyone have a real solution to this (not involving FLAG_SYSTEM )?
14 Answers 14
I was under the impression that all apps in the system image are system apps (and normally installed in /system/app ).
If FLAG_SYSTEM is only set to system applications, this will work even for apps in external storage:
An alternative is to use the pm command-line program in your phone.
You can check the signature of application which it signed with system. Like below
There is a little bit of misunderstanding here. For Android the notion of a «system app» is one that is install on the system image, it says nothing about what developer it came from. So, if an OEM decides to preload Facebook on to the system image, it is a system app and will continue to be so, regardless of where updates to the app get installed. They won’t get installed on the system image, for sure, because it is read-only.
So ApplicationInfo.FLAG_SYSTEM is correct, but that doesn’t seem to be the question you are asking. I think you’re asking if a package is signed with the system certificate. Which is not necessarily a good indicator of anything, this may vary from device to device and some surprising components on vanilla Android are not signed with the system certificate, even though you might expect them to be.
In newer versions of Android there is a new path, /system/priv-app/ that attempts to be the install location for «real» system apps. Apps that are just pre-loaded on the system image then end up in /system/app/. See AOSP Privileged vs System app
There are 2 type of Non — system applications :
- Apps downloaded from Google Play Store
- Preloaded apps by device manufacturer
This code will return a list of all above applications:
Well, it’s a sloppy solution in my opinion (what if /data/app isn’t the apps directory on all devices?), but after a thorough search, this is what I have come up with:
If an Application is a non-system application it must have a launch Intent by which it can be launched. If the launch intent is null then its a system App.
Example of System Apps: «com.android.browser.provider», «com.google.android.voicesearch».
For the above apps you will get NULL when you query for launch Intent.
This is a simplified and more efficient version of other responses listed here. It is more efficient if you just iterate directly over the ApplicationInfos.
Here are different possible ways to see if the app is a system app by its package name (used some of the codes in this post)
If having an APK file and want to check is it System app or User installed a Simple logic:- System app Files are not writable
So I’d like to put here an utility class I made with the knowledge of this thread and a few others. But before I continue, an explanation of some terms, if I got them all right, copied from that class, which are used on it.
Below KitKat 4.4, all apps in /system/app were given privileged permissions. Even the Calculator app had them. That could be a security breach. So they were separated between ordinary and privileged system apps and ordinary ones don’t have privileged permissions above KitKat 4.4. So these utilities have that in mind. They also have in mind the following designations:
- Platform-signed app: any app that is signed with the platform/system key (so they have system signature permissions), whether it is installed on the system partitions or not.
- System app: any app that is installed on the system partitions.
- Updated system app: any system app that was updated (meaning now it is also installed on /data/app).
- Privileged system app: below KitKat 4.4, any app installed on /system/app; from KitKat 4.4 onwards, only the apps installed on /system/priv-app (I really mean only /system). These apps have privileged permissions.
- Ordinary system app: only as of KitKat 4.4, those without privileged permissions, even though they’re still system apps. Below KitKat 4.4, they’re non-existent.
System partition notes: until Oreo 8.1, there was only one: /system. As of Pie (9), there is also /vendor and /product.
So with that in mind, here are 2 functions:
To check if an app is a privileged system app or is ordinary system app, and/or is signed with the platform/system key, I’ll leave 3 functions below. I believe it’s off-topic to the question, but I’ll put it in case anyone like me needed it.
If you want, you can join this last one to the ones above, but I don’t really recommend it. It will only work work as long as the system app hasn’t been updated.
Источник