18.4 Android 下原生Linux驱动测试
18.4.1 Android设备运行C语言程序
C语言源代码:
1 #include
2 int main(int argc,char ** argv)
3 {
4 printf("hello world!\n");
5 return 0;
6 }
编译C语言源码:编译的时候加上-static静态选项
root@xl:/test# arm-linux-gcc -static hello.c -o hello
传输编译好的文件到Android设备:
root@xl:/# adb push /test/hello /
896 KB/s (607564 bytes in 0.661s)
运行测试: