#include
int main(int argc, char *argv[])
{
printf("hello android\n");
return 0;
}
gliethttp@Leith:~/tmp/adb_test$ arm-none-linux-gnueabi-gcc -static -o hello hello.c
gliethttp@Leith:~/tmp/adb_test$ adb push hello /
343 KB/s (568231 bytes in 1.616s)
gliethttp@Leith:~/tmp/adb_test$ adb shell /hello
hello android
gliethttp@Leith:~/tmp/adb_test$
gliethttp@Leith:~/tmp/adb_test$ adb shell 登录到emulator
# /hello 执行根目录/下的hello程序,效果如下
hello android
#
ps:编译c或c++必须使用arm-linux-gcc-2.4.2或者以上版本编译器,否则不能在emulator中执行:)
阅读(1959) | 评论(0) | 转发(0) |