可以装一个VNC Server 在手机上啊,然后用电脑控制手机啊,哈哈,可惜Market中没有相应的应用啊。

但是还是找到了一个项目http://code.google.com/p/android-vnc-server/

赶紧试一试啊,HOHO~

点这里下载编译好的应用(不是apk的啊,是一Linux应用)

因为是Linux应用 所以机器要Root啊。

然后用手机连到电脑上,使用adb 推送到手机上:

adb push androidvncserver /data

修改权限(来个猛的):

chmod 777 /data/androidvncserver

运行之:

./data/androidvncserver

出现如下信息:
Initializing framebuffer device /dev/graphics/fb0...
xres=240, yres=320, xresv=240, yresv=640, xoffs=0, yoffs=320, bpp=16
Initializing keyboard device /dev/input/event3 ...
Initializing touch device /dev/input/event1 ...
Initializing VNC server:
width: 240
height: 320
bpp: 16
port: 5901
Initializing server...
06/01/2011 10:54:38 Listening for VNC connections on TCP port 5901

HOHO~,使用VNC Viewer连接吧,成功,如下图:

注:因为VNC Viewer没有返回键、菜单键,使用很不方便,并且不能够模仿划屏操作,所以仅供娱乐。。。

 

 

 

 

近来发现的Android上的原生VNC Server,就是说只要手机 上安装并运行这个软件 ,即可实现电脑 上查看并控制手机了。

首先是手机端。

1)下载 android vncserver:
http://code.google.com/p/android-vnc-server/downloads/list
有兴趣的可以下载源码自己重新编译,源码地址:
http://code.google.com/p/android-vnc-server/source/checkout

2)把androidvncserver复制到手机上,我是复制到/data/local/文件 夹下。复制的方法很多:
可以用adb push进去,即:

  1. adb push 路径/androidvncserver /data/local/
复制代码


也可以复制到SD卡 ,再用Root Explorer复制到/data/local/文件夹 下。

3)在手机的“终端”更改androidvncserver的权限,如下:

  1. # chmod 555 androidvncserver
复制代码


把权限改为只读和可执行。此步骤可以用Root Explorer直接操作。

4)运行androidvncserver,在手机的“终端”执行以下代码:

  1. # /data/local/androidvncserver &
复制代码


这样androidvncserver就启动服务了。


然后是电脑端的设置
1)电脑安装VNC Client。装个免费的Real VNC Viewer即可。软件地址:http://www.realvnc.com/products/free/4.1/index.html

2)如果手机连上WiFi,并与电脑处于同一个局域网内,或者手机通过无线网卡恭喜网络 给电脑。
在手机的“终端”运行

  1. # busybox ifconfig -a
复制代码


看到twifi 0的IP地址是多少,例如:192.168.1.100。
在电脑上运行VNC Viewer,地址填写192.168.100 5901,点“确定”即可看到手机画面了。

3)如果手机于电脑是通过USB Tethering连接,即手机通过USB共享网络给电脑,或者电脑通过USB共享网络给手机。
在手机的“终端”运行

  1. # busybox ifconfig -a
复制代码


看到usb0的IP地址是多少,例如:192.168.77.254。
在电脑上运行VNC Viewer,地址填写192.168.77.254 5901,点“确定”即可看到手机画面了。

4)如果2、3的情况都不是,可以通过以下方式连接。
在电脑上执行以下命令:

  1. adb forward tcp:5901 tcp:5901
复制代码


然后打开VNC Viewer,地址填写127.0.0.1 5901,点“确定”即可看到手机画面了。

关闭手机上的androidvncserver服务
1)在手机的“终端”运行

  1. # ps | grep /data/local/androidvncserver
复制代码


显示的结果那一行中,root后面的数字就是进程号(pid),例如是8233。

2)执行

  1. # kill 8233
复制代码


即可结束androidvncserver。

总结
androidvncserver是我看过显示效果最好的,而且比其它的流畅一点。但是作者说支持鼠标点击操作,而我的却用不了。有兴趣有基础的机油,建议试下。

PS. 感谢androidvncserver作者的辛勤劳动和奉献!

 

 

 

想通过PC来控制G1 phone(android ), 在 MARKET找了半天,没有找到VNC server,只有VNC viewer,在网上搜索了一下,发现了一个叫做ANDROIDVNCSERVER的东东。以下是安装过程。
转自:http://blog.csdn.net/stevenliyong/archive/2010/03/10/5365148.aspx
名称:Android VNC Server on G1 (PC 远程控制 Android 手机 ) I found a vnc server for G1.

1. Original vnc project

http://code.google.com/p/android-vnc/

This one could not be used on G1, because it need build a special keyboard driver into kernel

2. Forked vnc server

http://code.google.com/p/android-vnc-server/

Forked from android-vnc project on google code.

The original android-vnc need build a special keyboard driver into kernel. It's not necessary. Also the touch event support is added in this version.

First download and install the binary

 http://code.google.com/p/android-vnc-server/downloads/list

If you have adb on server:

#adb push androidvncserver/data
#adb shell
/data/androidvncserver
Or you can just copy the downloaded file androidvncserver to the /sdcard,
Then umount the sdcard and launch the terminal from your G1, then type
# su    <-  I have root access, I'm not sure whether the following steps work without root access.
# cp /sdcard/androidvncserver /data/
# chmod a+x /data/androidvncserver
# /data/androidvncserver &
And finally:

Run vnc viewer from hose PC.

Here I use

http://downloads.sourceforge.net/vnc...3.10-setup.exe  

make sure the connection address with port 5901 : 192.168.0.101:5901

Now, I can remote control my phone from host pc.

在安装的过程上,遇到了以下问题, 在使用chmod命令时,总是提示,permission denied,在chmod 命令后添加了权限 777(即可执行又可读写的权限) 就可以了。

另附图:通过 ADB启动VNC SERVER时的图

 

 

 

 

 

http://code.google.com/p/android-vnc-server/

 

更多相关文章

  1. 没有一行代码,「2020 新冠肺炎记忆」这个项目却登上了 GitHub 中
  2. 学习Android闹钟源代码(三)-AlarmClock类分析(part1)
  3. adb通过wifi连接方法
  4. Android抓包方法(一)之Fiddler代理
  5. 让Android飞!Google开始测试ART
  6. JavaScript与Android原生相互调用并传参
  7. Android中3种全屏方法及3种去掉标题栏的方法
  8. Build Android(安卓)Project with Gradle
  9. 为什么移动端跨平台开发不靠谱?

随机推荐

  1. c语言中strstr函数的用法是什么?
  2. c语言六种基本语句是什么
  3. c语言strcmp函数用法是什么?
  4. 学习c语言用什么软件
  5. c语言用什么函数来比较字符串大小?
  6. system()函数是什么
  7. c语言六种基本语句是哪些?
  8. c语言函数由哪两部分组成
  9. c语言在gcc中怎么运行程序?
  10. c语言的源程序不必通过编译就可以执行对