I believe the issue with my emulator is it is not finding my adb, and when I try to find it by running
which adb
I get /Users/$USER/Library/Android/sdk/platform-tools/adb
The unfortunate thing is, the emulator wants a file from my finder, not just a route. When I search my finder, my $USER directory HAS no Library directory inside of it. I also checked my Macintosh/Library directory, but inside of there, there is no Android subdirectory.
Where can I find this? I have no idea where to find this, and evidently my emulator does not either
Related
I use VS2015 with Xamarin to deploy an app to my phone. After recently rooting and wiping my phone data, I'm receiving errors upon deploying. The most common issue was that the "Fast deploy" was enabled, but I already had that turned off.
I figured out that my ADB Install seems to fail (permission denied), giving me the following error:
failed to copy 'x' to '/data/local/tmp/x': Permission denied
It really starts working on my nerves, and after trying several things which I found on the internet, I ended up asking a question here.
When I go to my 'ADB Shell' (running in root mode and showing this # sign), and type 'ls -ld data data/local data/local/tmp'
it shows the following, which seems to be normal (according to things I read):
drwxrwx--x system system 2016-06-26 15:11 data
drwxr-x--x root root 2016-06-26 08:52 local
drwxrwx--x shell shell 2016-06-26 01:58 tmp
I started by recreating the 'tmp' folder, and using 'EF File Explorer' on my phone I can modify things and do everything I'd like to do. (modify rights, add folders, remove folders, recreate the folders and so on).
When I go to 'Root explorer' in EF File Explorer, I changed the '/' folder mode to 'RW', but it didn't make any change. Root explorer says it's still on "r/o" (read only) mode.
I tried the 'busybox mount -o remount, rw /system' trick and other mount-commands which did the trick for others, but still same issue with my phone.
Furthermore, I tried a "move" trick in the shell, which didn't work out either.
As a last option I even tried to do a full format/wipe, but even thát did not solve my issue.
So I'm currently back at square one, where my 'ls -ld' is still showing the same information. Copying files to the internal storage via Windows Explorer works as it should.
Hopefully I'm doing something stupid and is there a fix for this issue. Thanks in advance for your help.
I try to launch hierarchy viewer from my ~/Library/Android/sdk/tools directory, and it says
bash: hierarchyviewer: command not found.
Although I can see the hierarchyviewer tool is in the directory by typing ls.
If I type which hierarchyviewer, nothing happens. I tried other questions from StackOverflow and nothing worked. Any idea?
I assume that ~/Library/Android/sdk/tools is not in your PATH variable. Then you'll have to start it via ./hierarchyviewer from the ~/Library/Android/sdk/tools directory (or via ~/Library/Android/sdk/tools/hierarchyviewer from anywhere).
My application code is written and executed with no errors. However my emulator will not show up nor does my android device that's plugged in (virtualization is turned on, SDK packages are downloaded, Hyper V is not installed). I get this message from the ADB console:
adb is not recognized as an internal or exteral command, operable program or batch file.
I have tried editing the %PATH% in both system and user variables but it never works.
I am using the latest Android studio and all the tutorials and answers to my problem refer to Eclipse. At this point I am wondering if I should just abandon Android studio and take refuge in the larger Eclipse community.
Can anyone advise me how to fix it? I've been already trying a long time and I would like to finally see my application in action.
Your PATH is incorrectly setup.
For Windows :
Open up Command Prompt
and type
setx ANDROID_ADB_PATH "pathtoyoursdkplatformtools" /m
example:
setx ANDROID_ADB_PATH "C:\android-sdk-win\platform-tools" /m
Identify the exact location of your SDK. From command prompt cd to that folder and execute adb from there. if it still fails, your installation is corrupted. Delete all previous installtions of Android Studio and install fresh. If it works from adb folder , then you are making a mistake in setting up the path correctly.
set PATH=%PATH%;C:\Program Files\android-sdk-windows\platform-tools
this will only work for that particular session though.With respect to HAXM, always make sure the memory you allocate for a AVD is less than 650MB and check the Use Host GPU checkbox.
You've to set the adb.exe path location here.
You can find that, file>other setting>default project structure>{get your sdk file location}
Ex: C:\Users\Spectrum_Developer\AppData\Local\Android\Sdk
Open this path in file explorer and get into platform-tools. You can see adb.exe here.
Set this current path which is for ex. C:\Users\Spectrum_Developer\AppData\Local\Android\Sdk\platform-tools in your system environmental path variable
Restart the system.
Happy coding :-)
everybody,
I am facing a weird problem in mac osx. I have installed eclipse(Indigo 64 bit) on my mac machine with ADT r15. and android sdk with API level 7. everything works fine but when i create a virtual device and launch it, i always get error
PANIC: Could not open: /tmp/.android/avd/avd_2.1.ini`
The problem is that eclipse looks for avd at location /tmp/.android/avd/ but avd is actually located at /var/root/.android/avd.
Is there any workaround.
Thanks
N_JOY
In Windows you should add the environment variable, there's probably such a thing in Mac OS but i'm not really familiar with that..
check this: (number 5 is your goal)
http://fyi.oreilly.com/2009/02/setting-up-your-android-develo.html
This is just a patch but solved my problem. As eclipse is looking for avd inside tmp directory. so i have created .android/avd directory in tmp folder.
NOTE: you can't create any directory whose name starts with'.'. so you should create it from terminal.
and then copy original contents from /var/root/.android/avd to /tmp/.android/avd/
N_JOY.
I encountered the same problem but I was able to managed it though.
What I did is that I copied the contents of .android folder (from the root -- /var/root/.android) to the tmp (/tmp/.android).
Since in MAC OS you cannot create/open folder that name's start from a dot (e.g. -- .android folder), you have to do it manually using the terminal.
Even the folder is created by the AVD Manager, you will not be able to see it unless you do it manually in the terminal.
Usually what the AVD Manager does is that it creates a .android folder in the root and it doesn't care if you were able to see it. What is important to him is that he created it.
First you must create a device to the emulator then click 'Details' to make sure where it is located. Then open the .android folder in the Terminal (using the location you saw in the Details but usually it is in the /var/root/ directory).
Open Terminal, type open /var/root/.android
Second copy that directory to the tmp folder.
type cp -R var/root/.android /tmp
Restart Eclipse and Run the Device using the AVD Manager.
Now, the Device will be open.
NOTE: Since this is a temporary folder, you have to copy the contents of the .android folder in the tmp folder every time you open your MAC.
Seems this is related run the eclipse using root instead of normal user. You can also use symbol link:
ln -s /var/root/.android /tmp
I have an xml file being written by an app that is set to MODE_PRIVATE, but I now want to read that file outside of the phone, for debugging purposes. In Eclipse, I can access other files made by the app and copy them to my computer, but I can't even see this private file. Merely changing the file to MODE_WORLD_READABLE file doesn't seem to help. I think the file is being stored on an internal "SD card" that can not be removed from the phone, but there are also two other folders in the File Explorer that are either empty or inaccessible: asec and secure.
Does anyone know how the file can be accessed?
If your app is installed in debug mode, you can get your private files on a device without rooting.
Go to [android-sdk]/platform-tools folder and run adb shell.
run-as com.example.yourapp
cp -r /data/data/com.example.yourapp /sdcard/
(Where com.example.yourapp is the package name of your application.)
After executing the steps above, the private folder of your application is copied into the root of your sdcard storage, under your package name, where you have permission to download and view them.
Note 1: If you don't need to download them, then instead of step 3, you can use unix commands to navigate around and list files and folders.
Note 2: Starting from Android Studio 2.0, you'll find more files in the cache and files/instant-run folder, related to the Instant Run and the GPU Debugger features, placed there by the IDE.
You will need to connect the phone and do some magic to let your sdk work with it (I think put it in debugging mode?). Go to where you unzipped the android sdk:
C:\android-sdk_r10-windows\android-sdk-windows\platform-tools>adb shell
#cd data/data/com.yourpackage.yourapp/files
#ls
You should see your file listed. You may need to run "ls data/data" if you're not sure what the fully-qualified name of your app is. From here if the file is small and you just want to see what's inside it you can run:
#cat yourfilename.xml
Alternatively:
#exit
C:\android-sdk_r10-windows\android-sdk-windows\platform-tools>adb pull /data/data/com.yourpackage.yourapp/files/yourfile.xml
Note: I have only tried this on the emulator, I don't know how to use adb with a physical phone.
You need to root your phone to see Context.MODE_PRIVATE files
It ends up being stored in data//files I believe but you need root permission to see them
So either root your phone or wait until you finished debugging and then add Context.MODE_PRIVATE
If Eclipse is used, there is one more option:
DDMS Perspective > File Explorer tab > data/data/com.yourpackage.yourapp/files
where you can pull/push/delete files.
Another option is to have a command in the app that dumps the private files. This only works if you don't want to edit the files, but has the added bonus that you don't have to strip it out before it goes to production, because the user can't break anything with it. Well, as long as the files don't contain sensitive information. But, really, if they do, you're doing something wrong. As #user1778055 said, a user can root their phone to access it.