android 编译c

来源:互联网 发布:手机声音剪辑软件 编辑:程序博客网 时间:2024/06/05 15:34

/home/dou/a10/a20/A20-420-V12/lichee/out/linux/common/buildroot/external-toolchain/bin/arm-linux-gnueabi-gcc -o i2c_util i2c-util.c




adb shell mkdir /dev/sample
adb push hello /dev/sample/hello
adb shell chmod 777 /dev/sample/hello
先创建 /dev/sample目录,再将编译好的hello上传上去,最后将hello改成可执行的。
再进入命令行模式,进入Android的shell环境:
adb shell
#cd /dev/sample
#./hello

  1. / #  i2c-rw /dev/i2c-2 0x38 0x1 0    
  2. read salve:38 reg:01 value:12    
  3. / #     
  4. / #  i2c-rw /dev/i2c-2 0x38 0x2 0    
  5. read salve:38 reg:02 value:81

0 0
原创粉丝点击