02 2014 档案

如何在Root的手机上开启ViewServer,使得HierachyViewer能够连接
摘要:前期准备:关于什么是Hierarchy Viewer,请查看官方文档:http://developer.android.com/tools/debugging/debugging-ui.html。个人理解:Hierarchy Viewer能获得当前手机实时的UI信息,给界面设计人员和自动化测试人员带来极大的便利。在Android的官方文档中提到:To preserve security, Hierarchy Viewer can only connect to devices running a developer version of the Android system.即:出于安全考虑, 阅读全文

posted @ 2014-02-25 18:58 Kuloud 阅读(256) 评论(0) 推荐(0)

Android上运行本地c
摘要:在android代码中编译一个可执行文件,主要功能是对文件的读写,简单贴出来:[cpp]view plaincopy#include#include#include#include#includevoidread_data(void){charreadBuf[640*1024];char*path="/boot0_nand";FILE*fp=fopen(path,"rb");if(!fp){printf("can'topen%s\n",path);}size_tlen=fread(readBuf,sizeof(char),si 阅读全文

posted @ 2014-02-23 17:46 Kuloud 阅读(584) 评论(0) 推荐(0)

Linux下 fcntl 函数用法说明
摘要:功能描述:根据文件描述词来操作文件的特性。文件控制函数 fcntl -- file controlLIBRARY Standard C Library (libc, -lc)SYNOPSIS #include ; int fcntl(int fd, int cmd); int fcntl(int fd, int cmd, long arg); int fcntl(int fd, int cmd, struct flock *lock);[描述] Fcntl()针对(文件)描述符提供控制.参数fd 是被参数cmd操作(如下面的描述)的描述符. 针对cmd的值,fcntl能够接受第三个参数int 阅读全文

posted @ 2014-02-20 17:18 Kuloud 阅读(631) 评论(0) 推荐(0)

android NDK jni下的c文件 Unresolved inclusion
摘要:原因是在eclipse编辑环境中没有找到对应的include中的文件。解决方法是将包含该文件的include目录作为新的linked folder加入工程中。具体方法如下:1. 右击工程->New->Folder2. 对话框中点击Advanced3. 选择Link to alternate location (Linked Folder),选择需要的include目录4. Finish后刷新工程,问题解决。include 目录可以在ndk的安装目录中找到例如:/android-ndk-r7b/platforms/android-8/arch-arm/usr/include 阅读全文

posted @ 2014-02-20 15:07 Kuloud 阅读(125) 评论(0) 推荐(0)

rageagainstthecage 源代码
摘要://头文件包含#include #include #include #include #include #include #include #include #include #include //输出错误消息后退出程序void die(const char *msg){perror(msg);exit(errno);}//搜索ADB进程,返回其PID,没有找到时返回0pid_t find_adb(){char buf[256];int i = 0, fd = 0;pid_t found = 0;//初始化为0,如果没有找到adb将一直保持0值//遍历进程ID的有效范围for (i = 0; 阅读全文

posted @ 2014-02-20 14:36 Kuloud 阅读(314) 评论(0) 推荐(0)

【转】浅析terminal创建时ptmx和pts关系
摘要:我们打开一个terminal,那么将会在devpts文件系统/dev/pts下创建一个对应的pts字符文件,该pts字符文件节点直接由/dev/ptmx节点的驱动函数ptmx_open()调用devpts_pty_new(tty->link)[tty对应ptmx,tty->link对应/dev/pts/xxx,那么tty->link->link又对应回ptmx同样ptm_driver->other等于pts_driver,pts_driver->other等于ptm_driver]主动创建,而非通过netlink的udev或者hotplug配合创建[luth 阅读全文

posted @ 2014-02-20 10:53 Kuloud 阅读(351) 评论(0) 推荐(0)

JD-GUI on Ubuntu 13.04 64-bit
摘要:Java Decompiler (jd-gui) is a cute little tool I like using when working in Java. Unfortunately it only comes in 32-bit linux. So if you are on 64-bit linux (considering that everything is going 64-bit except a number of windows apps), you seem a little bit out of luck.In the past, you would have in 阅读全文

posted @ 2014-02-19 12:08 Kuloud 阅读(564) 评论(0) 推荐(0)

【转】浅析terminal创建时ptmx和pts关系
摘要:基本概念:1> tty(终端设备的统称):tty一词源于Teletypes,或者teletypewriters,原来指的是电传打字机,是通过串行线用打印机键盘通过阅读和发送信息的东西,后来这东西被键盘与显示器取代,所以现在叫终端比较合适。终端是一种字符型设备,它有多种类型,通常使用tty来简称各种类型的终端设备。2> pty(虚拟终端):但是如果我们远程telnet到主机或使用xterm时不也需要一个终端交互么?是的,这就是虚拟终端pty(pseudo-tty)3> pts/ptmx(pts/ptmx结合使用,进而实现pty):pts(pseudo-terminal slav 阅读全文

posted @ 2014-02-17 16:09 Kuloud 阅读(610) 评论(0) 推荐(0)