Adb root doesn't return anything on android emulator? - android-emulator

I'm using an Android Emulator to develop app on Visual Studio 2019. I want to access files created by my app. I use the File Explorer on Android Device Monitor, but it shows I have no permission to access the 'user' folder. So I try to change the permission by using adb command, adb root, but it returned nothing.
Device's information
File and folder permission
The results
As you see, I need to check the files in user folder, but adb root seems do nothing without error.

After I updated the Command-line tools from 1.0 to 2.1, it showed the error, adbd cannot run as root in production builds after ran adb root.
Refer to ADB root is not working on emulator (cannot run as root in production builds), I created another device using the setting below. And finally adb root worked. I still don't understand the reason. I suppose the Google Play Store has some kind of protection mechanism?

Related

Not able to run Flutter doctor on macos

I installed flutter 3.0.5 on two macbooks, both macbooks are intel chip.
On one MacBook flutter is running fine.
On the second macbook, I am able to run flutter channel
But when I am running flutter doctor, I am getting this error
The flutter tool cannot access the file or directory.
Please ensure that the SDK and/or project is installed in a location that has read/write permissions for the current user.
#0 throwToolExit (package:flutter_tools/src/base/common.dart:10:3
Changing the channel to beta or master also didn't help
chown the .config folder didn't help
chmod the .config folder didn't help
This error happens by either downloading the SDK and extracting it into the desktop or documents or download folder of my user. And also happens if I just install the flutter SDK using brew
Please Check The Below Permission
The flutter tool cannot access the file or directory.
Please ensure that the SDK and/or project is installed in a location that has
read/write permissions for the current user.
Read the documentation for proper installation then try again-👇
https://docs.flutter.dev/get-started/install/macos
You can do following thing.
As per your query seems to be permission issue where the flutter sdk located.
sudo chown -R <your_username> /flutter_sdk_path/
Don't forget to replace your username[the name by which you are logged in in Mackbook] and flutter the SDK path.
Once its done then close terminal and open again and run flutter doctor command.
Note : updating permission may need restart of system soemtimes.
Redownload the flutter and put it inside your user's directory or just cut that flutter SDK and paste it inside the Users/{yourUserName}/Desktop or Documents folder and map that path to the env variable and also in android studio. Make sure that android studio has enough permissions inside the MAC.
First run flutter cmd like ( use your flutter file path)
export PATH=$HOME/bin:/Users/flutter/bin:$PATH
after run this cmd
Flutter doctor

Flutter - completely uninstall app from emulator

Is there any way to completely uninstall an app from the Android emulator?
I want to get rid of the database file that my app uses. I have tried
flutter clean
but when I go to the Device File Explorer in the emulator, the files are still there in the app folder, and I can see the db file in the databases folder.
I am using Visual Studio Code.
Figured out, I have to run :
adb uninstall <package>

Nativescript project running with Visual Studio Emulator

I have a Nativescript application that I'm developing using VS Code and have no issues when I try to run it using the Nativescript launch configurations from the Nativescript extension, when I'm using a real device connected with USB or when I use one of the android-sdk emulators.
Now I need to run Hyper-V on the machine too and those emulators cannot run when hypervisor is on. So I downloaded and installed Visual Studio Android Emulator which runs fine when I launch it manually.
Problem is that the nativescript project doesn't recognize this device either with tns device or adb devices commands and if I try to launch the application from VS Code it tries to launch one of the other emulators, which obviously fails due to the hypervisor/Intel Haax incompatibility.
Did any of you had this problem before and have any solutions you can share?
Thanks.
Microsoft MSDN say :
If the emulator is running, but it does not appear to be connected to ADB or it does not appear in Android tools that make use of ADB (for example, Android Studio or Eclipse), you may need to adjust where the emulator looks for ADB.
The emulator uses a registry key to identify the base location of your Android SDK, and looks for the \platform-tools\adb.exe file under that directory.
Here We Go!! Step By Step ;)
Copy Your ANDROID SDK PATH for me it look like this :
To modify the Android SDK path used by the emulator:
Open Registry Editor by selecting Run from the Start buttons context menu, typing regedit in the dialog box, and choosing OK.
Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Android SDK Tools in the folder tree on the left.
Note : if Android SDK Tools folder doesn't exist, Create it under WOW6432Node, And open it, And Create a String Value name it Path:)
Modify the Path registry variable to match the path to your Android SDK.
Restart the emulator and you should now be able to see the emulator connected to ADB and associated Android tools.
Now! Open Your Terminal (CMD), and Run ADB command
adb devices -l
YES YES !! The Visual Studio Emulator is running, and connected to ADB!
HERE WE GOO !!
Now We Want To Create A Demo App (for example FIRSTZAKI) ZAKI is my nickname :p
On Terminal (CMD) :
tns create FIRSTZAKI
Choose Android Platform
cd FIRSTZAKI\
tns platform add android
Check if VS EMULATOR is ready!
tns devices
YES YES ^^
Finally Step (RUN/BUILD) :
tns run android
WOW ... Great :)
AND .. Good Luck ♥ — ZAKI

AVD Failed to Load ~ Failed to Parse Properties ~ Mac OSX

I'm going to say upfront, please forgive me. I'm a newbie to android development and fairly new to programming. Also on a Mac. You're going to have to talk...real...slow.
I can't get an AVD to load. I've tried it from Eclipse (Juno) and from the Android SDK Manager (20.0.3). Failed multiple times.
Received the same error each time,
"Failed to parse properties from User/myname/.android/avd/nameIGaveEmulator/config.ini."
EDIT: I tried to solve the path problem on my own by checking folders and moving them around to be in the same folder, then resetting the path in Eclipse preferences, but that didn't work, so I trashed everything except for the zip files, uncompressed and started the entire installation all over again. When I opened up SDK Manager and attempted to download tools and platforms, however, I received the following. I'd forgotten that I received it on the first install. Would this have something to do with the problem?
Preparing to install archives
Downloading Android SDK Platform-tools, revision 14
Installing Android SDK Platform-tools, revision 14
Stopping ADB server failed (code -1).
Installed Android SDK Platform-tools, revision 14
Stopping ADB server succeeded.
Starting ADB server failed (code 255).
Done. 1 package installed.
Sidenotes:
When I open Eclipse and SDK Manager, I don't see anyplace to check that I'm the administrator.
If a path needs to be "changed" what exactly does that mean and how do I go about doing so? Is it simply a matter of moving folders and files into the "correct" locations and then trying to load an AVD again?
Using command line, navigate to the /tools folder in your android SDK, then use the command:
$ ./android avd
This will launch the AVD manager.

How to deploy the android application to emulator like Application Deployment of WP7

I have developed the Hello World Android application using Eclipse. I can run the application in the android emulator through this eclipse. But i want to run the apk files using Android emulator without opening the Eclipse(like WP7 xap files are running through Application Deployment Software without opening the VisualStudio). How to do this?
I have used the following procedure.
Procedure to run the apk files in Android Emulator without opening the Eclipse:
Check your installed directory(ex: C:\Program Files (x86)\Android\android-sdk\tools), whether it has the adb.exe or not).
If not present in this folder, then download the attachment here, extract the zip files. You will get adb files, copy and paste those three files inside tools folder
Run AVD manager from C:\Program Files (x86)\Android\android-sdk and start the Android Emulator.
Copy and paste the apk file inside the C:\Program Files (x86)\Android\android-sdk\tools
Go to Start -> Run -> cmd
Type cd “C:\Program Files (x86)\Android\android-sdk\tools”
Type adb install example.apk
After getting success command
Go to Application icon in Android emulator, we can see the your application
Thank you.