Halo All,
I'm developing a mobile website and I want to see how it looks in Android Simulator.
I manage to edit my android's /etc/hosts file. Here's what I did:
1. Create an Android Virtual Device (AVD)
2. Open the AVD with this command
Code:
./emulator -avd android -partition-size 128
3. Execute the following commands
Code:
./adb remount
4. Get the android hosts file
Code:
./adb pull /etc/hosts
5. Add my mobile website into the android's hosts file. It looks like the following
Code:
127.0.0.1 localhost
172.19.14.46 m.myweb.localhost
6. Push the hosts file to the simulator
Code:
./adb push hosts /etc/hosts
7. Open the web mobile in the simulator and Host do not found. The web mobile should appear.
Did I miss something here?
Btw I use Ubuntu 10.10 and android-sdk_r08-linux_86 API 7 (Android SDK 2.1)
It's been 2 days and no reply. I wonder whether the question is confusing to understand or it cannot be replicated.
FYI, m.myweb.localhost is a virtual host running in my local machine.
found a solution for this problem?
spending the whole ****ing day with it -.-
yes, you can change name it?
This is a development thread. Do not post "good job", or "great idea", or "cool, i'm trying this now".. I want feedback.
Introduction
This is a precursor to a possible way of running a custom kernel and ROM on the Nook Tablet in a chroot environment. I've been working on an Android app and almost have a usable installer for my AndBuntu project. If we are sucessful, this installer can be converted to a Un-Nook-er app "AndNook" which may be used to install custom kernels and ROMs with additional work.
So, with that said, lets get to it.
You will need:
This is all the software you will need to run this script. If you don't have a Debian Linux based computer, you can dual boot, install Ubuntu within Windows, or run it from a memory stick.
A rooted Nook Tablet
Android Market installed on the Nook Tablet
Busybox Installed on the Nook Tablet
A Terminal Emulator installed on the Nook Tablet
A VNC viewer Installed on the Nook Tablet
A Linux computer, dual boot or run from a memory stick
Getting started
The basic process will go like this.. Generate an image in Ubuntu, put that on your /sdcard/Ubuntu folder and then execute a script
On the Linux computer execute the following code block
Code:
cd ~/Desktop
sudo apt-get install rootstock
sudo rootstock --dist maverick --seed lxde,tightvncserver,openoffice.org,gimp,ssh --fqdn localhost --login ubuntu --password ubuntu --imagesize 3800M --notarball --fullname "Ubuntu for Android" --kbmodel pc104 --locale en_US.UTF-8 --serial ttyS0 --doswap --swapsize 256M
This will take a while, and it will generate a image file with a bunch of charactors like ***************.img.
rename this file "ubuntu.img" without the quotes
create a folder on the Nook Tablet called "/sdcard/ubuntu". (that's internal storage folder "/ubuntu/")
copy the "ubuntu.img" file to the folder
copy THIS SCRIPT to your sdcard/ubuntu/ folder and name it "uboot".
launch the terminal emulator and execute the following code block
Code:
su
sh /sdcard/ubuntu/uboot
Paste the output of that command here. If it failed stop. If it worked, keep going
in the Ubuntu environment execute the following code block
Code:
/firstRun
tightvncserver
tightvncserver may ask you for a password
Launch your VNC Viewer app
Specify 127.0.0.1 as the connection address. Use your password which you selected in previous code block.
Please note, the script is designed for a Samsung Android device. There is a line in the SH script
Code:
export UbuntuLoopFS=/sdcard/ubuntu/ubuntu.img
This line may require modification.
I'm looking for feedback. If you cannot understand what's going on, please don't post. This is not user friendly.
I take no responsibility or liability for anything which may happen to your device. This may force your device into a boot loop 8 times and your device will be factory restored. If it does, please let me know and I will make changes accordingly.
I am interested in trying this but
How much data will need to be downloaded, I currently only have "borrowed" WiFi and cell phone
And does this give you a fully usable ubuntu with desktop and ability to install linux apps
thanks for info
little8020 said:
I am interested in trying this but
How much data will need to be downloaded, I currently only have "borrowed" WiFi and cell phone
And does this give you a fully usable ubuntu with desktop and ability to install linux apps
thanks for info
Click to expand...
Click to collapse
about 2-400 megs
Not sure if it makes a difference, but the NT mounts the sdcard at /mnt/sdcard
Any way, though, I have a Linux Mint (based on Ubuntu) distro installed through VirtualBox, and I'll throw together an Ubuntu installation as well right now. I'm more than willing to help out.
(misinterpreted the meaning of 'feedback'. Apologies.)
EDIT 2: Turning this into a useful post. Hopefully this is the kind of bull**** you want. If not, I'll try again!
Tried the image build on a system running Oneiric. Receive segfaults when attempting to add CA certs to java.
Code:
Setting up ca-certificates-java (20100412) ...
creating /etc/ssl/certs/java/cacerts...
qemu: uncaught target signal 11 (Segmentation fault) - core dumped
/var/lib/dpkg/info/ca-certificates-java.postinst: line 40: 16110 Segmentation fault LANG=C LC_ALL=C keytool -importcert -trustcacerts -keystore $KEYSTORE -noprompt -storepass "$storepass" -alias "$alias" -file "$cacertdir/$pem" > $log 2>&1
/var/lib/dpkg/info/ca-certificates-java.postinst: line 40: 16113 Segmentation fault LANG=C LC_ALL=C keytool -importcert
trustcacerts -keystore $KEYSTORE -providerClass sun.security.pkcs11.SunPKCS11 -providerArg '${java.home}/lib/security/nss.cfg' -noprompt -storepass "$storepass" -alias "$alias" -file "$cacertdir/$pem" > $log 2>&1
error adding brasil.gov.br/brasil.gov.br.crt
Many segfaults follow. One for each cert it tried to install. Image build abends shortly after with an error code 1 in sub-process /usr/bin/dpkg.
At first I thought this might be due to my use of OpenJDK. I removed OpenJDK, installed Sun/Oracle JDK and experienced same. This may be Oneiric-specific. For giggles I'm trying oneiric as the dist in a follow-up build on this machine, and also moving to a second Ubuntu box that's running Maverick for another try at the original instructions. Will edit this post with future updates.
AdamOutler said:
[*]On the Linux computer execute the following code block
Code:
cd ~/Desktop
sudo apt-get install rootstock
sudo rootstock --dist maverick --seed lxde,tightvncserver,openoffice.org,gimp,ssh, -fqdn localhost --login ubuntu --password ubuntu --imagesize 3800M --notarball --fullname "Ubuntu for Android" --kbmodel pc104 --locale en_US.UTF-8 --serial ttyS0 --doswap --swapsize 256M
This will take a while, and it will generate a image file with a bunch of charactors like ***************.img.
Click to expand...
Click to collapse
Arg, I let this go for ~an hour on my netbook and got a long way through the process before I got:
Code:
/usr/bin/stat: cannot read file system information for `/home/UserUser': No such file or directory
Segmentation fault
Can this be done on a 64-bit installation of ubuntu? I have that on the more powerful desktop downstairs.
You know that this is already in the market... Ubuntu install guide. An image of 10.10 for Arm is linked in the app along with the script to start it. I have it installed and running. Only issue I have is that the resolution is lower than Blaze as the image is designed for phones.
Sent from my BNTV250 using xda premium
liquidzoo said:
Not sure if it makes a difference, but the NT mounts the sdcard at /mnt/sdcard
Any way, though, I have a Linux Mint (based on Ubuntu) distro installed through VirtualBox, and I'll throw together an Ubuntu installation as well right now. I'm more than willing to help out.
Click to expand...
Click to collapse
mint will work.
LouZiffer said:
Personally I'd like the option of a slimmed down version that doesn't include the overhead of X/VNC, though I can understand the advantages of a GUI from a usability standpoint. That's a simple matter of generating an image without those options, but you might want to consider it if you're offering pre-generated images or scripts for download at some point.
Sent from my HTC Evo Design 4G using XDA Premium
Click to expand...
Click to collapse
This is the kind of bull**** I don't want in this thread. Congratulations on wasting a post.
jeph36 said:
Arg, I let this go for ~an hour on my netbook and got a long way through the process before I got:
Code:
/usr/bin/stat: cannot read file system information for `/home/UserUser': No such file or directory
Segmentation fault
Can this be done on a 64-bit installation of ubuntu? I have that on the more powerful desktop downstairs.
Click to expand...
Click to collapse
you need to log in as a full user. UserUser is not a valid user. Useruser does not have a home folder.
AdamOutler said:
you need to log in as a full user. UserUser is not a valid user. Useruser does not have a home folder.
Click to expand...
Click to collapse
It actually was "/home/jeph36/" where 'jeph36' is my normal ubuntu login. When I posted I thought maybe I should change it for some privacy reason, only to later realize that it is my xda user name anyway. I assume by "full user" you just mean the user that I use to login.
Edit: I tried again on the same computer with the same result. I am not sure what is missing. Unfortunately I can not stay up later to try on a different computer or with a new install (new 3-day old baby, work tomorrow, etc). Hopefully someone else has this working by tomorrow afternoon/evening, but if not I will get on it then.
AdamOutler said:
This is a development thread. Do not post "good job", or "great idea", or "cool, i'm trying this now".. I want feedback.
<QUOTE SNIP>
.
Click to expand...
Click to collapse
Saw a few mistakes such as "sh /sdcard/uboot" Shouldnt it be "sh /sdcard/ubunbtu/uboot"? I am currently n the proccess of getting ubuntu up and running in virtualbox and will be trying this out once i get this up and running for you.
Edit: The rootstock command did not work for me on ubuntu 10.04 it just spits out the command usage spill. IT installed rootstock just fine tho. so I am lost at the moment until I get some feedback of my own here. do I need to iunstall anything ontop of my fresh ubuntu install to get this working?
Edit got the command working but its still flawed big time as it keeps kicking out errors at me. You are going to want to take a good look at it and fix it.
Ed ok I managed to create the image file and here is the command i used to do it
Code:
sudo rootstock --dist maverick --seed lxde,tightvncserver,openoffice.org,gimp,ssh, -f localhost --l ubuntu --p ubuntu --imagesize 3800M --notarball --fullname "Ubuntu for Android" --kbmodel pc104 --locale en_US.UTF-8 --serial ttyS0
Not sure if it will work correctly or not but I am going to find out soon.
Edit: Ok got it transfered over and ran the "sh /sdcard/ubuntu/uboot" Command and this is the output from it
Code:
: permission denied
"
"
"
"
"
"
"
"
"
The command executed failed. please search for this command on Google. IF that fails, try [url]www.ubuntuforums.org[/url].
: permission denied
"
"
"
Setting up environmental variables
test: permission denied
Environmental is:
/sdcard/ubuntu/uboot: 96: Syntax error: "else" unexpected (expecting "then")
Montisaquadeis said:
Saw a few mistakes such as "sh /sdcard/uboot" Shouldnt it be "sh /sdcard/ubunbtu/uboot"? I am currently n the proccess of getting ubuntu up and running in virtualbox and will be trying this out once i get this up and running for you.
Edit: The rootstock command did not work for me on ubuntu 10.04 it just spits out the command usage spill. IT installed rootstock just fine tho. so I am lost at the moment until I get some feedback of my own here. do I need to iunstall anything ontop of my fresh ubuntu install to get this working?
Edit got the command working but its still flawed big time as it keeps kicking out errors at me. You are going to want to take a good look at it and fix it.
Ed ok I managed to create the image file and here is the command i used to do it
Code:
sudo rootstock --dist maverick --seed lxde,tightvncserver,openoffice.org,gimp,ssh, -f localhost --l ubuntu --p ubuntu --imagesize 3800M --notarball --fullname "Ubuntu for Android" --kbmodel pc104 --locale en_US.UTF-8 --serial ttyS0
Not sure if it will work correctly or not but I am going to find out soon.
Edit: Ok got it transfered over and ran the "sh /sdcard/ubuntu/uboot" Command and this is the output from it
Code:
: permission denied
"
"
"
"
"
"
"
"
"
The command executed failed. please search for this command on Google. IF that fails, try [url]www.ubuntuforums.org[/url].
: permission denied
"
"
"
Setting up environmental variables
test: permission denied
Environmental is:
/sdcard/ubuntu/uboot: 96: Syntax error: "else" unexpected (expecting "then")
Click to expand...
Click to collapse
try as superuser.. I'm downloading right now, later I'll tell if work
AdamOutler said:
mint will work.
Click to expand...
Click to collapse
Excellent, I will do this tonight and post results.
Montisaquadeis said:
Edit: Ok got it transfered over and ran the "sh /sdcard/ubuntu/uboot" Command and this is the output from it
Code:
: permission denied
"
"
"
"
"
"
"
"
"
The command executed failed. please search for this command on Google. IF that fails, try [url]www.ubuntuforums.org[/url].
: permission denied
"
"
"
Setting up environmental variables
test: permission denied
Environmental is:
/sdcard/ubuntu/uboot: 96: Syntax error: "else" unexpected (expecting "then")
Click to expand...
Click to collapse
I believe it should be sh /mnt/sdcard/ubuntu/uboot (though it appears that may be what you input), and it should be done as root.
Ok after giving terminal emulator root access all those permisson denied turn into not found. so that script dont work either way. the rest of that output stayed the same.
The script must be edited to the absolute path for the Ubuntu image.
good job, great idea, this is cool, i'm trying this now
AdamOutler said:
The script must be edited to the absolute path for the Ubuntu image.
Click to expand...
Click to collapse
I have the image on the sdcard in a folder called ubuntu and the file name is ubuntu.img
I would assume that is where the script is looking for the image and its there on the sdcard in the folder named ubuntu and the file is ubuntu.img
The image parameters were wrong..
sudo rootstock --dist maverick --seed lxde,tightvncserver,openoffice.org,gimp,ssh, -fqdn localhost --login ubuntu --password ubuntu --imagesize 3800M --notarball --fullname "Ubuntu for Android" --kbmodel pc104 --locale en_US.UTF-8 --serial ttyS0 --doswap --swapsize 256M
should have been
Code:
sudo rootstock --dist maverick --seed lxde,tightvncserver,openoffice.org,gimp,ssh -fqdn localhost --login ubuntu --password ubuntu --imagesize 3800M --notarball --fullname "Ubuntu for Android" --kbmodel pc104 --locale en_US.UTF-8 --serial ttyS0 --doswap --swapsize 256M
See that? I didn't either... the comma after "ssh" should not be there.
Not sure if it's going to make a difference, but I am getting an error when running the (corrected) rootstock command:
Unable to open a folder for 4.0 GB Filesystem
No application is registered as handling this file
Click to expand...
Click to collapse
It's still running, so maybe it won't matter. This is on a 20GB (total, split 500M /boot, 10G /, 9.5G /home) VirtualBox Mint system.
And they are still wrong it should be -f localhost --l ubuntu --p ubuntu not -fqdn localhost --login ubuntu --password ubuntu
Montisaquadeis said:
And they are still wrong it should be -f localhost --l ubuntu --p ubuntu not -fqdn localhost --login ubuntu --password ubuntu
Click to expand...
Click to collapse
-f and --fqdn are interchangeable, but you're right, if you use fqdn it needs another dash, though you're wrong about --l and --p, it's either --login and --password or -l and -p Again, they're interchangeable.
The shorter way would be:
sudo rootstock -d maverick -s lxde,tightvncserver,openoffice.org,gimp,ssh, -f localhost -l ubuntu -p ubuntu -i 3800M --notarball -n "Ubuntu for Android" --kbmodel pc104 -x en_US.UTF-8 --serial ttyS0 --doswap --swapsize 256M
Click to expand...
Click to collapse
Though, for some reason, the -s switch doesn't seem to work (on my version) in place of --seed
hi all
i have an galaxy SIII
i am using script manager.
i want to write a script and i have 2 questions
- how to write a script who open an url with the web browser
- is there an function to send a ping to see if an local adress avalaible (192.168.1.X) if not avalaible is there an return error ?
(sorry to seem stupid but i am coming from windows and i am a bit lost for the moment )
thank u for giving me a your time
no suggestion ?
or advise
Google something like "android open browser from shell". You can do it using intents.
Also:
Code:
ping --help
this work in an script u put
am start -a android.intent.action.VIEW -n com.android.browser/.BrowserActivity http://www.google.fr
for chrome i find this
am start -a android.intent.action.VIEW -n com.android.chrome/.Main -d http://xxxxxxxx
but i not find for opera if someone have it
finally
opera =
am start -a android.intent.action.VIEW -n com.opera.browser/com.opera.Opera -d http://www.google.xxxx
hope this help someone
lol now i really need help coz i found nothing
i want to know which ip is reachable from 192.168.1.(1 to 9)
in a script to automate that and give me wish is reachable for use it in a command to browser.
(i know ping from terminal emulator but it's not what i am looking for)
forgive my english i hope you understand what i want ant hope too u help me with this
kondronaute said:
i want to know which ip is reachable from 192.168.1.(1 to 9)
in a script to automate that and give me wish is reachable for use it in a command to browser...
Click to expand...
Click to collapse
That's easy, check:
Code:
for var in {1..9}
do
echo "Looking for 192.168.1.$var..." #optional... jejeje
if ping 192.168.1.$var -c 1 > /dev/null
then
#Reachable, put here your command
else
#Unreachable, you can show an error here
fi
done
RoberGalarga said:
That's easy, check:
Code:
for var in {1..9}
do
echo "Looking for 192.168.1.$var..." #optional... jejeje
if ping 192.168.1.$var -c 1 > /dev/null
then
#Reachable, put here your command
else
#Unreachable, you can show an error here
fi
done
Click to expand...
Click to collapse
but ping command is not reconized by script manager i can only do it with terminal emulator ....
Really? I didn't know that (weird, BTW). Check if you need to use another command with Script Manager, or if you need to add something.
I dunno another way to achieve your goal... only using ping
lol i have a headeach with this and find nothing
RoberGalarga said:
Really? I didn't know that (weird, BTW). Check if you need to use another command with Script Manager, or if you need to add something.
I dunno another way to achieve your goal... only using ping
Click to expand...
Click to collapse
finally i have possibility to run ping you must just in option of script manager chek "override $PATH"
after 2 or 3 aspirin this work for me
#!/system/bin/sh
for i in $(seq 2 10);
do
host="192.168.1.$i"
ping -c 1 -W 1 $host > /dev/null &&
am start -a android.intent.action.VIEW -n com.android.browser/.BrowserActivity http://$host ;
done
i dont know why i have error with else and if with android shell ????
i thank u again for your help and hope the masters here help us a bit to understand, it's difficult coz there are differences with simple linux and this for french using windows :laugh:
Try if this help.
i have this kind of probleme http://forum.xda-developers.com/showthread.php?t=1045006
but i am usin the script manager editor on my phone !!!!!
i have not Windows EOL formatting
please if u are guru of busybox your help is needed to use if else and fi in a script.
must i download another version of busybox or add a command ????
i am fully rooted the path in script manager is good
edit = after trying and googleing
after if you must put [[your code without space before and after]] and after then (yourcode) :laugh:
hope i find the rest...
kondronaute said:
i have not Windows EOL formatting
Click to expand...
Click to collapse
Are you sure? Because if you have created the script in windows, you have that EOL formatting (whatever that means :silly. Try this:
Open Terminal Emulator, and type
Code:
echo "hello there" > /sdcard/newScript.sh
This will create a new and clean script in your SD Card.
Then, go to Script Manager, and edit that script. You can start deleting the text ("hello there") and adding this:
Code:
testvar=1
if [ "$testvar" = "1" ] ; then
echo "All is right"
fi
Ok, run the script. If you can see the text "All is right", that's it, problem solved
RoberGalarga said:
Are you sure? Because if you have created the script in windows, you have that EOL formatting (whatever that means :silly. Try this:
Open Terminal Emulator, and type
Code:
echo "hello there" > /sdcard/newScript.sh
This will create a new and clean script in your SD Card.
Then, go to Script Manager, and edit that script. You can start deleting the text ("hello there") and adding this:
Code:
testvar=1
if [ "$testvar" = "1" ] ; then
echo "All is right"
fi
Ok, run the script. If you can see the text "All is right", that's it, problem solved
Click to expand...
Click to collapse
you save my last neuron
thanks
edit =
my fault is i create a text file under windows (easier and can copy and past easily) after i put the file on my phone and copy past the code in a new script.
i not think that when i just copy past i past the EOL formatting ( i dont know what is that but its a bad thing )
that's mean i must abandon windows and migrate totally to linux
anyway that make me crazy and i am happy to sort it.
you are very helpfull many thanks again
new edit = i understand now why they say notepad++ is necessary
Using the app "better terminal pro" it has an ssh client built in (maybe the free version has too though i'm using pro)..
I can ssh to my ssh server and log in via password.
but i'd like to go in passwordless. For that, I want to create keys.. So, i'm running ssh-keygen. Better terminal has it..
When I run ssh-keygen, it says
Generating public/private rsa key pair
segmentation fault
this happens where I do su beforehand or not..
Any ideas how to resolve that?
gardina said:
Using the app "better terminal pro" it has an ssh client built in (maybe the free version has too though i'm using pro)..
I can ssh to my ssh server and log in via password.
but i'd like to go in passwordless. For that, I want to create keys.. So, i'm running ssh-keygen. Better terminal has it..
When I run ssh-keygen, it says
Generating public/private rsa key pair
segmentation fault
this happens where I do su beforehand or not..
Any ideas how to resolve that?
Click to expand...
Click to collapse
Worth noting that ssh -? shows it's dropbear ssh that it uses..
and looking in the directory made by better terminal, dropbear includes an executable called dropbear(which I haven't tried much), and an executable called dropbearkey(which I have tried)
You can use dropbear key to generate the key.. That's instead of ssh-keygen
I understand and have done the steps below and they work..
I don't have enough posts yet to enable me to post a URL, but a URL on journal DOT ulyco DOT com mentions this procedure(which shows the syntax and usage of dropbearkey, amongst other things)-
cd
dropbearkey -t rsa -f ~/.ssh/id_rsa
dropbearkey -y -f ~/.ssh/id_rsa | grep ssh-rsa >~/.ssh/id_rsa.pub
scp ~/.ssh/id_rsa.pub [email protected]:transformer-key
# now you'll need to go to the remote server and put the key in authorized_keys
# once you've set that up, to use it you need to specify the key:
ssh -i ~/.ssh/id_rsa [email protected]
That said.. Another way may be to generate a key on another machine and ensure the right key(s) are on client/server. (private key on client, public key on server in authorized_keys file, and you could put the public key on the client too). That(generating the key elsewhere and placing it on client/server) might be how it's meant to be done as of writing, with juicessh
Anyhow, dropbearkey is very good, it generates the key fine, both the private key, and the public key from the private key.