先說說 裝eclipse 和ADT
自帶那個eclipse可以滿足 一般javaSE 使用,但是不知道為什麼,Fedora17裝ADT-20問題。
所以你自己需要去eclipse官方網站重新下一個,自己裝ADT。
直接不能調試的:
[www.linuxidc.com @linuxidc tools]$ sudo ./ddms
Error Loading DDMS Preferences
(DDMS:3585): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to allocate widget with width -5 and height 17
(DDMS:3585): Gtk-WARNING **: gtk_widget_size_allocate(): attempt to allocate widget with width -5 and height 17
09:30:20 E/DDMS: insufficient permissions for device
com.android.ddmlib.AdbCommandRejectedException: insufficient permissions for device
at com.android.ddmlib.AdbHelper.setDevice(AdbHelper.java:752)
at com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:373)
at com.android.ddmlib.Device.executeShellCommand(Device.java:453)
at com.android.ddmuilib.SysinfoPanel.loadFromDevice(SysinfoPanel.java:159)
at com.android.ddmuilib.SysinfoPanel.deviceSelected(SysinfoPanel.java:126)
at com.android.ddmuilib.SelectionDependentPanel.deviceSelected(SelectionDependentPanel.java:52)
at com.android.ddms.UIThread.selectionChanged(UIThread.java:1756)
at com.android.ddmuilib.DevicePanel.notifyListeners(DevicePanel.java:772)
at com.android.ddmuilib.DevicePanel.notifyListeners(DevicePanel.java:760)
at com.android.ddmuilib.DevicePanel.access$1100(DevicePanel.java:56)
at com.android.ddmuilib.DevicePanel$1.widgetSelected(DevicePanel.java:368)
at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source)
at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)
at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
at com.android.ddms.UIThread.runUI(UIThread.java:535)
at com.android.ddms.Main.main(Main.java:117)
很多人說是因為Linux 沒有root權限,我們可以從上面結果看到,使用sudo也不行。
真機調試很簡單:編輯一個配置文件,然後設置權限,最後重新啟動服務: