Android Emulator doesn't find AVDs - G1 Android Development

Hi!
I just wanted to play around with the Android SDK and write some "Hello, world!" applications, because I think the world needs more of those ;-)
But I have a problem with the emulator: it doesn't find my AVDs. I get a correct list of the avds by using
Code:
android list avd
but when running the avd with the emulator
Code:
emulator @myavd
I get the error message:
Code:
emulator: ERROR: unknown virtual device name: 'myavd'
emulator: could not find virtual device named 'myavd'
.
I'm using Windows 7 RC1 32bit.
Anyone any idea how to fix this?
Bye
Christian

I've seen similar problems from time to time. I found it best to create AVDs from within Eclipse when possible (don't forget to set up an emulated SD card of *more* than 8MB at the same time associated with each AVD).

Christian S. said:
Hi!
I just wanted to play around with the Android SDK and write some "Hello, world!" applications, because I think the world needs more of those ;-)
But I have a problem with the emulator: it doesn't find my AVDs. I get a correct list of the avds by using
Code:
android list avd
but when running the avd with the emulator
Code:
emulator @myavd
I get the error message:
Code:
emulator: ERROR: unknown virtual device name: 'myavd'
emulator: could not find virtual device named 'myavd'
.
I'm using Windows 7 RC1 32bit.
Anyone any idea how to fix this?
Bye
Christian
Click to expand...
Click to collapse
Use this instead
Code:
emulator -avd myavd

Hi!
Thank you for the answers!
I found the problem:
The "android" tool created the AVDs in the directory "d:\.android\", the emulator expects them in "c:\users\<username>\.android\".
I created an NTFS junction as workaround and it works now
Bye
Christian

I am having this same problem but with vista please help...
I am getting the following error
[2009-08-11 22:18:33 - Emulator] emulator: ERROR: unknown virtual device name: 'my_avd'
[2009-08-11 22:18:33 - Emulator] emulator: could not find virtual device named 'my_avd'
and I am not sure why. I am very new to eclipse, but want to get started with android development. How would I tell ecipse to look in the correct directory to find the AVD?
I look forward to hearing back.
Cheers
DG

The "android" tool created the AVDs in the directory "d:\.android\", the emulator expects them in "c:\users\<username>\.android\".
I created an NTFS junction as workaround and it works now
Click to expand...
Click to collapse
That was exactly my problem, I've moved my "HOME" directory on another disk, and I can't launch emulator.
But now, with your NTFS junction method, it's OK !!

Hey there guys you've probably already sorted this but after you create your avd just cd to the tools folder of the sdk and type
emulator -avd (your name)
the avd will be created in the same directory as your sdk for example i type
cd C:/sdk/android/tools
emulator -avd Sheilds1.5 -sdcard C:/sdcard.img
Hope this helps
Shields
also link here to explain all
http://developer.android.com/guide/developing/tools/avd.html

On Vista, android creates the avd folder under C:\Users\<username>\.android . It does this even if you are logged into a domain account (i.e. it doesn't create a C:\Users\<domain>.<username>\.android folder. This will cause the "unknown virtual device" error also. Copy the .android folder to C:\Users\<domain>.<username> and you will be good to go.

Nice one, Christian. The ntfs juction/mklink did the trick for me

Christian S. said:
Hi!
Thank you for the answers!
I found the problem:
The "android" tool created the AVDs in the directory "d:\.android\", the emulator expects them in "c:\users\<username>\.android\".
I created an NTFS junction as workaround and it works now
Bye
Christian
Click to expand...
Click to collapse
ok thanks very much! , it solves my problem
bye
Guillaume

What NTFS function???
alexadvance said:
That was exactly my problem, I've moved my "HOME" directory on another disk, and I can't launch emulator.
But now, with your NTFS junction method, it's OK !!
Click to expand...
Click to collapse
What NTFS function are you speaking of???!!!!?!?!?

If you have moved your home folder from c:\users\myUser to D:\myUser for example, you need to open a command line (cmd.exe) and do the following :
1. cd c:\users\myUser
2. mklink /j .android d:\myUser\.android
so that android will think files are in c:\users\myUser\.Android
Hope it will help you.

sybux said:
If you have moved your home folder from c:\users\myUser to D:\myUser for example, you need to open a command line (cmd.exe) and do the following :
1. cd c:\users\myUser
2. mklink /j .android d:\myUser\.android
so that android will think files are in c:\users\myUser\.Android
Hope it will help you.
Click to expand...
Click to collapse
Thanks a lot, I also met this problem, and this method really worked.

that's not even "c:\users\<username>\.android\" ... it's one directory up relative to My documents folder, that's where they're created. christian has probably moved his "my documents" folder to D:, that's why he has the d:\.android folder ... but that's the java problem, ... it has property UserDir which points to c:\users\<username> but differs from what some other elements evaluate user home path.

Environment Var > Link
Maybe I'm being stubborn, but I'm not a big fan of the symlinks or junction points or whatever.
via Yahoo! Answers and another random blog
You can override the behavior of both by declaring an environment
variable called ANDROID_SDK_HOME
Make it point to your HOME folder ( EX : C:\Documents and Settings\Phoenix\
) and both the emulator and the java based tools will read
and write into the same folder.

Pugz3D said:
Maybe I'm being stubborn, but I'm not a big fan of the symlinks or junction points or whatever.
via Yahoo! Answers and another random blog
You can override the behavior of both by declaring an environment
variable called ANDROID_SDK_HOME
Make it point to your HOME folder ( EX : C:\Documents and Settings\Phoenix\
) and both the emulator and the java based tools will read
and write into the same folder.
Click to expand...
Click to collapse
TY for the Advice!

For me, making a junction from my homedir to c:\users\{username} didn't work, but setting the ANDROID_SDK_HOME to my actual home dir did.

I've raised this so SDK guys were aware:
code.google.com/p/android/issues/detail?id=13008

Christian S. said:
Hi!
Thank you for the answers!
I found the problem:
The "android" tool created the AVDs in the directory "d:\.android\", the emulator expects them in "c:\users\<username>\.android\".
I created an NTFS junction as workaround and it works now
Bye
Christian
Click to expand...
Click to collapse
Tienes razón, esta sí es la solución al problema:
1. copias la carpeta .android dentro del directorio del usuario c:\users\<usermane>\
2. Vuelves a correr el emulador, y listo. Funciona perfecto.
Chao,
pedrozopayares

Another solution
I've run into a similar problem with the same error output and here is a short description of the malady and the cure:
If you run tools/android and install with sudo (don't know why I did that anyway ), it gives the same error while trying to run the emulator. So, don't. Just use your regular user privileges.

Related

Android SDK 1.5 trouble in Linux

I am a new to using Linux, I just downloaded the SDK 1.5 and I am having some trouble getting the tools to work properly. For example. If I try to open the emulator it will just sit there and do nothing. I cannot get adb to work either. I set it up / the instructions. Any ideas on what I am missing? Thanks
easiest way to fix the adb problem is to move your adb command that is included in the SDK into your /usr/bin or /bin directory. if you have a problem with either of those then type cd ~/<sdk>/tools followed by ./adb the "./" tells the phone to run the command in the current directory, otherwise you could just type the directory to adb to run it i.e. ~/SDK/tools/adb that's all you need. as far as the emulator i have no idea because i have never gotten it up and running properly
How do I add the ADB command to usr/bin?
You can do as followed:
- Run the Terminal
- cd to your sdk/tools directory
- Run these command:
Code:
#./adb kill-server
#./adb devices
If you see your HTC has been remounted, it's done!
sudo mv ~/sdk/tools/adb /usr/bin/adb
tubaking182 said:
sudo mv ~/sdk/tools/adb /usr/bin/adb
Click to expand...
Click to collapse
Got it thanks for your help! I still can't get the emulator to work. Oh well Thanks again
What version of Linux? Are you using 64 Bit? What is the result of typing
Code:
java -version
You created the AVD, right?
What do you get when you type:
Code:
android list avd
stovenator said:
What version of Linux? Are you using 64 Bit? What is the result of typing
Code:
java -version
Ubuntu version 9.04 & 64 Bit
java version "1.6.0_13"
Java(TM) SE Runtime Environment (build 1.6.0_13-b03)
Java HotSpot(TM) Client VM (build 11.3-b02, mixed mode, sharing)
You created the AVD, right?
What do you get when you type:
Code:
android list avd
Click to expand...
Click to collapse
bash: android: command not found
They made a change in 1.5 SDK that you must specifiy the virtual device you want the emulator to run. if you just double click on "emulator", it will print the error to console and exit.
So first cd to the tools directory of the sdk and type android[return]
you will be given the commands that android (the program) will accept. you can also do this for emulator.
Great!! Everything is working well now. Thanks for everyones help!!
How Do I get fastboot working in Ubuntu?
jordanjf86 said:
How Do I get fastboot working in Ubuntu?
Click to expand...
Click to collapse
http://andblogs.net/fastboot/
fastboot is included in the 1.5 sdk, once you get adb working it should start working as well.
billc.cn said:
fastboot is included in the 1.5 sdk, once you get adb working it should start working as well.
Click to expand...
Click to collapse
Actually it doesn't seem to be in the Linux 1.5 SDK; I had to build it. It's in the Windows SDK, though. Kinda weird.
Android SDK 1.5 emulator trouble in windows
hi i m new to xda and to android i m not tech savy
i install sdk 1.5 i try ddms it works good what when i try to lanch emulator nothing happnes and i try by going in command promt im getting this error can any one help me out in this
C:\Documents and Settings\jass>emulator
emulator: ERROR: You did not provide the name of an Android Virtual Device
with the '-avd <name>' option. Read -help-avd for more information.
If you *really* want to *NOT* run an AVD, consider using '-data <file>'
to specify a data partition image file (I hope you know what you're doing).
karan09 said:
hi i m new to xda and to android i m not tech savy
i install sdk 1.5 i try ddms it works good what when i try to lanch emulator nothing happnes and i try by going in command promt im getting this error can any one help me out in this
C:\Documents and Settings\jass>emulator
emulator: ERROR: You did not provide the name of an Android Virtual Device
with the '-avd <name>' option. Read -help-avd for more information.
If you *really* want to *NOT* run an AVD, consider using '-data <file>'
to specify a data partition image file (I hope you know what you're doing).
Click to expand...
Click to collapse
First, this is the wrong thread for such a question. This thread is about SDK issues in Linux, and you're asking about using debugging tools in Windows.
Second, if you say yourself that you are "not tech savvy", then I'm not quite sure why you are wanting to play with the SDK tools. I don't mean this in a derogatory way; I'm just not sure what it is that you're trying to accomplish.
That said, Android dev docs can be found here, and information specifically about the emulator is here.
- Chris

[HOW-TO]Set up Android SDK/ADB/Fastboot on Ubuntu Linux

When I first attempted to install the SDK, I found tutorials that only had bits and pieces about the whole procedure. A lot of Google searches and hours of eye strain. I wanted to write a solid tutorial, but instead of publishing it in a personal blog, I chose to publish it here on xda-developers. This is the definite forum to come to if you are interested in Android/G1/HTC Dream development or costumization. I wrote this to make the enlarge the knowledge of this community.
!! THIS TUTORIAL IS FOR THE LATEST UBUNTU RELEASE: JAUNTY JACKALOPE 9.04 !!
!!START -------------------------------------- Optional Preparation --------------------------------------
This applies if you -
Are interested in installing Ubuntu for the first time.
Are/will be reinstalling Ubuntu from scratch.
Want to keep your SDK installation easy to reach.
Want to keep things nice and clean.
And your machine -
Has a second hard drive.
Has free space for another small partition.
This procedure will make things easier during installation of the SDK and in the long run. Hopefully you've read about partitions. If you are dualbooting, please read this first to get an idea of what you're doing.
While installing Ubuntu and on the Prepare Disk Space screen (partition editor), select "Specify partitions manually (Advanced)"
On the Create Partition dialog, select the following options:
Type for the new partition: Primaryor Logical if you're dualbooting and know what you are doing.​
New partition size in megabytes: 5120MB (5GB) might work. BUT:
ccyrowski said:
It should be noted that if you ever plan on compiling kernels and/or cupcake ROM's you will NEED ubuntu8.04. You'll also need at least 10GB.
Click to expand...
Click to collapse
Location for the new partition: Beginning
Use as: Ext4 or Ext3Filesystem doesn't matter. (?)​
Mount point: /AndroidSDKEnter this manually​
Complete Ubuntu installation as usual.
-------------------------------------- Optional Preparation -------------------------------------- END!!​
You will now install the SDK.​
!!START -------------------------------------- Installing Android SDK --------------------------------------
Installing the SDK is the easiest of all.
Download the SDK.169.9 MB [http://developer.android.com/sdk/download.html?v=android-sdk-linux_x86-1.5_r3.zip]​
Right-click and select Extract Here.
Move the contents of the android-sdk-linux_x86-1.5_r3 directory to your desired location.If you followed Optional Installation, move the contents to your /AndroidSDK directory in the root of your filesystem.​
Close directory window.
-------------------------------------- Installing Android SDK -------------------------------------- END!!​
You will now set up your bashrc file and UDEV to recognize your HTC Device.​
!!START -------------------------------------- ADB + FASTBOOT --------------------------------------
The Android Debug Bridge (adb) is one of the tools that will help you the most when you run into flashing problems or running shell commands directly from your machine. UDEV will not recognize your G1 out of the box, but we will configure it with some rules so it can connect.
We will work with /AndroidSDK as the location of your sdk. If this is not your setup, I think you're smart enough to figure it out.
Editing .bashrc file to use tools from /AndroidSDK/tools/ directory -
Go to your home folder.Example: /home/wddglr/​
Press Control + H to view hidden files.
Look for your .bashrc file and double click to open it with gedit.
Add the following lines to the top of the file:
Code:
#AndroidDev PATH
export PATH=${PATH}:/AndroidSDK/tools
IMPORTANT NOTE
savethechicken said:
This is the way that I have my .bashrc file setup. For those having problems with it not recognizing the adb as a command try this...
Code:
export PATH=$PATH:/AndroidSDK/tools
I removed the {} around ${PATH} and it is working if I had them on it would say that it didn't recognize the command. Removed them and all works well.
Click to expand...
Click to collapse
Setting up UDEV to recognize HTC Device -
Type the following into a terminal (Applications > Accessories > Terminal):
Code:
gksudo gedit /etc/udev/rules.d/51-android.rules
Now add the following line to the blank file:
Code:
SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
Click save and close.
To restart udev, open up a terminal and enter:
Code:
sudo /etc/init.d/udev restart
Setting up fastboot -
Download this fastboot binary from http://android-dls.com.130.4 KB [http://android-dls.com/files/linux/fastboot]​
Once downloaded to your desktop, right click and select Properties.
Navigate to the Permissions tab and configure the following option:Execute: [√] Allow executing file as program​
Click Close.
Move the fastboot bianary to your /AndroidSDK/tools/ directory.
Reboot.
-------------------------------------- ADB + FASTBOOT -------------------------------------- END!!​Now you can use adb and fastboot directly from any terminal. If you chose to do the Optional Preparation, you can now save your Eclipse Workspace and your downloaded/custom ROMs/Themes in this new /AndroidSDK directory keeping things easier to reach and safe from evil disk errors or other mishaps!!! :O​If you are having problems, send me a PM. I will be happy to help.
*applaudes* awesome. Should be added to helpful threads.
very nice! perhaps add a "(How-To)" prefix to thread??
Everything was going great in setting this up until I got to this part "gedit /etc/udev/rules.d/51-android.rules"
I cannot find "51-android.rules" inside of "rules.d"
Any thoughts>?
nicholasbithell said:
Everything was going great in setting this up until I got to this part "gedit /etc/udev/rules.d/51-android.rules"
I cannot find "51-android.rules" inside of "rules.d"
Any thoughts>?
Click to expand...
Click to collapse
it does not exist, you will make it.
do the command as stated above.
Code:
gksu gedit /etc/udev/rules.d/51-android.rules
Damn you beat me to it!
I was just thinking earlier about doing this same "How-To" guide, I was surprise to see it posted just now.
Anyways, great job!
Can someone sticky this thread. Now I have ADB & fastboot on my Win7, Ubuntu, and OS X Partition. Thank you wddglr.
bravo...linux rocks even better now!...
Awesome tutorial for setting this up. Have been using adb/sdk on ubuntu since oct. but this would have saved me some headaches back in the first couple of weeks.
The onlything that is not clear and/or confuses me is
Setting up the udev to recognize the device.
SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
Have never used this (will now to see if it will do anything) and the only problem i have is that sometimes i have to kill-server to get it to connect correctly but i have seen this happen to almost everyone on many forums since the 9.04 came out. And even after putting this file on the computer i have had the problem.
savethechicken said:
Awesome tutorial for setting this up. Have been using adb/sdk on ubuntu since oct. but this would have saved me some headaches back in the first couple of weeks.
The onlything that is not clear and/or confuses me is
Setting up the udev to recognize the device.
SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
Have never used this (will now to see if it will do anything) and the only problem i have is that sometimes i have to kill-server to get it to connect correctly but i have seen this happen to almost everyone on many forums since the 9.04 came out. And even after putting this file on the computer i have had the problem.
Click to expand...
Click to collapse
It happens to me also from time to time. especially when i reboot and want to go into adb while the device is rebooting. although that file, 51-adndroid.rules, is what helped me get adb to recognize the device. the guide on developer.android.com talked about 50-android.rules but after a few deep searches i found this: http://groups.google.com/group/android-developers/browse_thread/thread/1d3488c601243686
Okay A few questions for you....
First I fixed the whole "couldnt find the (51-android.rules) file now I am having issues with executing ADB!
When in terminal this is what I get...
"[email protected]:/home/nick# /AndroidSDK/tools/adb
bash: /AndroidSDK/tools/adb: cannot execute binary file
[email protected]:/home/nick#"
and I also noticed something different from when I start terminal the first lines now state
"bash: : command not found
[email protected]:~$"
I dont remember the first line ever being there, but I could be mistaken!
Any help would be greatly appreciated!
Edit: You state creating "Mount point: /AndroidSDK" During Installation, and what I did was Just place my AndroidSDK at root so it is at "/AndroidSDK". I dont know if this makes a difference.
I am actually running ubuntu 8.10 ha! I just tried to update But I keep getting errors! is there anything I can change to get this to work on ubuntu 8.10?
nicholasbithell said:
First I fixed the whole "couldnt find the (51-android.rules) file now I am having issues with executing ADB!
When in terminal this is what I get...
"[email protected]:/home/nick# /AndroidSDK/tools/adb
bash: /AndroidSDK/tools/adb: cannot execute binary file
[email protected]:/home/nick#"
and I also noticed something different from when I start terminal the first lines now state
"bash: : command not found
[email protected]:~$"
Edit: You state creating "Mount point: /AndroidSDK" During Installation, and what I did was Just place my AndroidSDK at root so it is at "/AndroidSDK". I dont know if this makes a difference.
I am actually running ubuntu 8.10 ha! I just tried to update But I keep getting errors! is there anything I can change to get this to work on ubuntu 8.10?
Click to expand...
Click to collapse
okay, a few things -
seems like your .bashrc file isn't setup right (?)
make sure that the two lines you inserted into it are on separate line
Code:
#AndroidDev PATH
export PATH=${PATH}:/AndroidSDK/tools
because maybe export PATH=${PATH}:/AndroidSDK/tools got commented on accident if you copy pasted.
When copying your SDK to the root of your filesystem, did you copy it as your own user or as root? you can use:
Code:
gksu nautilus
to copy system files with complete root privileges.
What exactly are you trying to update, Ubuntu or ... ? There shouldn't be a difference to get this working on 8.10, the only thing that seemed to change was the 51-android.rules file. Maybe this can help -
renaming it to 50-android.rules with
Code:
gksu nautilus
and deleting any backups (use CTRL+H to view hidden files).
restarting udev using:
Code:
sudo /etc/init.d/udev restart
Remember this is for 9.04, not 8.10. I hope this helps.
wddglr said:
okay, a few things -
seems like your .bashrc file isn't setup right (?)
make sure that the two lines you inserted into it are on separate line
Code:
#AndroidDev PATH
export PATH=${PATH}:/AndroidSDK/tools
because maybe export PATH=${PATH}:/AndroidSDK/tools got commented on accident if you copy pasted.
When copying your SDK to the root of your filesystem, did you copy it as your own user or as root? you can use:
Code:
gksu nautilus
to copy system files with complete root privileges.
What exactly are you trying to update, Ubuntu or ... ? There shouldn't be a difference to get this working on 8.10, the only thing that seemed to change was the 51-android.rules file. Maybe this can help -
renaming it to 50-android.rules with
Code:
gksu nautilus
and deleting any backups (use CTRL+H to view hidden files).
restarting udev using:
Code:
sudo /etc/init.d/udev restart
Remember this is for 8.10, not 9.04. I hope this helps.
Click to expand...
Click to collapse
Okay this is how I moved my "AndroidSDK" Folder to root....
[email protected]:~$ su
Password:
[email protected]:/home/nick# mv /home/nick/Desktop/AndroidSDK /
[email protected]:/home/nick#"
And I went to the bashrc file and it is entered in there correctly.
This is still what I get even after restarting Udev...
" bash: : command not found
[email protected]:~$ adb
bash: /AndroidSDK/tools/adb: cannot execute binary file
[email protected]:~$ su
Password:
[email protected]:/home/nick# adb
bash: adb: command not found"
Edit: This is what my .bashrc file looks like, well the top part of it anyways....
#AndroidDev PATH
export PATH=${PATH}:/AndroidSDK/tools
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
Okay your .bashrc is setup right and it's recognizing adb and its directory.
I would say it's something to do with permissions. since you moved it under su, you are not the owner so i would say that you'd have to change the permissions of /AndroidSDK
you can do that with -
Code:
gksu nautilus
Navigate to /
Right click on /AndroidSDK and select Properties
Click on Permissions tab
Select your user account as the owner
hopefully now it will function correctly
wddglr said:
Okay your .bashrc is setup right and it's recognizing adb and its directory.
I would say it's something to do with permissions. since you moved it under su, you are not the owner so i would say that you'd have to change the permissions of /AndroidSDK
you can do that with -
Code:
gksu nautilus
Navigate to /
Right click on /AndroidSDK and select Properties
Click on Permissions tab
Select your user account as the owner
hopefully now it will function correctly
Click to expand...
Click to collapse
I dont understand what this line does...
"gksu nautilus"
when i type it in it asks me for my administrative password and then after i put it in it hangs for a sec and then back to...
bash: : command not found
[email protected]:~$ gksu nautilus
[email protected]:~$
nautilus is the file browser, while using gksu nautilus you can use the file browser under root privileges
wddglr said:
nautilus is the file browser, while using gksu nautilus you can use the file browser under root privileges
Click to expand...
Click to collapse
I dont have Nautilus as a file browser I have Thunar I believe.
Then gksu thunar
wddglr said:
nautilus is the file browser, while using gksu nautilus you can use the file browser under root privileges
Click to expand...
Click to collapse
For permissions it says that I am the owner and the group (I=Nick) for Others it says Read and Write, Access says Read and write. So it seems it has all the right permissions. Any other Ideas?
Partitioning HD
First off, thank you for this thread, it's most excellent. I have a question that is slightly off topic, but not so much. I have Ubuntu 9.04 installed on my recovery partition. This partition is only 10 GB, while I have Vista on my main. I have almost 100 GB free on my main drive, and what I want to know is, if I resized my partitions to give more space to Ubuntu, how would it affect my comp? (if at all). And which OS should I be on while resizing, Ubuntu or Vista?

[Q] Android ADK and 64 bt ubuntu - please help

Ok, so I've a newly installed 64bit ubuntu, and I've just downloaded the android SDK.
I managed to run the "android command the first time round whereby I successfully downloaded android versions 2.3+
I was very clever and did this through the terminal, by going in to my android SDK directory, and then tools (for me cd /android/tools)
and then I typed android, and the gui came up..... all good.
I then decided I needed to add this directory to my path, I did some jiggery pokery here, not too much, but I cant say exactly what I did, but now, when I try to run the android command, from the correct directory all I get is the following:
Code:
[email protected]:~/android/tools$ dir
adb_has_moved.txt dmtracedump hprof-conv NOTICE.txt zipalign
android draw9patch layoutopt proguard
ant emulator lib source.properties
apkbuilder etc1tool mksdcard sqlite3
ddms hierarchyviewer monkeyrunner traceview
[email protected]:~/android/tools$ android
android: command not found
I know this must be down to some kind of path error, but i'm lost as to how to correct it. I've googled all over, but every explanation seems geared towards someone with more linux knowledge than mine. Please may someone explain really simply how I fix this? thanks

SSHFS on Android - Extend Android features with Debian KIT

HI,
I would like to share the way how I mounted my NAS folders with SSHFS based on Debian KIT.
SSH-FS is ssh based mountable file system. If you have SSH account you can mount and access that server like a windows share.
Forewords:
Debian KIT is free! and it is _NOT_ yet another chroot debian!
This method is an alternative and FREE way to have SSHFS vs to the unique native Android SSHFS app (which is unfortunately paid. )
It is fully integrated with Androitd! Less ram resources and faster than chroot. Debian libraries are binded to Android.
So you enjoy Android and Debian advantages all together.
Steps to have SSHFS:
Set up Debian on your Android! Go to Debian Kit page and set up Debian!
Run Debian. Open Terminal Emulator and type
Code:
$deb
$sudo su
Set up SSHFS
Code:
#apt-get update
#apt-get install sshfs
Mount SSHFS
Code:
#mkdir /mnt/nas
#sshfs [email protected]:/ /mnt/nas/ -o allow_other
Checking mount:
Code:
#mount
[email protected]:/ on /mnt/nas type fuse.sshfs (rw,nosuid,nodev,relatime,user_id=0,group_id=0,allow_other,max_read=65536)
Then SSHFS will ask your root password and that all!
If no error then its ok, You Mounted!!
You done! :laugh:
Go back to Android and use your mounted share with any Android file manager under /mnt/nas (or where ever you mounted.)
Finishing all, just
Code:
#deb u
(It will umount and close debian session.)
For more comfort, set up password-less login to ssh server with authorized_keys.
#ssh-keygen
#cat ~/.ssh/id_rsa.pub >> /mnt/nas/root/.ssh/authorized_keys
#chmod 600 /mnt/nas/root/.ssh/authorized_keys
After above steps your ssh server wont ask root password from this site to that site logging in with root user.
Press "Thanks" button if its helps for you.
Regards
Robert
Convert docs to pdf with Openoffice within Debian Kit
Another great usage example of Debian kit:
Use your installed Open/Libre/Star/Office to convert your document to pdf:
#!/bin/bash
time soffice --headless --convert-to pdf $1
exit
Check your doc converted to pdf after a minute.
Thanks for the awesome guide. Any idea about mounting virtual drives from my Ubuntu?
whu007 said:
Thanks for the awesome guide. Any idea about mounting virtual drives from my Ubuntu?
Click to expand...
Click to collapse
Hi,
thanks.
>mounting virtual drive...
Can you please describe a little, what is the scenario?
Regards Robert
SSHFS problems @ Android 4.2.2 Nexus 10 - apps cannot see mounted content
Hi,
Robert, thanks for the guide to sshfs with debian-kit. I've been longing to get sshfs on my Android for three years
My problem is that Android Apps cannot see the mounted content, which is what I desire.
I have managed to get debian-kit + sshfs installed, and my nas mounted using sshfs. I can browse the files on the nas from the mounted directory in the ConnectBot Shell, but I cannot see the mounted directory through android apps (or adb shell), eg TotalCommander, OI FileManager, MX video player. I have tried the TotalCommander Android app, and tried telling TotalCommander to always use root (in case user made a difference).
I mounted the nas using ConnectBot local shell with the command:
> sshfs [email protected]:/mnt/user/ /mnt/tower/ -o allow_other
I can see the /mnt/tower content both with the ConnectBot shell as normal user ([email protected]), as root, and with the shell I get after running 'deb' from a ConnectBot shell.
If I remote login from PC to an SSHDroid server on the Android, then I cannot see the mounted content of /mnt/tower (even as root). Neither can Android apps. If I install the openssh-server in debian and stop the SSHDroid server, then I can see the /mnt/tower content from my ssh login from PC.
Best Alex
I've an issue, after mounting the nas folder I try to add it into the Poweramp library, it recognizes it (I've mounted into /sdcard/nas) but none of the mp3 is added to library
thank you
Thanks for the great guide!
Now how can you unmount the SSHFS directory?
The normal way is with:
Code:
fusermount -u /mnt/share
However this causes an error:
Code:
fusermount: failed to bind parent to /: Invalid argument
Does that happen for everyone or is it just me?
Restarting the Debian system with
Code:
deb -u
also did not cause the SSHFS directory to unmount.
Sent from my Nexus 4 using xda app-developers app
Hi
Just try umount /mnt/mountpoint.
Robert
Sent from my GT-N8013 using xda app-developers app
Thank you for this guide! Unfortunately this solution isn't quite what I'm looking for. I found that in order to get my apps to recognize the mounted share I have to first run the app, then mount the share. Also, if the app gets killed I have to unmount the share and then remount it in order for the share to become visible again from within the android app. However, the share remains mounted when viewed from within the debian shell or adb.
Anyone have an idea why this might be happening?
Debian kit not working on S4
Hey, there. I have a rooted Samsung Galaxy S4 (VZW) running stock.
I get this error after all MD5 sums pass:
ash: id: Permission denied
Can someone please assist me or point me in the right direction?
aikeru said:
Hey, there. I have a rooted Samsung Galaxy S4 (VZW) running stock.
I get this error after all MD5 sums pass:
ash: id: Permission denied
Can someone please assist me or point me in the right direction?
Click to expand...
Click to collapse
did you get this right after you started installing? after you used the 'sh' command?
Sounds to me like you might not have root in android, or you didn't click the accept button when the app asked for root permissions.
---------- Post added at 10:46 AM ---------- Previous post was at 10:44 AM ----------
m2xtreme said:
Thank you for this guide! Unfortunately this solution isn't quite what I'm looking for. I found that in order to get my apps to recognize the mounted share I have to first run the app, then mount the share. Also, if the app gets killed I have to unmount the share and then remount it in order for the share to become visible again from within the android app. However, the share remains mounted when viewed from within the debian shell or adb.
Anyone have an idea why this might be happening?
Click to expand...
Click to collapse
I don't think there is much you can do to get around always having to have deb environment open. One way you might be able to kill a few steps is use the 'autofs' package in debian to automatically mount the sshfs share when you login to the debian envorinment.
I haven't tried autofs yet, but it's on my todo list, i'll report back with my findings.
---------- Post added at 11:19 AM ---------- Previous post was at 10:46 AM ----------
chrisonline1991 said:
I haven't tried autofs yet, but it's on my todo list, i'll report back with my findings.
Click to expand...
Click to collapse
So i had some problems running autofs and i can't seem to find the problem, maybe someone more knowledgeable can help. When i install autofs the output is below, but it looks like it did install fine.
Code:
Starting automount: Error: failed to load autofs4 module.
invoke-rc.d: initscript autofs, action "start" failed.
dpkg: error processing autofs5 (--configure):
subprocess installed post-installation script returned error exit status 1
configured to not write apport reports
Errors were encountered while processing:
nfs-common
autofs5
E: Sub-process /usr/bin/dpkg returned an error code (1)
When i run
Code:
$ sudo dpkg --configure -a
it returns
Code:
Setting up nfs-common (1:1.2.2-4squeeze2) ...
insserv: warning: script '99CleanTWEAKS' missing LSB tags and overrides
Starting NFS common utilities: statd failed!
invoke-rc.d: initscript nfs-common, action "start" failed.
dpkg: error processing nfs-common (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up autofs5 (5.0.4-3.2) ...
insserv: warning: script '99CleanTWEAKS' missing LSB tags and overrides
Starting automount: Error: failed to load autofs4 module.
invoke-rc.d: initscript autofs, action "start" failed.
dpkg: error processing autofs5 (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
nfs-common
autofs5
I found this bug report which points to this bug report that says something about the newest autofs using a new upstart feature called 'wait-for-state' and something is going wrong with it. Looks like they added the bugfix to Ubuntu Precise. And looks like that fix might now have solved the problem as another bug was opened, but i'm not sure if it's related to this. I'm a little burnt out on this at the moment.
Hope this helps someone. If anyone else has some suggestions let me know and i'll try them out.
Hi
I have been trying to get something like this working for awhile...
Any chance by using debian kit this can automatically run at startup and mount my PC to my Android device?
my android apps just see an empty dir. In my terminal the sshfs command works as expected. When I cd into the mounted directory I can see its contents, android apps just see an empty dir.
Has any one managed to solve this?
late-2017 update
bisbal said:
my android apps just see an empty dir. In my terminal the sshfs command works as expected. When I cd into the mounted directory I can see its contents, android apps just see an empty dir.
Has any one managed to solve this?
Click to expand...
Click to collapse
I ran into a thread on stack exchange that says to mount the sshfs-accessed shares to subdirectories of /data/media/0/. I've yet to try it myself, but it sounds plausible.
(https://android.stackexchange[dot]com/questions/50246/mount-inside-subdir-of-storage-emulated-0)
I was initially reluctant to raise an old topic, but I think this is important; being able to mount a remote data store to your local filesystem is crucial to the mobile environment as the tendency of well-known phone companies like Samsung and Apple in removing the external sd card feature (even my OnePlus 3 doesn't have it). I did consider the Nextbit Robin as my next phone for the smart data storage design, but opted out because of the aging hardware.

[Q] cannot run MyFirstApp on windows 7 with adb and AVD

It seems it is not an easy thing to start android development. I followed the official instruction and tried to run the MyFirstApp example from developer.android.com on my Windows 7 64bit machine with AVD. But after 2 days effort, I am still cannot make it work for me in Eclipse and in adb command line.
The best I reached in command line approach is the following -- the second block with italic words shows the error I got:
Code:
E:\Workspace\MyFirstApp>ls bin
AndroidManifest.xml build.prop
AndroidManifest.xml.d classes
MyFirstApp-debug-unaligned.apk classes.dex
MyFirstApp-debug-unaligned.apk.d classes.dex.d
MyFirstApp-debug.apk dexedLibs
MyFirstApp.ap_ proguard.txt
MyFirstApp.ap_.d res
[I][B]E:\Workspace\MyFirstApp>adb install bin\MyFirstApp-debug.apk
failed to copy 'bin\MyFirstApp-debug.apk' to '/data/local/tmp/MyFirstApp-debug.a
pk': No such file or directory
rm failed for /data/local/tmp/MyFirstApp-debug.apk, No such file or directory[/B][/I]
I hope somebody can help me about these:
1. I am in Windows with AVD, why adb want to find /data/local/tmp, which is linux style location?
2. where does the adb try to copy the apk file to? My SDK is installed under "C:\Users\myname\AppData\Local\Android\android-sdk". There is no space in the address path. The source apk file is ready and should not be the cause of that error, I think.
3. Any configuration of the installed SDK needs to be modified in Windows machine? I think the SDK manager should be able to figure out what the machine is and download/install appropriate components for the user. Is that right?
I have similar or the same issue by using Eclipse.
thanks,

Categories

Resources