Ionic don't run android into Genymotion - android

I have get everything setup by following on this tutorial (http://learn.ionicframework.com/videos/windows-android/). The problem is now, when I run ionic run android, the adb doesn't get the apk install into the virtual device run by Genymotion.
However, if I manually navigate to platforms\android\build\outputs\apk\ folder and run adb install android-debug.apk, then run ionic run android again, it will install into the virtual device. Everytime after I did the changes, I need to run adb install, then it will work.
How can I overcome it? Thanks.

Related

How to run react-native expo app on multiple emulators?

Does anyone know how to run an expo react-native app on multiple android emulators at once?
I have tried to run the app after running the emulators but it would run only on one emulator.
When I tried 'shift+a' it shows a list of emulators but when I choose the desired emulator it doesn't work.
This is the error 'Couldn't start a project on Android: The emulator (Nexus_S_API_30) quit before it finished opening. You can try starting the emulator manually from the terminal with: emulator #Nexus_S_API_30'
This says the emulator exited even though it is already running.
Install app in all emulator
Open all emulator
Run project from different port
For example
Run 'npx react-native start' for first emulator
Run 'npx react-native start --port 9988' from another terminal for second emulator etc
Open app from emulators
Open developer menu by pressing ctrl + m
Change bundle location to '10.0.2.2:PortNumber' eg : '10.0.2.2:9988'

Flutter always run on Chrome, how to switch to run on android emulator?

I tried to make my project run on Web
so I typed this command
flutter run -d chrome
But it always runs on chrome when i typed
flutter run
, I would like to switch to run on android emulator
How to switch to run android emulator?? Thank you very much
If you're using Visual Studio Code, you can select the device your app should run on the bottom-right and then, run the app by pressing CTRL + F5(F5 to run it with debugging) or from the top-right.
Your preferred device is Chrome(web-javascript), right now.
You may need to go in main.dart to run the app, it is a VSCode bug.
Otherwise, you can run the command: flutter emulators --launch <device_name> and flutter run.
check device Id by running
adb devices
then run with deviceId
flutter run -d yourDeviceId
Let me know any issues you find in comments

React Native app: cannot connect to dev server, but the simulator is running - why?

The image describes my current situation properly. Please have a look at it first.
I am running my app on React Native. I have Android simulator on. I give the command to start the app. The app build finishes, but it says that virtual device not found, and in my simulator, if I open the app manually, it says that it cannot connect to Development server. It shows some issues.
Can anyone help?
Try run react-native run-android to connect your app to the emulator
Check USB Debugging is on(mostly running on virtual devices)
Check how you created project(react-native-cli or Expo) and run relevant app run command
Make sure your development server(node.js) is running when you run app. Sometimes it crashes then you have to again run command to run app
If all the step does not solve your issue try to uninstall app from device and run app again. Since react-native is still developing and its wired sometime these tricks works
I was having the same issue in Ubuntu 16.04. In my case the problem was that node packager wasn't running.
To check is packager is running easily you can open the browser and enter
http://localhost:8081/
You must see "React Native packager is running."
If you dont, then you can start packager from console running
react-native start
If you get an error like
" ERROR watch /your/project/path/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values-ru ENOSPC"
Then run first
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
Then run react-native start again and press the letter R twice in the emulator to reload.
Looking at the screenshot, seems like you don't have adb installed because there is a clear 'adb: not found error'.
Luckily Android studio ships with adb and is present in platform-tools under your Android SDK. (generally in /home/your-user-name/Android/Sdk/)
You only need to use it. Create a symbolic link in '/usr/bin/' or '/usr/local/bin/' depending how you'd like to use it.
Run the command:
sudo ln -s ~/Android/Sdk/platform-tools/adb /usr/local/bin/
After this run the app.

Running apps on Android Emulator

I have built the android emulator for android-7.1.2_r17 from source code on my ubuntu 16.04 machine using the help from this . I used
lunch full-eng in the lunch combo. And the emulator launched.
Then, I downloaded .apk files (for example for a calculator app) and I could install these in the emulator using the command
adb -e install -r "your-apk-file-complete-path"
But when I try to run the app in the emulator by clicking on it, it shows the error: Your app keeps stopping and the app doesn't launch.
Can someone please help me run the app on the emulator?

How to set the default Android Emulator

I am building an app with NativeScript, where I run:
$ tns run android --emulator
to build the app and launch it in an emulator. When I do this, the default android emulator boots on my machine, which is unusably slow...
In all the demos, they are using the Genymotion Emulator. I have installed this, but the NativeScript command still launches the default emulator. How do I get this to launch on the genymotion emulator?
NB: I am using Windows 10
Update:
Even if I run the command with the Genymotion emulator running (and nothing else), I get the following log output and a new terminal window is opened running android-sdk/tools/emulator-arm.exe
BUILD SUCCESSFUL
Total time: 11.959 secs
Project successfully built.
Using C:\Users\George\Source\Repos\NativeScript-App\Bluetooth\platforms\android\build\outputs\apk\bluetoothdemo-debug.apk
Starting Android emulator with image Xamarin_Android_API_23
That looks as though it is referencing the emulator I had been using when I was developing with Xamarin. Any ideas where I can change that, or why that is being called?
start Genymotion, then start one of the devices that you have setup in Genymotion
then check that the device is seen:
$ tns device
then run nativescript like so
$tns run android --geny 192.111.222.33:555
(or whatever is the name that you get from the tns device command)
To my experience --emulator always tries to start the stock emulators. Try to start genymotion and then just tns run android (w/o the --emulator option).
I think it does that when there is no emulator running.
Try starting Genymotion first, launch the image you want, then run the "tns run adroid" command.
I had a similar issue.
To use GenyMotion by default, first delete all the Android emulators using
android avd
I then followed the solution on this thread:
React-Native, Android, Genymotion: ADB server didn't ACK
Edit the settings in GenyMotion to use the android SDK you downloaded. (path for Windows is Users/YOUR-SYSTEM/AppData/Local/Android/android-sdk)
You still have to run the device on GenyMotion before running the emulator
tns run android

Categories

Resources