开发者

How to test app on Android device

I have my app on eclipse and I'd like to test it on Nexus S. I use Ubuntu 10.04 and Eclipse Helios. I'm searching for it on web but cant find it. If someone knows how to launch the app 开发者_C百科on Nexus S tell me detailed please. Thanks!


I right clicked on the project and selected Android Tools > Export Signed Application Package and then I choosed the location of the .apk package. And then in the terminal I typed ./adb install .


Also there is another way. The better way from my point of view.

Via Terminal or Command Prompt, access the platform-tools directory.

With your phone set to usb debug mode and disconnected from PC usb, type in terminal or command prompt:

windows: adb kill-server

linux: ./adb kill-server

and then

windows: adb start-server

linux: ./adb start-server

now type this for check if it worked, it should show the device ID

windows: adb devices

linux: ./adb devices

Now, just go to eclipse and set the IDE to run the app on the device and run it.


UPDATE

As the API has changed in the earliest versions, I advise you to follow the API documentation.

http://developer.android.com/tools/building/building-eclipse.html#RunningOnDeviceEclipse

http://developer.android.com/tools/device.html


All purpose explanation

  • Always do this

    1. On your phone: settings >> applications >> unknown sources = true
    2. On your phone: settings >> applications >> development >> usb debugging = true

      • If you are on a mac that should be it, if you are on windows you might also need this and if you are on unix you might also need some sort of udev rules, which I do not understand but which are to a certain extent also explained here again...
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜