官术网_书友最值得收藏!

Time for action — adding a Kindle Fire to ADB

It only takes one line of text to add the Kindle Fire to the list of devices that ADB knows about. The harder part is tracking down the text file to edit, and getting ADB to restart after making the changes. Things are more involved with Windows than Mac, because you also have to configure the USB driver, so the two systems are shown here as separate processes:

For Windows:

  1. In Windows Explorer, navigate to where the file adb_usb.ini is located, at C:\Users\yourusername\.android\.
  2. Open the text file adb_usb.ini in a text editor. The file has no visible line breaks, so Wordpad would be a better option than Notepad.
  3. On the line after the three instruction lines, type 0x1949.
  4. Make sure there are no blank lines, and the last character in the text file should be the 9 at the end of 0x1949.
  5. Save.
  6. Navigate to where android_winusb.inf is located, at C:\Program Files (x86)\Android\android-sdk\extras\google\usb_driver\.
  7. Right-click on the file, and in Properties | Security, select Users from the list, and click on Edit to set the permissions so that you are allowed to write to the file.
  8. Open android_winusb.inf in Notepad.
  9. Add these three lines to the [Google.NTx86] and [Google.NTamd64] sections, and save the file.
    ;Kindle Fire
    %SingleAdbInterface% = USB_Install, USB\VID_1949&PID_0006
    %CompositeAdbInterface% = USB_Install, USB\VID_1949&PID_0006&MI_01
    
  10. You will need to set the Kindle to use the Google USB driver that you just edited.
  11. In the Windows control panel, Device Manager, find the Kindle entry in the list that is under USB.
  12. Right-click on the Kindle entry and choose Update Driver Software….
  13. Choose the option that lets you find the driver on your local drive, navigate to the google\usb_driver\ folder, and select it to be the new driver.
  14. When the driver is updated, open a command window (handy trick: Shift+right-click on the desktop and select Open command window here).
  15. Change directories to where the ADB tool is located, by typing the following:
    cd C:\Program Files (x86)\Android\android-sdk\platform-tools\ 
    
  16. Type these three lines, with pressing Enter after each line:
    adb kill-server adb start-server adb devices 
    
  17. You should see the Kindle Fire listed (as an obscure looking number), as well as the virtual device, if you still have that running.

For Mac (MUCH simpler!):

  1. Navigate to where the file adb_usb.ini is located. On Mac, in Finder, select the menu Go | Go to Folder…, and type in ~/.android/.
  2. Open the file adb_usb.ini in a text editor.
  3. On the line after the three instruction lines, type 0x1949.
  4. Make sure there are no blank lines; the last character in the text file would be the 9 at the end of 0x1949.
  5. Save.
  6. Open Utilities | Terminal.
  7. You can let OSX know how to find ADB from anywhere, by typing this line (replace yourusername with your user name, and also change the path if you installed the Android SDK to a different location):
    export PATH=$PATH:/Users/yourusername/Documents/android-sdk-macosx/platform-tools 
    
  8. Now, enter the same three lines we did with Windows:
    adb kill-server adb start-server adb devices 
    
  9. Again, you should see the Kindle Fire listed.

What just happened?

I suspect that you're going to have nightmares about all those steps! It took a lot of searching on the web to find some of those obscure hacks. The general case with Android devices on Windows is that you have to modify the USB driver for the device to be handled by the Google USB driver, and you may have to modify the adb_usb.ini file (on Mac too) for the device to be considered as an ADB compatible device.

Getting ready to test for iOS

If you carefully went through all those Android steps, especially on Windows, you will hopefully be amused by the brevity of this section! There is a catch though; you can't really test on an iOS device from LiveCode. We'll look at what you have to do instead in a moment, but first, here are the steps required for testing an app in the iOS simulator.

主站蜘蛛池模板: 梁河县| 永泰县| 卫辉市| 来凤县| 军事| 永康市| 恩施市| 瑞昌市| 上林县| 镇宁| 正阳县| 赤壁市| 武平县| 贵溪市| 锦州市| 南京市| 哈巴河县| 容城县| 革吉县| 新津县| 湖北省| 黔江区| 宜兴市| 三亚市| 屏山县| 丹江口市| 新闻| 济南市| 新绛县| 石首市| 黔江区| 中卫市| 讷河市| 施秉县| 正镶白旗| 门头沟区| 宾阳县| 玉龙| 闵行区| 武汉市| 中牟县|