Hi I know this is a real silly question but I am following the instructions to create an app for android. Im currently here... http://developer.android.com/training/basics/firstapp/running-app.html
Ive already set up my first app as per instuctions, Ive enabled debugging on my phone, but now Im unsure what file to open in eclipse before clicking "Run as"-> "Android Application".
Any help would be great thanks
You don't need to open or close any file(s) for running the app, just make sure the project you want to run is selected in the project explorer on the left side. But I assume that you only have one project at this time so everything should work as expected
EDIT
If you want to test your app on a real device from Eclipse, make sure the required device drivers are installed. You can go to Run -> Run Configurations -> target and check if your device is listed. In case that is not, some drivers are missing.
Select your MainActivity and click run. It will prompt a box where you can choose weather you want to run in device or in emulator.
To run in real device See my post. It will help you.
Related
He thanks in advance,
In react native am not able to right click or open dev mode in emulator.
adb shell input keyevent 82
Use this in your windows command line, It works for me.
If the above solutions did not help, here is what worked for me.
Use an emulator that has Play Store installed. When creating a virtual device in Android Studio, it will have the Play Store icon.
Download Expo from the play store. For some reason, the Expo app that vscode pushes to my emulator won't work properly for me.
Run expo start and open the Expo Developer Tools page on your browser (by typing 'd' if it does not open automatically), and copy the url at the bottom left. Will look like exp://127.0.0.1:19000 if you started with --localhost
On the emulator, run the expo app and on the top select Open from Clipboard and it will show the url you copied.
For me, this did a better job at starting the Building Javascript bundle, and once the app was loaded, I was able to use Ctrl M to mimic shaking the device and open the developer menu!
Other troubleshooting tips I learned while figuring this out:
Like the comments above state, don't be in production mode
Make sure to have paths set up correctly to be able to reach your Android sdk, nodejs, and your local project node_modules/bin if you are not doing global npm installs.
If you are having issues with remote debugging, make sure the Chrome debugger is not open. Close it if it is open, have your debugger listening on the correct port (for me 19001) and reload the project on the device.
I hope this helps someone.
FOR WINDOWS 10 YOU NEED TO ADD THIS SO THAT YOU CAN USE CRTL+M to open debug and reload
Add environment variables
Open a File Explorer, copy and paste the following into the address bar.
Control Panel\System and Security\System
Click on Advanced system settings on the left menu.
Click on Environmental Variables at the bottom.
Click on New to add a user variable (the top section).
You’ll be adding two:
Variable Value
ANDROID_HOME C:\Users\username\AppData\Local\Android\Sdk
JAVA_HOME C:\Program Files\Android\Android Studio\jre\jre
Then under System variables (the bottom section), click on the Path variable and click on Edit.
On the pop-up window, click on New to add another variable:
C:\Users\username\AppData\Local\Android\Sdk\platform-tools
C:\Program Files\nodejs\
Click OK, OK
Then try your emulator
see this link: https://medium.com/#lpault29/react-native-environment-for-windows-e25806df867c
Turning off production mode solved my problem.
There is post which says turn off production mode -> it took me time to find in which settings -> I was looking in emulator settings, it was in expo-cli. This post is it clarify it.
Production mode off
In the expo-cli http://localhost:19002/, there is Production Mode (left side bar) -> turn it off
Open AVD Emulator and your application, press ctrl+M
It should work.
*Make sure we installed all of these SDK files,I tried all of the above solutions but no one solved my problem but everything is working now after doing this, hope it will solve your problem also
When I click on run
when I click run, it can't run
To run the project, you have to create a virtual device. As you are new to this, I recommend you to use a real device connected via USB cable. Refer this for help. Feel free to comment if you are getting troubles.
Update
Click the plus button in the second screenshot you have provided.
Select "Android App"
Type "app" in Name box.
Apply
I want to run my app, but the run button is disabled. When I go in Edit Configurations where I should see "Android Application-->app" I only see the Defaults. Everything was fine 2 hours ago, but I kept working on my project and when I wanted to test it I noticed that I can't. What may have caused this and how do I solve it? I tried to search for a solution, but I couldn't find one.
Close any emulator if open and then reopen your project, maybe it shows.
I am new to android application.
i have downloaded Android Studio from http://developer.android.com/
I just created one project and click on run button.
but it just keep showing me from past 2 hours
what should i do now ??
is there any step by step instruction that i can follow?
This is usual, there are some tricks to avoid this, see this Why emulator is very slow in Android Studio?, and i use BlueStack for debugging. it's better than anything.
This question already has answers here:
when i start eclipse and run android project, it opens a new emulator every time ,
(3 answers)
Closed 8 years ago.
In eclipse When I run android application it always Launching a new emulator with Virtual Device 'xxx'.
But I want to run current running emulator.
How to make it possible ?
Right click on project->Run As->Run configuration->select Tab Target->select Radio button " always prompt to pick device" ....
so it will always give prompt to select emulator....
I hop it will work for u...
your application Target mode has set to manual. To solve :
Right Click on your project-> Run as -> Select Run Configurations -> In that select Target
Tab ->Select Automatic instead of manual
Click on Apply and run.
hope it help you.
All right in the project explorer Right click on your project and goto RunAs..->Run Configuration. Then goto the target tab. I think you might have some miss-configurations there. Just choose the option that best suits you. Hope it helps. Just let me know if you still can't solve it.
Follow this steps it will help you.
Try this,
Just Right click your Project name --> Run As--> Run Configurations --> Target Tab --> pick up Always prompt to pick device --> Apply / Run.
Select "Choose a running Android Device" while running
And close the adt application from your task manager
If that also doesn't work click reset your adt from eclipse devices