參考:http://codeseekah.com/2012/02/09/command-line-android-development-basics/php
http://ubuntuforums.org/showthread.php?t=1918512linux
一、pemission denyandroid
在android 文件系統下進行某些操做時沒有權限,此時執行:shell
(1)adb rootubuntu
(2)adb remount /system/app
(3)adb push file /system/libssh
二、進入 fastboot 模式測試
(1)進入fastboot模式this
adb reboot bootloaderspa
(2)列出進入fastboot模式的設備
fastboot devices
(3)fasbtoot模式下使用adb
一:fastboot oem fastboot2adb
二:fastboot continue
三、經過fastboot燒寫 內核鏡像
首先進入fasbtoot模式
而後執行 fastboot flash boot boot.img
adb install
Install to a device: adb -d install -r bin/your-application-debug.apk The emulator: adb -e install -r bin/your-application-debug.apk The -r flag allows you to do a re-installation instead of an installation. When trying to install to a device that already has the application installed an error will occur.
安裝測試程序: su –c pm install /sdcard/test.apk
adb 卸載應用程序
adb 卸載應用程序。經過ADB卸載一個應用程序,必須知道這個應用程序的程序包名稱。程序包的名字未必就是APK文件名 1、adb shell 2、pm list packages 列出全部的 程序包 名稱 3、exit 4、adb uninstall package_name 5、顯示success,表示移除成功。
卸載測試程序: su –c pm uninstall com.example.MyApp
adb 傳送文件
adb push {host_path} {target_path}
adb pull {target_path} {host_path}
adb 啓動應用程序
adb shell 'am start -n your_package_name/.youractivityname
You can launch most Android Settings sub-screens by starting the SubSettings Activity and including the:android:show_fragment extra with the appropriate fully-qualified class name of an existing Android PreferenceFragment subclass.
For example, to start UserSettings:
adb shell am start -n com.android.settings/com.android.settings.SubSettings -e :android:show_fragment com.android.settings.users.UserSettings
To start DeviceInfoSettings: adb shell am start -n com.android.settings/com.android.settings.SubSettings -e :android:show_fragment com.android.settings.DeviceInfoSettings
To find other Settings, checkout the Android source and look for subclasses of PreferenceFragment in the packages/apps/Settings.
執行lsusb
得到:
Bus 002 Device 004: ID 18d1:deed Google Inc.
在/etc/udev/rules.d/51-android.rules中添加
SUBSYSTEM=="usb", SYSFS{"Google Inc."}=="18d1", MODE="0666"
執行
chmod a+rx /etc/udev/rules.d/51-android.rules
/etc/init.d/udev restart
adb kill-server
adb devices
adb shell 登陸到系統後,能夠用getprop命令查看當前系統中有哪些屬性。
如何經過 ssh 使用 adb
http://redkrieg.com/2010/10/11/adb-over-ssh-fun-with-port-forwards/
附:
If you are using a 64-bit version of Linux, you may need to install the ia32-libspackage. To check whether you need this package, try running the adbcommand(~/android-sdk-linux_*/platform-tools/adb). If your systemreports that adb cannot be found (despite being right there in the platformtoolsdirectory) it likely means that the current version of adb, and possibly other tools, will not run without the ia32-libspackage installed. The command to install the ia32-libspackage is: sudo apt-get install ia32-libs