Android:Simulator instance newly opens every time - android

I have been trying to search about this issue in the forums etc. but have not found any solutions yet. I have installed Eclipse 3.7.1 and using Android 3.0. When i want to debug the Android project, i select Debug As->Android application, simulator opens after a few mins but doesn't launch my app even after did lock swipe, but app is being installed. But, my biggest problem is, every time when i select Debug As->Android application, it always opens new simulator instance instead of launching my app in the existing launched simulator. Its killing, i'm not able to Debug my app at all directly.
Could someone please help me to set it properly?
Thank you!
CONSOLE: (every time when launches the new simulator)
Android Launch!
adb is running normally.
Performing com.company.myproject.SplashScreenActivity activity launch
Automatic Target Mode: Preferred AVD 'avd3.2' is not available. Launching new emulator.
Launching a new emulator with Virtual Device 'avd3.2'
2012-02-12 13:45:13.478 emulator-arm[2522:80b] Warning once: This application, or a library it uses, is using NSQuickDrawView, which has been deprecated. Apps should cease use of QuickDraw and move to Quartz.
emulator: WARNING: Unable to create sensors port: Connection refused

Connection refused for the sensor ports is a common problem when using a 64-bit install of Eclipse. Sometimes this error happens to working setups sporadically, but because this is a constant problem I am guessing that it is because you are running 64-bit Eclipse.
Developing in the 32-bit version of Eclipse should fix it.

Related

Android Studio not detecting Microsoft Android Emulator

I installed Microsoft's Android Emulator from here which can now work without disabling Hyper-V on Windows 10. I was following the instructions in this post and everything was working smooth until yesterday. I was successfully able to debug my app in MS android emulator.
Today morning I closed the emulator and started it again. Now, When I start running the app to test it then the MS Android emulator is not showing up in Select Deployment Target window of Android Studio as below. Nexus 5X API 28 emulator visible under Available Virtual Devices is Google's Android emulator which doesn't work with Hyper-V enabled due to reasons mentioned here.
I've already launched the MS Android simulator and it is up and running:
I can see it running in Hyper-V as well as shown below:
Not sure what happened suddenly and it stopped working altogether. Can anyone suggest me the reason behind it or I'm missing something?
If it didn't detected by IDE, try to rerun the emulator and check if it is detecting again or not.
Also, you can try this too:
Tools -> Android -> Enable ADB Integration
If it is already enabled, try to disable and re enable it, seems like this works most of the times.
EDIT: You may want to check:
https://stackoverflow.com/a/38788436/4409113
Changing the value Path then running following commands:
adb kill-server
adb start-server
Might help.
I happened to resolve it by chance. Sharing my experience in case it helps someone in future.
Initially what I was doing is as below:
Start Visual Studio Emulator for Android application which contains the list all the device profiles.
Choose an appropriate device profile and install it.
Run the installed profile and launch the emulator.
Start Android studio, open the project and launch the app.
I simply reversed the above steps to resolve my issue. First close everything including Android Studio, emulators, device profile window etc.:
At first, start Android studio, open the project and hit Run app button to show Select Deployment Target window.
Now, start Visual Studio Emulator for Android application which contains the list of all the device profiles.
Choose an appropriate device profile and install it.
Run the installed profile and launch the emulator. Wait for the Android operating system to get started fully.
The Connected Devices section in Select Deployment Target window would refresh on its own to start showing Microsoft's Android Emulator.
The adb.exe can be seen as an infected file by antivirius software. So need to exclude once reinstated.

Not able to install .apks via adb

I have been working on a particular Android application for sometime and have been able to run these apps via Android Studio quite fine before but since applying a recent update I have not been able to run the app via Android studio because of the following error:
android.os.TransactionTooLargeException
Error: Could not access the Package Manager. Is the system running?
I have tried to troubleshoot this issue by connecting via a different TCP/IP instead of through USB (thinking it was a cable fault of sorts), reinstalling ADB, removing the ADB driver and restarting Android Studio, and all of the above yielded the same error when trying to run the app from Android Studio.
The update that was applied was the addition of the YouTube Android Player to a fragment. The fragment that contains YouTube Player was added to FragmentManager of the parent Activity during the onCreate method of this fragment. Could this be the problem? Or am I looking in the wrong place
Any insight would be appreciated.
You may have gotten this error while attempting to run an Android application on an emulator or device using Android Studio. The most common cause of this error is simple as stated in this link: You have to manually unlock your Android Virtual Device by swiping the "lock" icon on the screen. Security measures prevent the emulator from letting you connect the debugger before doing this. Make sure also that you are running Android Studio version above 0.3.2 or the latest version. There was some issue reported in AS 0.3.2. You can update it from Help >Check for update.
Found this thread which states that it might be an issue with your emulator not with Android Studio. Maybe you are trying to install application before even the emulator started properly. Wait till the home screen appears in the emulator before trying to install any application.
Also try to install any apk in Emulator from command line
Steps to install
Go to $Android_SDK_DIR\platform-tools, right click there keeping shift key pressed and Chose "Open Command Window here".
Run command adb devices to make sure yout emulator is running properly. It will show all your running emulators.
Now if emulators are showing properly, type the command adb install YOUR_FULL_APK_PATH , YOUR_FULL_APK_PATH is of any .apk
file path in your system.
You need to wait for the emulator to full start which may take a few minutes. Once it is fully started (UI on the emulator will change), it should work. You will need to restart the app after the emulator is running and choose the running emulator when prompted. You can check on this bug report the full details.
Hope this helps!
I'm not sure, but check if this works.
menu>> tools>>Android>>Enable ADB integration check it

can't start android virtual devices after eclipse pachages update

I don't have experience with Eclipse, but some time ago, I've followed some tutorials and I have successfully build 2 android applications. After 6 months of not using Eclipse, when I opened I had to make some updates, but my virtual devices doesn't start. I get the following message error:
Adb connection Error:An existing connection was forcibly closed by the remote host
Connection attempts: 1
I've tried the following, but the end results are the same:
- deleted and made new virtual device
- reset adb from DDMS
- adb kill-server from cmd
I assume that I didn't install the right packages in Android SDK Manager.
I am not sure what's causing you the problem but have you tried downloading the Android SDK from this link ? It includes Eclipse and the Android SDK you need to develop applications.
It is possible to make it work by getting first eclipse and after that install Android SDK aswell.
About your error I assume is a problem in system services as when you want to start an emulator it must start aswell a system process ... maybe that's not starting and in this case can be a problem with your Android SDK or it gets blocked in the background by your operating system (I'm not sure what's really happing though, this is a guess).
Can you please try this way. Sometimes adb is not working even emulator is started.
Please follow the below link.
how to detect the emulator in eclipse for android?

Titanium Studio - Trying to run example app

I'm newbie in Titanium Studio and I have some weird questions:
- When I choose a new Mobile Project and trying to Run under the Android SDK Emulator,
I able to see the phone screen but when I'm going in the emulator to the apps list, I cant see the application I just created...
any ideas?
thanks.
When you hit Run it is automatically installed in your device/emulator.
Be sure it was successfully installed in your emulator first, please see:
Android troubleshooting
The initial launch of the Android emulator can be quite slow and Studio may timeout before it can install and launch the application. If this happens just click Run in Studio again. Subsequent launches should not time out on the same virtual device.
http://docs.appcelerator.com/titanium/latest/#!/guide/Creating_Your_First_Titanium_Apps-section-37541502_CreatingYourFirstTitaniumApps-AddaTableView

Android application doesn't start from Eclipse

Before u start: I searched the google and stackoverflow, none of them gave clear answer.
Situation: I'm using Eclipse on Windows to develop Android application. So when I'm trying to run the app, the system outputs to console
[2010-06-14 17:04:39 - HelloLinearLayout] ------------------------------
[2010-06-14 17:04:39 - HelloLinearLayout] Android Launch!
[2010-06-14 17:04:39 - HelloLinearLayout] adb is running normally.
[2010-06-14 17:04:39 - HelloLinearLayout] Performing com.example.HelloLinearLayout.HelloLinearLayout activity launch
[2010-06-14 17:04:39 - HelloLinearLayout] Automatic Target Mode: launching new emulator with compatible AVD 'Default_2.1'
[2010-06-14 17:04:39 - HelloLinearLayout] Launching a new emulator with Virtual Device 'Default_2.1'
starts the emulator, but doesn't upload the .apk and doesn't start the activity. So, app is not started anyway.
I found a "solution" here, but it's unclear and seems to not work. For example, I don't know, which "emulator processed" are meant to be killed. I found adb.exe only. And that's the main point: sometimes I'm lucky enough to kill all that they wanted and start the app. But it's undetermined.
Please help, I'm completely stuck with this trouble.
I've run into this situation many times and have had to do several things to resolve the issue.
1) If DDMS is running, close it (it seems to interfere with debugging sometimes).
2) Start the emulator, try connecting with DDMS, then disconnect, then go back to eclipse and start the debuggerer.
3) Kill the emulator, kill the adb process in task manager, restart eclipse, then try debugging letting Eclipse launch the emulator, sometimes the first load of the emulator times out so when it's fully started up, start debugging again.
Overall though, I've found it is much easier to not use the emulator and use an actual device, for me it's a much faster process.
I've tried a bunch of things for Eclipse on Windows and this set-up finally worked for me. Now I can repeatedly run the emulator and deploy the app successfully:
In Run Configurations ->Select the Deployment Target Selection Mode as "Manual"
Then Hit Run. The "Android Device Chooser" shows up
Select the "Launch a new Android Virtual Device" option (this should show the AVD that you had already pre-configured)
Select the AVD there and hit Start
Check only the "Wipe User Data" and un-check the other checkboxes
Hit Launch. This should launch the emulator. Give it sometime to run. Ensure that the home screen with the Android icon (and Google search bar) shows up. It's important to wait till this shows up. Otherwise, the app won't load. Depending on how fast your CPU is, the time taken for the home screen to load will vary.
Once the emulator home screen shows, go back to Eclipse, select this emulator in the Android Device Chooser (the state should be online)
Click OK once you have selected this emulator
The app will be loaded on to the emulator (give it sometime) and you should see your app running on the emulator
This setup seemed to work for me every time. I can't fully comprehend why this works, while the other "normal" way doesn't. But I'm glad, I could get the emulator and the app working finally.
I was experiencing this issue in Linux (Mint 12, Eclipse Juno Java EE for Web Developers, Android API20, Sun Java 1.6). I could launch the emulator from the command line just fine (i.e., "emulator-arm -avd InsertYourVirtualDeviceNameHere -verbose"), but not from within Eclipse. It just hung like the original poster mentioned. The way I fixed it was to make a backup of the original "emulator" for safe keeping and then I made a copy of "emulator-arm" and renamed it "emulator". These emulators are located within the "tools" directory of your Android SDK installation. I'm still trying to figure out how to get Eclipse to correctly point to "emulator-arm" on its own without this hack.
It happened to me as well. It seemed that for me the issue was that the app was already running on the device I installed the apk to. When I closed it, it worked.
If You Running In Eclipse, Check Your Settings.
Run Configurations - Common - Select File In Standard Input And Output - Click
Workspace And Choose Your Project.

Categories

Resources