如何使用 Samsung Galaxy 5 设备开发 Android 应用程序?

发布于 2024-09-26 18:06:29 字数 815 浏览 4 评论 0原文

我正在开发我的第一个 Android 应用程序。我有一个应用程序已经在 2010 年 4 月发布的 Ubuntu 10.04 LTS(Lucid Lynx)上的模拟器(Eclipse + Android 开发工具)上运行。我已经尝试过 此链接上 Android 开发者门户 上提供的步骤,但每当我尝试使用 ./adb devices 列出已连接的设备时,我会得到以下信息

mmaia@mmaia-desktop:~/tools/android-sdk-linux_86/tools$ ./adb devices
List of devices attached 
????????????    no permissions

:已检查,当我运行虚拟模拟器时,相同的命令返回:

List of devices attached 
????????????    no permissions
emulator-5554   device

另外,当我要求 Eclipse 运行模拟器时,它会找到设备(galaxy 5),请参见下图,但找不到序列号,可能是因为某些权限,而不是我只能选择虚拟模拟器。

alt text

在 Ubuntu 10.04 下进行 Android 开发时,如何配置使用 Galaxy 5 作为设备的权限?

[]s

I am developing my first Android App. I have an application already running on emulator (Eclipse + Android dev. tools) on Ubuntu 10.04 LTS - the Lucid Lynx - released in April 2010. I have already tryied the steps provided on Android Developers Portal on this link, but whenever I try to list my already connected device using ./adb devices I get the following:

mmaia@mmaia-desktop:~/tools/android-sdk-linux_86/tools$ ./adb devices
List of devices attached 
????????????    no permissions

I have checked and when I run the virtual emulator the same command returns:

List of devices attached 
????????????    no permissions
emulator-5554   device

Also when I ask eclipse to run the emulator it finds the device(galaxy 5), see image below, but can't find serial, probably because of some permission, than I am only able to choose the virtual emulator.

alt text

How do I configure permission to use Galaxy 5 as a device while developing for Android under Ubuntu 10.04?

[]s

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

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

发布评论

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

评论(7

跨年 2024-10-03 18:06:29

转到 Android SDK 文件夹中的 platform-tools 目录。从终端输入“sudo ./adb Kill-server”。这将停止 adb 服务器,现在,以超级用户身份重新启动它,如“sudo ./adb start-server”。您的设备现在应该可以被检测到。

Go the platform-tools directory in the Android SDK folder. From the terminal, type 'sudo ./adb kill-server'. This'll stop the adb server and now, restart it as the super user as 'sudo ./adb start-server'. Your device should be detectable now.

小糖芽 2024-10-03 18:06:29

只是一些想法:

确保您不仅创建了 udev 规则,而且还执行了

chmod a+r /etc/udev/rules.d/51-android.rules

在插入手机后不久使用 dmesg 来验证它是否正确枚举作为 USB 设备。

看看是否可以启动 adb shell

您可以安装大容量存储吗?这不是一个开发功能,但至少可以测试 USB 是否正常工作。

Just a few ideas:

Make sure you not only created the udev rules, but also did

chmod a+r /etc/udev/rules.d/51-android.rules

Use dmesg shortly after plugging in the phone to verify that it's enumerating nicely as a usb device.

See if you can get the adb shell up

Can you do a mass storage mount? That's not a development function but would at least be a test that the usb is working.

我不是你的备胎 2024-10-03 18:06:29

我以前从未这样做过,但猜测这可能是你的手机。您启用了开发选项吗?

您可以通过在主屏幕上按菜单键,依次转到“设置”、“应用程序”和“开发”来完成此操作。如果不是这样,我会尝试让我的回复再次工作。

I have never done this before, but at a guess it could be your phone. Have you enabled the options for development?

You can do it by hitting the menu key when you are on the home screen, go to settings, then applications, and then development. If this isn't it, I will try to get mine working at reply again.

追风人 2024-10-03 18:06:29

重新启动 Ubuntu 后,我重试了,现在错误有点不同了。当我运行 adb devices 时,我得到:

mmaia@mmaia-desktop:~/tools/android-sdk-linux_86/tools$ ./adb devices
List of devices attached 
????????????    device

看起来缺少一个 id?
比当我从 eclipse 尝试时它给出了错误:

[2010-10-07 21:32:56 - AnototudoAndroid] ------------------------------
[2010-10-07 21:32:56 - AnototudoAndroid] Android Launch!
[2010-10-07 21:32:56 - AnototudoAndroid] adb is running normally.
[2010-10-07 21:32:56 - AnototudoAndroid] Performing br.com.anototudo.MenuPrincipalActivity activity launch
[2010-10-07 21:32:56 - AnototudoAndroid] Automatic Target Mode: Unable to detect device compatibility. Please select a target device.
[2010-10-07 21:33:02 - AnototudoAndroid] WARNING: Unknown device API version!
[2010-10-07 21:33:02 - AnototudoAndroid] Uploading AnototudoAndroid.apk onto device '????????????'
[2010-10-07 21:33:02 - AnototudoAndroid] Failed to upload AnototudoAndroid.apk on device '????????????'
[2010-10-07 21:33:02 - AnototudoAndroid] java.io.IOException: device (????????????) request rejected: device not found
[2010-10-07 21:33:02 - AnototudoAndroid] Launch canceled!

[]s

After restarting Ubuntu I have retried and now the error is a bit different. When I run adb devices I get:

mmaia@mmaia-desktop:~/tools/android-sdk-linux_86/tools$ ./adb devices
List of devices attached 
????????????    device

It looks like there is an id missing??
Than when I try from eclipse It gives the error:

[2010-10-07 21:32:56 - AnototudoAndroid] ------------------------------
[2010-10-07 21:32:56 - AnototudoAndroid] Android Launch!
[2010-10-07 21:32:56 - AnototudoAndroid] adb is running normally.
[2010-10-07 21:32:56 - AnototudoAndroid] Performing br.com.anototudo.MenuPrincipalActivity activity launch
[2010-10-07 21:32:56 - AnototudoAndroid] Automatic Target Mode: Unable to detect device compatibility. Please select a target device.
[2010-10-07 21:33:02 - AnototudoAndroid] WARNING: Unknown device API version!
[2010-10-07 21:33:02 - AnototudoAndroid] Uploading AnototudoAndroid.apk onto device '????????????'
[2010-10-07 21:33:02 - AnototudoAndroid] Failed to upload AnototudoAndroid.apk on device '????????????'
[2010-10-07 21:33:02 - AnototudoAndroid] java.io.IOException: device (????????????) request rejected: device not found
[2010-10-07 21:33:02 - AnototudoAndroid] Launch canceled!

[]s

写下不归期 2024-10-03 18:06:29

如果在执行kill-server 和 sudo ./adb devices 后问题仍然存在,那么您可能有 eclipse 与 adk 内容一起在后台运行。退出它以正确枚举设备

If the issue persists after doing the kill-server and sudo ./adb devices, then you prob have eclipse running in the background with the adk stuff. Exit it to enumerate devices properly

最近可好 2024-10-03 18:06:29

打开终端
类型 '

lsusb

'

您将获得连接到系统的 USB 驱动器列表,如下所示。

总线 002 设备 004:ID 04e8:681c 三星电子有限公司

复制所需的 USB 信息以供进一步使用,然后在终端中再次键入以下内容

sudo gedit /etc/udev/rules.d/51-android.rules

您将得到一个记事本,将以下代码行粘贴到其中

SUBSYSTEMS==“usb”,ATTRS{idVendor}==“04e8”,ATTRS{idProduct}==“681c”,
模式=“0600”

将vendor和idProduct的值修改为我们从lsusb命令中获取的04e8:681c的值。

保存并使用以下命令重新启动 adb 服务器。

杀死服务器
adbkill-server 或 sudo ./adbkill-server

启动服务器
adb start-server 或 sudo ./adb start-server

现在您将连接到设备。

Open the Terminal
Type '

lsusb

'

You will get the list of USB drives connected to the system as shown below.

Bus 002 Device 004: ID 04e8:681c Samsung Electronics Co., Ltd

copy the required USB info for further usage and then type below in the terminal again

sudo gedit /etc/udev/rules.d/51-android.rules

You will get a notepad, paste the below line of code in that

SUBSYSTEMS==”usb”, ATTRS{idVendor}==”04e8″, ATTRS{idProduct} ==”681c”,
MODE=”0600″

Modify the values of vendor and idProduct with the values of the 04e8:681c which we got from the lsusb command.

Save it and restart the adb server by using below commands.

Killing Server
adb kill-server or sudo ./adb kill-server

Start Server
adb start-server or sudo ./adb start-server

You will get connected to the device now.

若相惜即相离 2024-10-03 18:06:29

我有一台 Galaxy 5,使用方法如下:

  1. 打开终端并输入您的平台工具文件夹

    $ cd /yourSdkDirectoryInstallation/android-sdk-linux/platform-tools/
    
  2. 作为 root 终止并重新启动 adb 服务器:

    # ./adb Kill-server && ./adb 启动服务器 
    


    $ sudo ./adb Kill-server && sudo ./adb start-server

I have a galaxy 5 and I use as follow:

  1. open the terminal and enter in your plataform-tooles folde

    $ cd /yourSdkDirectoryInstallation/android-sdk-linux/platform-tools/
    
  2. as root kill and restart adb server:

    # ./adb kill-server && ./adb start-server 
    

    or
    $ sudo ./adb kill-server && sudo ./adb start-server

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文