andriod 上 hello world 的筆記

  1. root 手機

鏈接電腦後, 做爲 modem 鏈接 開發人員選項 -〉 USB 調試, 鏈接USB 後啓用調試模式linux

[root@lambda-laptop shm]# ./adt-bundle-linux-x86_64-20140321/sdk/platform-tools/adb   devices
    List of devices attached 
    014FA5760D019009	 device
adb  shell    #進入手機shell
\#切換到 root
su  \# 切換不成功極可能是 root 沒成功?? 這個不是很清楚, 很長時間本身 不能su 成功,最後又root 了一次,才行的。 ^_^
默認 system 權限:

<!-- lang: shell -->
 root@dinara_td:/ # ls -ld /system                                              
drwxr-xr-x root     root              2014-10-10 23:25 system
drwxr-xr-x root     shell             2014-11-20 20:00 bin


\#賦予 /system/bin/   777 權限 ,記得調試完畢更改回來。 原來的權限爲 755
chmod 777 /system/bin
\#退出
exit
exit
 \# 上傳你的應用
 [root@lambda-laptop shm]\# ./adt-bundle-linux-x86_64-20140321/sdk/platform-tools/adb   push hello /system/bin/ 
  4464 KB/s (707508 bytes in 0.154s)
 \# 執行你的應用:
 [root@lambda-laptop shm]\# ./adt-bundle-linux-x86_64-20140321/sdk/platform-tools/adb   shell /system/bin/hello
  hello lambda
![在此輸入圖片描述][1]
相關文章
相關標籤/搜索