我想在摩托罗拉 Android 上安装我的应用程序作为测试。如何?请与我分享任何一步一步的链接
1 回答
从http://developer.android.com/guide/developing/eclipse-adt.html和http://developer.android.com/guide/developing/device.html#setting-up复制,假设您使用的是 eclipse 插件. 自己阅读可能会更好。
* Declare your application as debuggable in your manifest
在 Eclipse 中,您可以在查看 Manifest 时从 Application 选项卡执行此操作(在右侧,将 Debuggable 设置为 true)。否则,在 AndroidManifest.xml 文件中,将 android:debuggable="true" 添加到元素。
* Enable USB Debugging on your device
在设备上,进入主屏幕,按 MENU,选择应用程序 > 开发,然后启用 USB 调试。
* Ensure that your development computer can detect your device when connected via USB
设置好并通过 USB 连接您的设备后,通过从 Eclipse 菜单栏中选择 Run > Run(或 Run > Debug)在设备上安装应用程序。
另请参阅http://developer.android.com/guide/developing/device.html#setting-up
您可以通过从 SDK tools/ 目录执行 adb devices 来验证您的设备是否已连接。如果已连接,您会看到设备名称列为“设备”。
如果使用 Eclipse,请照常运行或调试。您将看到一个设备选择器对话框,其中列出了可用的仿真器和连接的设备。选择要在其上安装和运行应用程序的设备。