The default Android adbd is only listened on 127.0.0.1:5037, so if the USB is not working on developing board, you can't use adb to do something.
The default setting on device, only listen 127.0.0.1:5037
# netstat
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 127.0.0.1:5037 0.0.0.0:* LISTEN
tcp 0 0 192.168.1.128:56559 74.125.47.109:993 ESTABLISHED
Following is the step to enable the remote adbd
# mv /dev/android_adb /dev/android_adb.bk
# setprop persist.service.adb.enable 1
# setprop service.adb.root 1
# setprop ctl.stop adbd
# setprop ctl.start adbd
# netstat
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 127.0.0.1:5037 0.0.0.0:* LISTEN
tcp 0 0 0.0.0.0:5555 0.0.0.0:* LISTEN
tcp 0 0 192.168.1.128:56559 74.125.47.109:993 ESTABLISHED
The Host machine which want to connect to remote Android device, you can use following command:
Ubuntu$export ADBHOST=192.168.1.128
Ubuntu$./adb kill-server
Ubuntu$./adb devices
Ubuntu$./adb shell
2010年5月19日 星期三
2010年5月14日 星期五
Android source build problem on Virtual machine
You may install Ubuntu on Virtualbox, and use it to build Android source. When you build whole source code based on Android 1.6, you will not meet "too many open file" error when trying to build it. But when you run "repo sync" to update Android 1.6 to 2.1, you may meet this error.
This is caused by the small open file limitation on Ubuntu Linux system.
You can add following value into configuration file in /etc/security/limits.conf
jacky soft nofile 2048
jacky hard nofile 4096
This is caused by the small open file limitation on Ubuntu Linux system.
You can add following value into configuration file in /etc/security/limits.conf
jacky soft nofile 2048
jacky hard nofile 4096
This changing will let the user(jacky) can open files up to 4096.
Then the "too many open file" error will go out.
2010年1月10日 星期日
Howto: Build Android source on Ubuntu 9.10 need java 1.5
Now the java version on Ubuntu 9.10 is default as 1.6, but this version have problem to build Android.
The reason is mentioned in Android geting source page.
Following is a note from Internet to force install java 1.5.
My work Record: ubuntu 9.10 , build android , java 1.5
2009年11月8日 星期日
Howto run native Linux application on Android
Recently I am working an Embedded Linux Internal project, and use many open source tools to build cross compiler, Linux kernel, small Linux root filesystem on JK2410(Jollen Kit based on Samsung S3C2410 - ARM 920T).
From this project I learned how to build cross compiler, busybox by myself. and use such kind of tools, the static linked code also can run on Android emulator. I would like to share this knowledge from this blog.
First I used OSELAS toolchain, it must be build by ptxdist tool.
Following is the step how to build ptxdist and setup the right gcc, kernel version you want to build the toolchain. Download ptxdist-1.99.12.tgz and ptxdist-1.99.12-patches.tgz from http://www.ptxdist.org/software/ptxdist/download/v1.99/
Run command in the terminal shell:
# tar -zxf ptxdist-1.99.12.tgz
# tar -zxf ptxdist-1.99.12-patches.tgz
# ./configure --prefix=/usr/local
# make
# make install
then, download OSELAS.Toolchain-1.99.3.5.tar.bz2 from http://www.oselas.com/oselas/toolchain/download/
Run following command in the terminal shell:
# tar xf OSELAS.Toolchain-1.99.3.5.tar.bz2
# cd OSELAS.Toolchain-1.99.3.5
# ptxdist select ptxconfigs/arm-v4t-linux-gnueabi_gcc-4.3.2_glibc-2.8_binutils-2.18_kernel-2.6.31-sanitized.ptxconfig
# ptxdist go
After run "ptxdist go", the tool will get the source code, patch from Internet, and compile the right CPU architecture, gcc, glibc, binutils and kernel version as the select setting you give. You can change the ptxconfig to more match your platform requirement.
The build procedure will take 1 to 2 hours depended on your Building host computing power.
After it finished, you can find the toolchain in /opt/OSELAS.Toolchain-1.99.3/ directory, so make sure your running user have permission to write file into /opt directory.
2nd Step is build up a static linked busybox, now it have some problem to run dynamic shared code on Android, because the linker system program in Android use different technology with toolchain. I haven't let dynamic code run successfully on Android.
Get busybox-1.15.2.tar.bz2 from http://www.busybox.net/downloads/
#tar jxvf busybox-1.15.2.tar.bz2
#cd busybox-1.15.2
#make menuconfig
This step you must change the Busybox setting -> Build options
Choose Build BusyBox as a static binary (no shared libs)
and Set Cross Compiler prefix as "arm-v4t-linux-gnueabi-"
#make
Now you can see the striped busybox present in this folder
3rd Step is to prepare the Android SDK environment, you can get it from here
Please notice the link will not get the whole package, you must following this instruction to get more add-on package.
Assume you place android sdk in /opt/Google/android-sdk-linux, add "/opt/Google/android-sdk-linux/tools" in your PATH variable.
then, run following command:
#android create avd -n my_droid -t 1
#emulator -avd my_droid -shell
From now now, you can see a magic emulator Google phone is launched, and the previous terminal become a single # as prompt.
In this prompt, you are in the Android root shell, you can type "ls -l" "cd" "pwd" as normal command.
Now you also need use following command(in Host Terminal) to put busybox binary into Android emulator.
#adb push busybox /data/busybox
#adb shell chmod 755 /data/busybox
Final, switch to Android shell, and type
#/data/busybox ls -al /system
You can see the file list from the busybox binary output.
This purpose of article is just to share the toolchian buildup experience, and the native C code compatibility on Android platform. You must not to use this way to run your original application. You shall learn how to use Android NDK to build your native C/C++ library.
I am now studying this as my next step to learn more about Android platform. If you are interested on this, we can discuss this by email or other way.
From this project I learned how to build cross compiler, busybox by myself. and use such kind of tools, the static linked code also can run on Android emulator. I would like to share this knowledge from this blog.
First I used OSELAS toolchain, it must be build by ptxdist tool.
Following is the step how to build ptxdist and setup the right gcc, kernel version you want to build the toolchain. Download ptxdist-1.99.12.tgz and ptxdist-1.99.12-patches.tgz from http://www.ptxdist.org/software/ptxdist/download/v1.99/
Run command in the terminal shell:
# tar -zxf ptxdist-1.99.12.tgz
# tar -zxf ptxdist-1.99.12-patches.tgz
# ./configure --prefix=/usr/local
# make
# make install
then, download OSELAS.Toolchain-1.99.3.5.tar.bz2 from http://www.oselas.com/oselas/toolchain/download/
Run following command in the terminal shell:
# tar xf OSELAS.Toolchain-1.99.3.5.tar.bz2
# cd OSELAS.Toolchain-1.99.3.5
# ptxdist select ptxconfigs/arm-v4t-linux-gnueabi_gcc-4.3.2_glibc-2.8_binutils-2.18_kernel-2.6.31-sanitized.ptxconfig
# ptxdist go
After run "ptxdist go", the tool will get the source code, patch from Internet, and compile the right CPU architecture, gcc, glibc, binutils and kernel version as the select setting you give. You can change the ptxconfig to more match your platform requirement.
The build procedure will take 1 to 2 hours depended on your Building host computing power.
After it finished, you can find the toolchain in /opt/OSELAS.Toolchain-1.99.3/ directory, so make sure your running user have permission to write file into /opt directory.
2nd Step is build up a static linked busybox, now it have some problem to run dynamic shared code on Android, because the linker system program in Android use different technology with toolchain. I haven't let dynamic code run successfully on Android.
Get busybox-1.15.2.tar.bz2 from http://www.busybox.net/downloads/
#tar jxvf busybox-1.15.2.tar.bz2
#cd busybox-1.15.2
#make menuconfig
This step you must change the Busybox setting -> Build options
Choose Build BusyBox as a static binary (no shared libs)
and Set Cross Compiler prefix as "arm-v4t-linux-gnueabi-"
#make
Now you can see the striped busybox present in this folder
3rd Step is to prepare the Android SDK environment, you can get it from here
Please notice the link will not get the whole package, you must following this instruction to get more add-on package.
Assume you place android sdk in /opt/Google/android-sdk-linux, add "/opt/Google/android-sdk-linux/tools" in your PATH variable.
then, run following command:
#android create avd -n my_droid -t 1
#emulator -avd my_droid -shell
From now now, you can see a magic emulator Google phone is launched, and the previous terminal become a single # as prompt.
In this prompt, you are in the Android root shell, you can type "ls -l" "cd" "pwd" as normal command.
Now you also need use following command(in Host Terminal) to put busybox binary into Android emulator.
#adb push busybox /data/busybox
#adb shell chmod 755 /data/busybox
Final, switch to Android shell, and type
#/data/busybox ls -al /system
You can see the file list from the busybox binary output.
This purpose of article is just to share the toolchian buildup experience, and the native C code compatibility on Android platform. You must not to use this way to run your original application. You shall learn how to use Android NDK to build your native C/C++ library.
I am now studying this as my next step to learn more about Android platform. If you are interested on this, we can discuss this by email or other way.
Labels:
Android
2009年4月19日 星期日
Google Android for IBM Thinkpad series
Recently I found a good step-by-step instruction for building Android image for IBM Thinkpad Notebook.
This is a good guide, I will try to build this for Thinkpad T43.
Link - http://wiki.androidx86.org/index.php?title=Building_Android_for_the_ThinkPad_series
This is a good guide, I will try to build this for Thinkpad T43.
Link - http://wiki.androidx86.org/index.php?title=Building_Android_for_the_ThinkPad_series
訂閱:
文章 (Atom)