Netbeans Android - 编译和编译在真实设备上测试(Unix、OSX)

发布于 2024-12-04 11:59:08 字数 335 浏览 7 评论 0原文

我读过几个有关在设备上测试 Android 应用程序的问题。
我知道可以将 APK 上传到网络存储、允许未签名的应用程序并运行它 我读过一些使用 Eclipse 的解决方案 我读过有关通过 adb 安装 apk 的内容 但没有任何关于 Netbeans 的信息。

那么是否有针对 OSX/UNIX 系统和 Netbeans 的自动化解决方案?

请注意,我目前正在使用带有 NBAndroid 插件的 OSX 1.7 和 Netbeans 7.0,但问题与 Unix/OSX 和 Netbeans 相关,因为6.5(如果支持则更低)

I've read several questions about testing android apps on device.
I know possibility to upload APK to web storage, allow unsigned apps and run it
I've read some solutions using Eclipse
I've read about installing apk through adb
But nothing about Netbeans.

So Is there some automated solution for OSX/UNIX systems and Netbeans?

Note, I'm currently using OSX 1.7 and Netbeans 7.0 with NBAndroid plugin, but question is related to Unix/OSX in common and Netbeans since 6.5 (or lower if it supports)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

长发绾君心 2024-12-11 11:59:08

我会自己回答,因为没有人回答,我想出了答案:

  1. 根据本手册编辑你的 Android 清单:
    http://developer.android.com/guide/developing/device.html

  2. 从您的应用程序运行 ./adb start-serverddms android sdk启用adb服务器

  3. 在您的设备上将 USB 调试模式 设置为启用,并通过 USB 将设备连接到计算机

  4. 运行 ./adb devices 从内部/platform-tools 文件夹
    要查看您的设备是否已正确启用并且对 adb 可见

  5. 在 Netbeans (F6) 中运行项目并在窗口上半部分选择您的设备(在运行设备部分中)

  6. 您的应用程序应该在您的真实设备上正常运行,要查看日志,您可以使用

    1. ./platform-tools/adb logcat ->控制台中的调试消息
    2. ./tools/ddms -> gui 调试消息

I will lay down answer myself, since nobody answered and I fugured it out:

  1. Edit your Android manifest due to this manual:
    http://developer.android.com/guide/developing/device.html

    <application android:debuggable="true" ... >

  2. run ./adb start-server or ddms from your android sdk to enable adb server

  3. On your device set USB Debugging mode to enabled, and connect your device to computer via USB

  4. run ./adb devices from within /platform-tools folder
    to view if your device is enabled correctly and visible to adb

  5. run project in Netbeans (F6) and select your device in top half of window (in section running devices)

  6. your app should be running properly on your real device, to see logs, you can use

    1. ./platform-tools/adb logcat -> debug messages in console
    2. ./tools/ddms -> gui to debug messages
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文