I installed Delphi XE5, I runned Delphi's Android Tools and updated all the packages suggested by it. Only then the Emulator worked.
Now I created some android apps as tests to run. In my phone they work, but when I press the run button, Delphi asks if I want to load and use the Android Emulator.
It starts Ok, then I unblock it by swapping the mouse, and after some seconds the app starts but I see only a totally black screen.
If I click home button on the emulator and then run again in Delphi, the black screen appears again, meaning that the app was load but it's main window do not load.
What my I be doing wrong?
If you have installed Eclipse and the android SDK tools for it you should change the default Delphi SDK settings.
Do this as follows:
In delphi open tab tools
options
SDK manager
Set de SDK properties to the eclipse locations on your computer
if you have done this correctly you should be able to make a new emulator in eclipse and see it in delphi.
When you create a new emulator you need to set the CPU to ARM and also check Use host GPU otherwise it can't run the delphi apps!
Are you using the emulator from within a virtual machine - e.g. Within parallels on a mac?. If so, you can pretty well forget being able to use the emulator.
The emulators are extremely resource hungry and are probably best run on a well-spec'd dedicated machine.
Related
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 have issues with the build in qemu emulator in Android Studio. There are some other Android emulators out there. How to configure Android Studio to use a different emulator? I use leapdroid emulator http://www.leapdroid.com to run apps and games.
Leapdroid is compatible with Android adb, i.e., using the same port numbers starting with 5555, so there is really nothing special to do, pretty much same as what you do with the built-in Android emulator. If you run "adb devices", you will see a device named as "emulator-5554".
Here are the steps:
Launch Leapdroid vm, which contains android 4.4.4 image
Launch Android Studio, and click Android emulator tab, a device named as "Emulator unknown 4.4.4" will show up inside the device list, and you can select it.
You should be able to see the logcat, and debug your Android app, etc.
Make sure that you close all other emulators first, in case there are conflicts.
I've also attached two screenshots for clarifications:
There are options like:
Genymotion: https://www.genymotion.com/
config with Androi Studio here
Visual Studio Emulator for Android
https://www.visualstudio.com/en-us/features/msft-android-emulator-vs.aspx
config with Android Studio here
I hope this help you
Did you try using Genymotion? It is the fastest emulator I've come across.
-Download it from their website for your required system specifications.
-You will also need an account to download the device images.
-Once all that is done, when you simply run the emulator, the device should show up in your ADB choose device window.
-You may also want to use Genymotion plugin for android studio for easy launch of virtual devices.
I create blank xamarin android project without add any code when i debug this project debugging without problem but when i run app with visual studio emulator for android emulator is running but not starting my app and deploy failed and don't show me error
why ?
please help me
I had the same issue. VS 2015 can launch the VS emulator but can't deploy the app.
I was able to solve the issue like this:
Launch the emulator (F5 in VS, then cancel the deployment using the Build/Cancel menu)
Click on the chevron icon (») in the toolbar to the right of the emulator
Select the Network tab
Locate the preferred network ip address
Back in VS, click on the Open Adb Command Prompt toolbar button
Type adb connect [the emulator ip address]
Press F5 again in VS
Looks like a VS bug to me.
I had the same issue. It turned out the root cause was that the VS Emulator couldn't find adb.exe.
When that happens it won't connect to the emulator unless you do the manual connection following the steps CSharpRocks gives. The emulator also won't be listed under "adb devices".
The fix for me was to reinstall the Android SDK, using the Windows EXE based installer (not the zip installer). The EXE installer sets the HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Android SDK Tools key, Path value, in the registry, pointing to the Android SDK root directory.
The VS Emulator uses that registry setting (or the Android Studio install registry setting) to find the SDK, assuming you didn't install the Android SDK with Visual Studio itself. With that, it should be able to find adb.exe and work.
Have a look here:
Xamarin Forms Android App Crashes Running Debug with VS Android Emulator
Start the Hyper-V manager
Select the emulator you are trying to use
Right-click, hit settings
Click processor
Click Compatibility
Set checkbox “Migrate to a physical computer with a different processor version”
I'm having a very similar issue. I have found two different kind-of-work-arounds, but have not yet figured out a full solution.
Start the emulator before trying to deploy to it
Launch the Visual Studio Emulator for Android application from the start menu.
Launch one of the available emulators via the green arrow
Attempt to again launch your application from visual studio, selecting the VS Emulator N-inch... emulator from the drop down menu
For me for some reason the app still doesn't "launch" on the emulator, although it is installed. So I have to open the application menu and select my app. Additionally it will usually crash the first several times I try to open it, but eventually displays my single default label, Welcome to Xamarin Forms!.
Run the application in Ad-Hoc mode
Before running the application, change the solution configuration (from the top toolbar next to the green "run" button) to Ad-Hoc.
The problem with both of these methods though is that I'm still not able to actually debug an application. I can run it, but my breakpoints are ignored and I think that will make finding bugs difficult once I actually start to write a real application.
I hope to update this answer once I figure out an actual solution.
I had the same problem yesterday. The problem appeared (probably) because I tried to start development after a long break. I updated VS and everything, but faced many issues.
Eventually you need to start fresh
Make sure SDK for emulator points to the right place (HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Android SDK Tools)
Run Visual Studio with Administrator privileges
Go to Hyper-V Manager and delete ALL Virtual Switches - let the system recreate them when needed. It will do it properly
Delete all existing emulators and recreate them in Visual Studio. I even found a comment to name them without spaces - not sure if it is needed, but wouldn't hurt.
Doing all this helped me. But I was on the verge of reinstalling Windows 10 clean. I think lots of things and configuration changed and are no longer compatible.
Try it enabling Hyper-V and using a Visual Studio Emulator from android; that worked for me after a lot of attempts and research
I had the same issue but in my case it was not the registry. After doing a release build, I deployed the app to the emulator device in release mode which pushes the app to the device and then effectively "disconnects". This leaves a version of the app on the device which seems to block further attempts at debugging or deploying.
I solved it by starting the emulator, going to "settings -> apps" and manually uninstalling my app. Then the next debug build & deploy worked again.
You could probably also manually start the emulator and say "wipe device" option so it starts fresh.
In VS2017, on a Windows10 machine, all I had to do to get the app to show up was turn off Mobile Data.
(swipe down or use settings, then click Mobile Data and confirm to turn it off).
After I turned it back on, I could access the app. Before doing this, it always seemed that the emulator ran, but wouldn't run the app.
... no idea why this worked, but I'm posting it here in case it helps someone.
During my troubleshooting process, I also looked at these articles:
VS Android Emulator wont run application
Troubleshooting the Visual Studio Emulator for Android
Update Your Path For The New Android Emulator Location
Install apache in VS 2015 here.
Visual studio requires apache to develop android apps.
You also may want to look at some other suggestions:
notshowing, troubleshooting
I had such issues before with the android SDK emulator, now I'm using Genymotion emulator instead of it, it is more light and faster and will be detected automatically by you VS once launched.
you can download the free version from here : https://www.genymotion.com/
and also you can download any device emulator.
I recently got into Xamarin development. I have a lot of experience in Xcode making iOS apps and the iOS side was very straight forward. Now I'm trying to implement Android. I downloaded a Hello World example to get my bearings. When I run it I have no problems getting the simulator to show up (MonoForAndroid_API_10 and MonoForAndroid_API_12) but the actual application doesn't run, and does not show up anywhere on the simulator. Essentially whenever I use run or run with in Xamarin on Android, it pulls up a fully functioning, albeit empty simulator.
How do I get my application to run on the emulator?
Like the other commenters, this is most likely just a symptom of slow emulator on your machine. I'm running Xamarin-Android development on my 2010-era OSX machine in mavericks with 8GB RAM, and it is slow-slow-slow, but usable. Try to find the Intel x86 speeds improvements (look for HAXM) and you will find that the emulator will be much much faster.
And yeah, get a real handset and plug it in to your computer: always much faster than emulation.
later edit Get Genymotion for Mac OSX or for PC/Windows or PC/Linux. It's way way way faster than the other emulators. I have since found that this is as fast, or faster, than running the App on my connected Android phone. It's certainly simpler in not having to have the device plugged into one of my USB ports, and allows me to code and test on the train. http://www.genymotion.com/
Don't know if my issue was the same but finally this troubleshooting helped me to run emulator https://msdn.microsoft.com/en-us/library/mt228282.aspx#ADB.
I was missing key Android SDK Tools with string value Path in registry Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node
I've created it manually and it worked.
UPDATE
Before I got the issue with running emulator, I couldn't see it in Visual Studio. The reason was I've installed VS Android Emulator through standalone installation, not through VS Installer. It had to be installed there as well.
I had the similar issue, and then I deleted the existing device simulator and reinstalled again and it started working.
As I use a different SDK, in my case
Go to Tools > Options > Xamarin and set the Android SDK path.
Sometime Visual Studio changes this configuration;
2020 Update:
I followed the most voted comment, however, with Visual Studio 2019 updated recently, the steps have changed a little. Here is what previously worked:
WHAT WORKED BEFORE
"Don't know if my issue was the same but finally this troubleshooting helped me to run emulator https://msdn.microsoft.com/en-us/library/mt228282.aspx#ADB. I was missing key Android SDK Tools with string value Path in registry Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node
I've created it manually and it worked."
WHAT TO DO INSTEAD
Nothing. Don't mess with the path.
WHAT WORKED BEFORE
"Before I got the issue with running emulator, I couldn't see it in Visual Studio. The reason was I've installed VS Android Emulator through standalone installation, not through VS Installer. It had to be installed there as well."
Previous instructions image
WHAT TO DO INSTEAD
a. Go to Tools located at the top of the VS window, Get Tools and Features, go to Individual components, using the search tool in the pop up box, search "emulator", once you get the result, make sure both Google Android Emulator (API Level 25)(local install) and Intel Hardware Accelerated Execution Manager (HAXM) (local install) are both checked.
b. Close the solution(s) and restart VS then reopen the solution(s).
c. To deploy the app on the emulator, click Start button to spin up the emulator, left click on your Android project, then click Deploy. You should be able to see your app on your emulator's app menu.
Updated Instructions image
Worked for ME
Sometimes you close the android Emulator but not POWEROFF the Emulator.
this problem happens when emulator shutdown un-properly.
Restart Your EMULATOR
First start your emulator
Then restart your emulator by pressing down the power button and select restart option in your android emulator.
I enabled Hyper-V acceleration based on microsoft documentations: https://learn.microsoft.com/en-us/xamarin/android/get-started/installation/android-emulator/hardware-acceleration?tabs=vswin&pivots=windows#accelerating-with-hyper-v
Basically you need to turn on these two windows features from the control panel (Turn windows features on of off):
Hyper-V.
Windows hypervisor platform.
then from visual studio go to: Tools >> Android >> Android SDK manager >> Tools >> make sure that "Android emulator" version is 27.0.1 or higher, if not, you will find in the same screen a button below to update it.
I did this on windows 10 64-bit, with VS 2017 Community 15.9.5
I've followed all the instructions at http://developer.android.com/training/basics/firstapp/running-app.html to make a "hello world" app, but despite everything I try, nothing is happening on my device.
I've installed Samsung Kies for what it's worth, and my phone is detected by the OS for file transfer... but when I "Run As - Android Application" in Eclipse, nothing happens at all.
USB debugging is on for my phone.
Edit (June 7, 2013):
I've removed my old installation of Eclipse and the android SDK and downloaded the bundle from http://developer.android.com/sdk/index.html. Still nothing will happen when I try to run as Android Aplication.
I've run adb devices and I get the following output, so I guess my phone is detected:
List of devices attached
42f78b1517259fe5 device
I managed to find a way to add a device to Eclipse, as Galaxy Note 2 wasn't in the dropdown box... but that doesn't seem to do anything other than change the preview image in the activity editor.
I'm not sure if I did it right, but here's the logcat -d dump as suggested
http://pastebin.com/fmrPn3UU
My phone is running 4.1.2. I don't know what else to try, and I can't seem to find out anything else online.
Try forcing Eclipse to prompt you for a device to choose. See if it still does nothing, or if it actually runs.
To allow Eclipse to prompt you:
Open the Run menu > Run configurations
Within the new window, under the Android Application
If you have any configuration, delete the configuration
Create a new configuration by double clicking Android Application or clicking the New button.
Under the Android tab
Select your Android app project within the Project box
Launch action should be Launch Default Activity
Next, open the Target tab
Select Always prompt to pick device
Click Apply
Click Close
Now the next time you run your application, it will ask you to start your application in your phone or an emulator.
If you want to use the same one for the duration of your eclipse session, or until you've unplugged your phone, check the Use same device for future launches box.
This also has the added benefit of allowing you to choose different AVD versions to test your app on different devices or emulators easier.
Update from comments
To force stop your app if completely necessary
Go to the DDMS perspective within Eclipse
Window > Open Perspective > DDMS (it's it not listed, click Other...)
Click your process such as com.example.testapp
Click the Stop button (red stop sign)
I think your question is
Q: "Should I be able to run and debug my Android application on a physical handset, not just the emulator?"
A: Yes, absolutely. Including your Galaxy Note 2
Look here:
http://developer.android.com/tools/device.html
This is basically exactly the same, except it gives details specifically for the Galaxy Note:
http://www.technipages.com/samsung-galaxy-note2-how-to-enable-usb-debugging.html
BOTTOM LINE:
You should be able to debug using either/both an emulator and/or a physical handset, all from your Eclipse IDE.
'Hope that helps..
Try using the Galaxy Note 2 toolkit from XDA and installing the drivers that way, then manually set up your device in Eclipse.
Try looking at your AndroidManifest.xml file in your Android project. I believe your note 2 is running Android 4.1.2 (which is revision 16).
If your Hello World application has the minimum SDK version requirement set to be 17 or higher, your device will not be recognized on the available devices. Change android:minSdkVersion attribute in uses-sdk tag to android:minSdkVersion="16" and it will be displayed.
In 'USB PC connection' in the floating menu there are two options. In my cell was labeled 'Media Device' and I switched to 'Camera' and started to work.
I got the same problem. I am using MAC. I downloaded Eclipse(Java Standard 4.4) first and then installed ADT from eclipse manually. My code works and it can only run in emulator. It cannot find the Note2. I install Android Studio and it works with my Note2. Tried many methods but my eclipse cannot find my Note2. so I download the Android ADT from android.com directly and it works with my Note2. Since we can have two Eclipse on one computer, so it you can keep both Eclipse like me. One for PHP and one for Android. If you have the same problem, please try it.