ubuntu下adb驱动问题

ubuntu下adb默认无法识别,得到error: insufficient permissions for device,使用adb devices得到no permissions.解决办法有两种:

  1. 使用root账户(su到root账户)
1
2
3
4
5
su
cd android-tools-dir
./adb kill-server
./adb start-server
./adb devices
  1. 修改udev的权限,猛击这里,添加/etc/udev/rules.d/50-android.rules
1
SUBSYSTEM=="usb", SYSFS(idVendor)=="18d1", MODE="0666"

然后修改执行权限

1
chmod a+rx /etc/udev/rules.d/50-android.rules

重启udev

1
sudo restart udev
1
2
3
4
5
su
cd android-tools-dir
./adb kill-server
./adb start-server
./adb devices

CDHtmlDialog中禁用右键菜单和F5刷新

参考:猛击这里 在头文件中加入:

1
2
STDMETHOD(ShowContextMenu)(DWORD dwID, POINT *ppt, IUnknown *pcmdtReserved, IDispatch *pdispReserved);
STDMETHOD(TranslateAccelerator)(LPMSG lpMsg, const GUID * pguidCmdGroup, DWORD nCmdID);

在cpp中加入:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
STDMETHODIMP ChtmldialogDlg::ShowContextMenu(DWORD dwID, POINT *ppt, IUnknown *pcmdtReserved, IDispatch *pdispReserved)
{
//return CDHtmlDialog::ShowContextMenu(dwID, ppt, pcmdtReserved, pdispReserved);
return S_OK;
}

STDMETHODIMP ChtmldialogDlg::TranslateAccelerator(LPMSG lpMsg, const GUID * pguidCmdGroup, DWORD nCmdID)
{
if (lpMsg && lpMsg->message == WM_KEYDOWN && lpMsg->wParam == VK_F5) {
return S_OK;
}
return CDHtmlDialog::TranslateAccelerator(lpMsg, pguidCmdGroup, nCmdID);
}