i have android device, how can i run the application connecting with my system instead running in the emulator.
Connect your device via USB to your computer:
http://developer.android.com/guide/developing/device.html
And then adb should use preferentially the hardware device over the emulator.
http://developer.android.com/guide/developing/building/building-eclipse.html
Automatic and manual target modes
By default, a run configuration uses
the automatic target mode in order to
select an AVD. In this mode, ADT will
select an AVD for the application in
the following manner:
1) If there's a device or emulator already running and its AVD
configuration meets the requirements
of the application's build target, the
application is installed and run upon
it.
2) If there's more than one device or emulator running, each of which meets
the requirements of the build target,
a "device chooser" is shown to let you
select which device to use.
3) If there are no devices or emulators running that meet the
requirements of the build target, ADT
looks at the available AVDs. If there
is an AVD that matches the build
target of the project, ADT chooses
that AVD. If the AVD versions are
newer than the build target of the
project, ADT chooses the oldest
possible version of an AVD that meets
the project's build target
requirement.
4) If there are no suitable AVDs, the application is not installed a console
error warning tells you that there is
no existing AVD that meets the build
target requirements.
However, if a "preferred AVD" is
selected in the run configuration,
then the application will always be
deployed to that AVD. If it's not
already running, then a new emulator
will be launched.
If your run configuration uses manual
mode, then the "device chooser" is
presented every time that your
application is run, so that you can
select which AVD to use.
You have 2 options:
Via ide plugin. Eclipse and IDEA both are able to lauch and debug applications on the real devices, only thing you need is the driver installed for your mobile.
Via apk. Just make an apk, copy it to sdcard, and install it from your device using some file manager like ASTRO.
You can also do it in another way. Attached your .apk file and mail it to your mail account. Then login to your account(account that you send the .apk file) on device, download the .apk file and install it on your device.
Related
I got an app that I'm perfectly able to run/debug while connected through USB from Android Studio on my Nexus 5 (Android 6) and LG Stylus 2 Plus (Android 8) phones, but it seems to fail when testing it on my Huawei P30 (Android 9).
I'm able to see all 3 devices as available from Android Studios' "Device File Explorer" tab, and browse the files in it, so I know that it is able to connect just fine.
Still, whenever I try to debug or run the app on my Huawei, the app is built, and as soon as it is going to start the install process, the phone disconnects and is immediately reconnected to the PC, resulting in a failed installation attempt.
All I can see from Android Studio is the following message:
Installation did not succeed.
The application could not be installed.
Installation failed due to: 'device 'ABCDEFGHIJKLM' not found'
I did have trouble getting the right drivers for the Huawei P30, but I believe that if I'm able to see the phone's files now, this should not be a driver issue anymore.
I've tried every phone configuration in the phone's developer options that I could find to no effect.
TL;DR:
These two android tools' versions were outdated:
Android SDK Build-Tools
Android SDK Platform-Tools
Update all android tools to the latest version, and make sure no old ones linger around, and you should be good to go. =)
After I tried to upload the APK directly into my phone from Android Studios' "Device File Explorer" tab and it failed with the same behaviour, I knew something was wrong with the adb-server. So I proceeded to run the adb directly from the console with the following commands:
$ adb start-server
$ adb push abcdefg.apk
The server started just fine, and resulted in the same behavior, but this showed me a new error/warning message that I was never shown in Android Studio:
adb server version (30) doesn't match this client (41); killing...
This was enough for me to find questions and blogpost like this one: How to resolve - “adb server version (32) doesn't match this client (36); killing…”
I guess this phone is very new compared to the old Android tools I have installed, so basically, all I had to do was to update these 2 tools (to the latest version) from the Android Studios's Android SDK configuration menu:
Android SDK Build-Tools
Android SDK Platform-Tools
Now, it is very important that you uninstall any old version of the tools that you may have lying around so that there is no chance that those get used (because it did happen to me during the process). You can check it by clicking the "Show package details" checkbox, and only check the latest version:
After this, kill adb from the Task Manager (if it was running), and restart Android Studio. This should make sure you are not using any old version.
I am new in android and trying to run a simple Hello world! program using android studio. I defined an AVD which is a Pixel device with API version 28 (Pie). When I run the program, the emulator gets up, but it doesn't load the application. I have tried following, but none of them worked:
Restarting avd server from command-line.
Changing skin to QVGA.
Creating a new emulator.
Setting graphics to software.
Any idea on the issue?
I think you do not enabled USB Debugging in your AVD.
Try this steps:
1- go to your AVD setting
2- System
3- About Device
4- Multiple Clicks on Build Number
5- Go back to setting
now you see Developer Options
6- goto developer options
7- check USB Debugging
Hope to be useful
Have you enabled USB debugging inside the emulator?
Before you create an Android emulator, you need to install an Android system image that your emulators can use.
Note: If you installed the Android SDK and NDK during RAD Studio installation, a valid Android system image (such as Android 4.2.2 API 17) should already be shown as Installed in the Android SDK Manager. In this case, you do not need to install another Android system image.
Still, if you are not able to run the emulator then try this Memu Emulator
This is a very small and simple emulator to use and install. It works perfectly on every pc.
I am doing some applications using Android + Eclipse to run on tablets. I have had too much trouble with the tablet emulator, so I would like to try my code (apps) on a real tablet. How can I do this? I have a Samsung Galaxy Tab 3. Do I need to install the adt-bundle on it?
I'd appreciate any input.
http://developer.android.com/tools/device.html
You just need a usb cable to connect your device to your pc.Go to the above link for more info
check this it may help you Run on a Real Device
Here is a copy paste, but check the link it's really good and well explained :
If you have a real Android-powered device, here's how you can install and run your app:
1-Plug in your device to your development machine with a USB cable. If you're developing on Windows, you might need to install the appropriate USB driver for your device. For help installing drivers, see the OEM USB Drivers document.
2-Enable USB debugging on your device.
On most devices running Android 3.2 or older, you can find the option under Settings > Applications > Development.
On Android 4.0 and newer, it's in Settings > Developer options.
Note: On Android 4.2 and newer, Developer options is hidden by default.
To make it available, go to Settings > About phone and tap Build number seven times. Return to the previous screen to find Developer options.
To run the app from Eclipse:
1-Open one of your project's files and click Run from the toolbar.
2-In the Run as window that appears, select Android Application and click OK.
Eclipse installs the app on your connected device and starts it.
Or to run your app from a command line:
1-Change directories to the root of your Android project and execute:
ant debug
2- Make sure the Android SDK platform-tools/ directory is included in your PATH environment variable, then execute:
adb install bin/MyFirstApp-debug.apk
3-On your device, locate MyFirstActivity and open it.
We are currently using Worklight Enterprise Edition running in Windows. We created a mobile application using jQuery Mobile (and another Using Dojo Mobile) but we were unable to deploy it to a the device.
After developing the application we generated the (unsigned) .apk file
We copied it to Samsung Grand (android version 4.1.2) to test it
When we try to open the .apk file, we get the error: There is a problem parsing the package.
Is this the correct procedure to install the .apk file in device?
Try the following:
Make sure the device is setup for development. Follow these instructions to enable so.
Connect your device to the computer using a USB cable
In Eclipse, make sure that the device is recognized in the Devices view (Ctrl+3 and search for "Devices" to add the panel).
Right-click on your Worklight application and choose Run As >> Build All and Deploy
Right-click on the generated Android project (should appear below the Worklight project) and choose Run As >> Android Application
This will generate an unsigned .apk and install it onto the device.
Observe LogCat (Ctrl+3 and search for "LogCat" to add the panel) for errors.
If you cannot connect the device to the computer:
Make sure the enable the option to allow installing applications from "Unknown Sources".
Setup an email account on the device and email the .apk to yourself. Tapping the attached .apk should then install it.
Alternatively, and only if your device is rooted, you can use an app called ADB Wireless, which allows remote installing and debugging of applications.
As a final attempt,
From the Android SDK Mananger, install API Level 8.
Go to the android\native\AndroidManifest.xml file and change minSdkValue to 8.
Build and deploy, install on device.
Is there a way to test the application on the real device without publishing to Android market?
It can be easily done. just connect the phone to you computer, install the drivers that come with the SDK.
Now if you are using eclipse then just go to the "run configuration" of your project and select manual in the Target tab. Now when you run your application through eclipse you will get to select the device on which to run the application and there you can see your device.
Alternatively, the same can be done via command line by typing adb install <app_name> and the application will automatically be installed to you phone. While using command line make sure that you are not sunning any emulators, else adb will give an error since it will confused on where to install the application.
On a device, turn on debug mode (in the Applications menu under Settings). When you plug your device in, it will show up alongside your emulators. If you have no booted emulators, running or debugging your app will automatically default to your device.
Hope this helps!