Ubuntu 12.10 + Eclipse 3.8 setup for Android questions - android

So, I'm just trying to get into Android development and trying to setup my system with eclipse so I can run through the tutorials and whatnot to familiarize myself with the ecosystem. I'm running this on Ubuntu 12.10 (amd64) with eclipse version 3.8. I've run into a couple issues/questions with the initial setup and I'm not sure what to do about them...
1 - I don't seem to get the "adb devices" command to see any devices. I have both a Verizon Galaxy Nexus and a Nexus 7 tablet connected to my system and nothing is seen. I tried adding a couple Vendor IDs to the adb_usb.ini file, but that doesn't seem to have done the trick. The two IDs I added are "0x4e41" and "0x18d1" - I thought the latter was the "Google" device ID, but I'm obviously mistaken somewhere.
2 - I don't have anything configured under the "Run" button and I'm not sure how to configure running apps through the AVD emulators or through a device. I'm pretty sure I'm not going to be able to run any apps through my devices since adb isn't seeing them, but I do have a 4.1 AVD setup, which should be able to run any apps created. How do I configure the Run button to push the app through the emulator? Does it need to be started first or can it start the emulator and push the app automatically? Also, once I resolve the issue above in part 1, how do I configure the Run button to send apps to either of my devices?
Any/all help would be much appreciated. Thanks in advance.
EDIT: As both comments up till this point have mentioned using the Run menu, but I don't seem to have the same Run menu as either of you. The only thing I have under the Run menu is
"External Tools", then under that is
"Run As" (which is a sub-menu with nothing under it - I assume since I've not configured anything),
"External Tools Configuration..."
"Organize Favorites...".
I'm not seeing anything relating to "Run Configurations" at all.
EDIT2: I just tried adding the udev rules file as mentioned in the "Using hardware" page on d.android.com and that doesn't seem to have had any affect (even after reboot). Still not able to see any devices in "adb devices". And, yes, my devices both have USB debugging turned on.
EDIT3: Seem to have gotten the devices to show up in the adb devices listing, but still not sure how to load the apps onto them automatically. Also, I tried running the "ant debug" command listed on http://developer.android.com/training/basics/firstapp/running-app.html and I'm getting an error of:
Buildfile: build.xml does not exist!
Build failed
Not sure what should be in the build.xml file as this is just supposed to be the tutorial app.

Usb does not need to be set up on ubuntu
you may need to switch adt from stable to beta see notes - that may work
reinstalling does not work.
I did the upgrade and adt broke completely - fails on WST or something like that.

Have a look at the tutorial at http://developer.android.com/tools/device.html
First make sure that you have the USB drivers. Make sure your Nexus device is set up for development. Load your drivers. It may be necessary to restart Eclipse to ensure that your new config takes effect.
You can start your AVDs through the AVDManager, or from Eclipse. Go to Run-> Run Configurations to set up which device to send apps to, or which emulator to start up.

1) Have you set your Application to debuggable? Also, don't forget to set your device up to USB Debugging mode.
Then try this at the terminal:
cd android-sdk-linux/platform-tools/
su
killall adb
./adb usb
2) Go to Run > Run Configurations > Target tab > Select your 4.1 AVD (on Automatically pick compatible device) and hit run. After that you will just have to click on run do test your app.

Related

Android Studio not installing app on device, no error messages

I have a clean Android project on Android Studio (just with a "hello world' screen), and I'm trying to install the app on my Samsung Galaxy S10e.
I click the Run button, and this is what I see in the Build Output:
And the apk is generated successfully.
But it's not launched and not installed on the device (no icon, and it doesn't appear in the apps list).
When I try manually installing the apk by adb install app-debug.apk, it works. The app shortcut appears on the device, it's added to the apps list, and I can launch the app.
At first also adb install didn't work, giving out the error INSTALL_FAILED_TEST_ONLY, but I solved that by adding android.injected.testOnly=false to gradle.properties.
I tried changing Gradle version to 6.0.1 (looks like this is the latest at the moment), and it didn't help.
I also have my device selected at the top:
How can I make Android Studio install and launch the app on my device?
Android Studio version: 3.5.3
Edit:
I'm seeing the same behavior on an Emulator. I opened AVD from Android Studio and chose Pixel 3A. The emulator opens up, I run the app, nothing happens on the emulator (and I see the same Build Output messages).
The same happens to me. It is probably a bug in Android Studio. At the second compilation the app installs correctly. It is tedious.
There isn't enough information to find the cause of this issue.
But since it works with adb, it means you run adb command. There could be only one instance of adb daemon running. So if it's involved externally my guess is Android Studio won't have access to it.
Possibly try adb kill-server and running again from Android Studio and see if that helps.
I encountered the same problem, which I solved by checking the running devices. The connected phone had 2 accounts (might be personal & work) which was listed on the list of devices, so I had to select the second option, and it ran successfully on my phone. see the attached image.
One thing it might be:
Enable usb debugging
Settings
System
Developer options
Turn the setting on for usb debugging
If it does not appear go to settings about phone. Then click on build number like 7-10 times and it will enable you to have the developer options appear.

nexus 7 with flash builder Error adobe air version not installed state offline

I've done a bit of research since my previous question was not considered question. I have nexus 7 to use it with Flash Builder 4.6.
I initially downloaded Android SDK and installed the Google USB driver. I turned on the debugging option for my nexus, and I also made USB computer connection to PTP connection.
Finally, I run an app from Flash Builder I get the following screen:
I try to uninstall adobe air and re-install but it didn't work. Please, I need your help. My laptop is windows 7 OS. I also run command line and checked my platform-tools and run adb devices.
It recognizes my nexus is attached with its serial number and ‘device’ word. One more thing, the nexus connection also show the device is charging.
I was having the same issue. As user user1986244 said, I had to do some moving around of executables.
I placed all the .EXEs (adb.exe and others) as mentioned into the
<FlashBuilderDir>\sdks\4.6.0\lib\android\bin folder, but, I also had to place them here:
<FlashBuilderDir>\eclipse\plugins\com.adobe.flash.compiler_4.7.0.349722\AIRSDK\lib\android\bin
It then asked me to install the AIRSDK and my application began working.
I'm assuming there is a more elegant solution here, but, I've yet to find it.
For two days, I try to find solution. Finally worked. I want to go through the steps. After installing android sdk that comes with ADT bundle. Running sdk manager. Check Tools and google usb driver from options list. My device is nexus seven. Then I installed Flash builder 4.6. I created simple Hello program, and run. But gave me screen 'adobe air not installed' and state 'offline', as I mentioned in my initial question above.
Next, I read a post from adobe forum help, that says copy adb.exe from android ADT folde and paste it to flash builder. My actual path goes like this in the ADT folder sdk/platform-tools/adb. So I copy adb and went to Adobe flash builder 4.6 folder/sdks/4.6.0/lib/android/bin. In this folder i pasted what I copied, pop up message says you cant paste it is open. Instead of making it skip. I ctrl + alt + delete and close adb.exe from applications. Now, I went back and clicked try again. It pasted it
Next run my android test, it asked me 'would you like to install adobe air?' on your device. I clicked yes, then it worked.
You may have to install drivers manually
http://fr.asus.com/Tablet/Nexus/Nexus_7/#download
Then allow usb debugg on your device
Like LordJalek said, I had to copy adb to these two folders. If those folders does not exists locate them from Flash Builder preferences. Then I was neccessary to restart adb:
adb stop-server
adb start-server
Then when I clicked on refresh on the "Choose Device" screen it worked and now I see my device online.

First app for android after eclipse install

I've searched around and can't quite find the exact situation or answer that I need, so I'll have to ask a question that I'm sure has been asked somewhere out there, so my apologies. But I need help.
First time attempting to create an app, I installed Eclipse (both the entire kit from the android development site, and classic), installed the android sdk, and the plugin. Java is on my machine. I have everything that I need to get started. I was going through the tutorials on the android developer site for the first time user. Eclipse generates the "hello world" app as it should. I have my GS3 plugged in through USB with the driver installed and the system sees it. I click run as > android application... and to no surprise, nothing happens. No error message, no screen flash, no app on the device, nothing. So I tried to run it in an emulator. Not too clear how to set it up because the instructions are vague, but I got an emulator going and try to run again... nothing. No attempts to and then fails, no build errors.. no quick command prompt flashes, just nothing. The IDE just sits there as if I never clicked anything. What am I doing wrong here? Thanks in advance for helping
My current setup is
Win8 machine
Eclipse Classic (because the one provided on the site wouldn't install the plugin)
Android SDK 21.1
Eclipse Plugin for Android dev
Java JDK 1.7
Samsung Galaxy S3 device with driver installed and set to USB debugging
First of all you have to enable developer option (USB Debugging), then connect your device, now check whether adb recognise your device or not.
to check device status open DDMS perspective then click on Devices option. if your device is not listed, then restart your adb to do that go to adb path in command prompt/terminal then execute following commands
adb kill-server
adb start-server
adb devices
that's it now you can run application in your device

executing an app from eclispe onto HTC Hero

I've come to a point in my development where it's about time I test the app on an actual device and so I a trying to do that on my old HTC Hero.
I've followed the instructions on the developers website for android at this link: http://developer.android.com/training/basics/firstapp/running-app.html and everytime I go to 'Run' the app it tells me there is "No active compatible AVD's or devices found. Relaunch this configuration after connecting a device or starting an AVD."
When I look at the setup of the app it's configured for Android 2.1 (api 7) and the HTC Hero is Android 2.1 (update-1). I have gone into settings>Applications>Development on the phone and set it to allow debugging through USB.
Therefore I am really struggling to find out how to fix this.
Make sure the phone is set to file mode (e.g. you can open it as if it were another disk drive). Some modes can prevent adb from picking it up. If it were a version problem, Eclipse would say that, it wouldn't just not show any device.
To rule out it being a config issue in eclipse, you should be able to call 'adb logcat' in command line (find adb in your android-sdk directory under platform-tools/adb.exe) and it should spit out the log for your phone (and not say something like 'waiting for device').
Finally, you may need specific drivers for some phones (e.g. HTC Sync). If you're on linux, you can setup udev rules for it http://developer.android.com/tools/device.html#setting-up

Android Device Disappearing

I have installed the Android SDK and plugin for Eclipse and written my first test app. I am trying to view the device in the DDMS section of Eclipse, but my Android Virtual Machine is usually not listed in the Devices section when it is running. Occasionally it will appear for a minute only to disappear again. I found an article recommending that I run adb kill-server to get it to restart and appear. This works about 50% of the time, but the device just disappears again in 10-60 seconds.
My main desire with this is to push some files to the sd card on my Android Virtual Machine, but the device doesn't stay visible long enough to push any data to it.
Thanks!
I have found that if my Android mobile is connected via USB then a running emulator may be hidden.
Alternatively, if you mean the devices list in Eclipse 'Run As' then it is possible the 'target version' of your android project in eclipse is set to a higher SDK version than the version of the emulator you would like to deploy to.
The 'target version' is set in 2 files, both of which can be viewed in the root of your eclipse project:
default.properties
AndroidManifest.xml
E.g. to include Android emulators from 1.6 upwards you should find the following in default.properties:
target=android-4
and the following in AndroidManifest.xml
<uses-sdk android:minSdkVersion="4"/>
To edit default.properties right-click the eclipse project/Properties/Android then select the lowest installed version of the Android SDK.
To edit AndroidManifest.xml double-click on the xml file and on the first tab set the 'Uses SDK' 'Min SDK version' to 4.
It happens to me from time to time. I just reopen the emulator and it works.
If the AVD disappears very fast I would try pushing files using adb.
adb push <local> <remote> - copy file/dir to device
I had similar problems with Eclipse launching my AVD's but them coming up disabled or offline. In Linux, I could see the process running, and "ADB Devices" reported that they were there, but offline. I would sometimes need to launch the AVD from the AVD Manager and select "clear user data". It would take a couple of rounds of this before my AVD would launch correctly, but the problem always returned. Something in my code was causing the AVD to get into a bad state and prevent it from launching cleanly.
I have since created a new project and started a new version of my app, and the problem has not returned.
Best I can come up with is to restart the adb server with adb kill-server; adb start-server . Blog post

Categories

Resources