Android Studio 3 (All Versions) - Device file explorer nothing to show - file

When opening the Device file explorer window in Android Studio Preview 3, I don't see the device's files (There is a message "Nothing to show").
I searched this topic a lot but couldn't find anything that is relevant to this issue.
I'm using my test device:
Android Galaxy S5 running Android OS 6 (API 23) - Rooted
The specific build of Android Studio I'm using is:
Android Studio 3.0 Beta 6
Build #AI-171.4333198, built on September 13, 2017
JRE: 1.8.0_152-release-915-b01 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0
Any idea's how to solve this issue?

After struggling with this for a day, the answer for me was associated with disabling SuperUser permissions for the ADB shell on my Android Device.
If you have rooted your device and are using an app like SuperSU, try disabling the SU permission for ADB shell in the apps view list.
First disconnect your Android device from the computer running Android Studio
On your Android device open SuperSU and select the apps tab.
Click on ADB shell and select Access:'deny'
Reconnect your device to your dev computer using a USB cable
In Android Studio open the "Device File Explorer".
You should now see a list of files on the device, including files in /data/data/ and its subfolders
You would think that having SU permissions would be a good thing: but in this case, no.
Disable ADB shell's SU permissions in SuperSU

AS file explorer will execute su 0 sh -c 'ls -l /' to list the files. For unknown reason, SuperSu remove the single quotes and the actual command are su 0 sh -c ls -l /. In such case, the -l will not work. AS file explorer may have some problem to parse the output. So there is nothing to show.
You can check the log of AS to get such behavior. Open the log from: help -> show log in explorer

Related

ADB Connection to Samsung smart tv

I am trying to install third party apk to Samsung android smart tv...
1) I've turn on Developer mode in Apps and put my computer ip address there.
2) I'm runing this commands in terminal (mac os, the latest version of sdk-tools)
adb kill-server && adb start-server && adb connect 192.168.1.237:26101 && adb devices
Getting this:
* daemon not running; starting now at tcp:5037
* daemon started successfully
connected to 192.168.1.237:26101
List of devices attached
192.168.1.237:26101 device
3) And run:
adb install ./my.apk**
And got this:
Performing Push Install
adb: error: connect failed: closed
- waiting for device -
p.s. almost every command failed with error: closed
(i've tried adb shell, adb logcat, and so on...)
What next step to try ? Is port 26101 correct? (I've also tried port 5555, but get Connection refused
Sorry but I haven't seen any Samsung Smart TV running Android. Samsung has their own operating system (Tizen) but, as far I know you can't install apk apps, also you cannot install apps using adb (in Tizen is named SDB), instead of SDB you need to use the Tizen SDK + Tizen Studio to pair your PC, sign your app (.wgt extension) and install it using the SDB

Daydream View Controller Emulator won't work with Google VR SDK 1.1 and Unity 5.6 beta for Linux

I can't get the controller emulator to work with Google VR SDK 1.1 & Unity 5.6b3 under Arch Linux 64-bit. If I load the GVRDemo scene in Unit and click the play button to enter Play Mode, the console shows the following:
"Android Debug Bridge (adb) command not found.
Verify that the Android SDK is installed and that the directory containing adb is included in your PATH environment variable."
In Windows, you have to add the directory containing the Android Debug Bridge (adb) program to the PATH environment variable in Windows itself (not in the Unity program). Once you do that, the Controller Emulator works fine in Windows. You have to do the same in Linux, evidently, to get Unity to locate adb, and therefore get the Controller Emulator phone working for testing the game.
I've added the following line in my .bashrc and .profile files in my home directory:
"PATH=/home/jesse/Android/Sdk/platform-tools/:$PATH"
This, however, doesn't fix the issue.
I've also added the root directory of the Android SDK to my Unity Preferences > External Tools section.
I don't know how to get Unity and Google VR SDK to recognize the directory containing adb to the PATH environment variable that Unity needs to make the Controller Emulator work.
Is anyone else having this issue? Is there a fix or work-around?
I was able to locate the culprit and modify Google VR SDK scripts to make it work! Turns out there was an issue in the code of the script file titled "EmulatorClientSocket.cs" regarding non-Windows machines. Here's what I changed, and why:
Originally, in line 111 and 112 of this script, it read:
stringprocessFilename="bash";
stringprocessArguments = string.Format(" -l -c \"{0}\"", adbCommand);
The context is that when Windows is not present (forgive my layman's terms -- I've only started learning coding a month ago) the command to process is this: bash -l -c "adb forward tcp:7003 tcp:7003". The problem is when the -l option is used in the command, the command is interpreted as if coming from a login shell, which - I believe - means that bash isn't looking at the custom environment variables set in the user's .bashrc and .profile files in their home directory. Without looking at those files, bash can't locate the adb command (try running the bold command above in a terminal, and the result will be a prompt saying adb command not found).
To fix it, I simply removed the -l option from line 112, and, voila! Everything works like a charm! Lines 111 and 112 now look like this:
stringprocessFilename="bash";
stringprocessArguments = string.Format(" -c \"{0}\"", adbCommand);
The fix will work when running "unity-editor" or "unity-editor-beta" from the Terminal or Xterm, but running it from the application menu will still produce the adb error and Controller Emulator will not work.

Adb was accidentally removed. How to restore it on Mac?

I have installed Android Studio 2.2 on my mac. While playing with "ln" command, i removed "adb" through incorrect arguments usage.
How can i restore the "adb"?
If i try to install SDK tools, it tries to stop adb, which can't be found.
Download platform-tools_rXX...zip for your operations system ad extract ad
https://stackoverflow.com/tags/adb/info

Error: ENOENT: no such file or directory, scandir '/Documents/android-sdk-linux/build-tools' at Error (native)

I am new to Appium and I am running a selenium script with device connected and while running in terminal i am getting this error:
“Error: ENOENT: no such file or directory, scandir ‘/Documents/android-sdk-linux/build-tools’ at Error (native)”
I am running in Linux. Can you please help me out ?
You need to paste this two lines in .bashrc file
export ANDROID_HOME=/home/rijomon/Documents/android-sdk-linux/sdk
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
then you will not get that error
This error is caused when Appium can not find a valid path to the Android SDK in the ANDROID_HOME environment variable
...or when the SDK installation is corrupt.
Rijo Mon's answer is correct for his system but the ANDROID_HOME path will need to be changed to point to the actual location of your installed SDK.
Install Android Studio if you aren't already using it.
Make sure only one version of Android SDK is installed in Android studio, and make sure Android Studio does not display any errors or warnings about the SDK installation.
Go to Android Studio Preferences → Appearance and Behavior → System Settings → Android SDK
Uninstall all installed Android SDK versions here by unchecking
their boxes and clicking Apply
Uninstall any other copies of the Android SDK on your system
In Android Stduio, check only one SDK version and install it by clicking Apply.
Close and re-open Android Studio (you may want to reboot your machine)
Go back into the Android SDK window in Preferences → Appearance and Behavior → System Settings → Android SDK
Confirm that Android Studio does not display any warnings about the installed Android SDK.
Make sure the ANDROID_HOME environment variable is in your bash_profile and that it points to the location of your installed SDK. For an SDK installation managed by Android Studio on OSX, this should be ~/Library/Android/sdk
The output of "ls -l ~/Library/Android/sdk" or the ls for your correct path to your SDK should now show a directory listing with the installed SDK files and folders including "build-tools" and "emulator"
Add the following line to ~/.bash_profile (OSX) or ~/.bashrc (Linux)
export ANDROID_HOME="${HOME}/Library/Android/sdk" (replace the path with your actual SDK path)
Restart your terminal or source the modified bash profile with "source ~/.bash_profile" or "source ~/.bashrc"

Need assistance with adb shell, on non rooted device

I'm confuse with adb shell device login, I'm not able to go in root mode (# mode). I can only access $ mode from adb shell on any non rooted devices such as, Samsung galaxy Note, Galaxy 2 and Samsung galaxy Apollo (2.1), and as well not able to use "su -" command to be super user, and therefore restricted to directories such as /data/data/com.myapp.exmple.
But with root device can get root access with adb shell, and access them so my basic doubt is with non rooted devices can we get the root access with adb shell?
If not, I'm using Andrew Hoog's book "Synergy Android Forensics" which demonstrates adb shell can give you access to root (#mode) on non rooted devices, as well there are few examples on internet and forum which states so. take this video for example.
http://www.youtube.com/watch?v=tVJ7T2oC_Zs
Which is basically demonstrating how to unlock the security pattern lock with adb shell, which gets the root access (# mode) on non rooted device.
And if yes, what is the mistake I'm making? I install the latest JDK, then Android sdk in C:, then from c:android-sdk/platform-tools/ directory tried to access the adb shell.
I am running Cyanogenmod with Android 4.1.2 so this probably does not apply to stock roms. When I enter
adb root
the console returns
root access is disabled by system setting - enable in settings -> development options
in that menu you can disable root access, grant it for apps only, adb only and apps and adb. Select apps and adb and everything should work as expected.
AFAIK adb root or su- wont work on non-rooted android mobiles.
You can Google on how to root your specific model, but beware that you may loose company warranty if you force root your phone.
There is a command for getting root access on Android:
adb root
I don't know if it works on any version of Android. The above command restarts the adb as root.
Tap your device version build number (at the bottom of the info page) 7 times for android 4.2. This will enable the developer's menu.

Resources