How to adb reboot in Genymotion using Mac? - genymotion

I have Genymotion-ARM-Translation_v1.1.zip
and open_gapps-arm-7.0-stock-20180117.zip
Drag and Drop, yes done. Then how to adb reboot in mac?

Assuming you are using Genymotion adb, you can run /Applications/Genymotion.app/Contents/MacOS/tools/adb reboot.
If you are using the Android SDK adb, then replace /Applications/Genymotion.app/Contents/MacOS/tools with the folder where Android SDK adb is installed.

Related

react-native run-android not working and how to run it on genymotion

I just start learning react-native. when I trying to run the react-native run-android command it is showing error about android emulator.
Please help me to run my first react native app on Genymotion.
simple way:
first connect and android device or run an android emulator then do this steps
1- open android studio
2- click on File->open->navigate to to your react-native project and choose android folder
3- comeback to cmd and run react-antive order again
4- react-native run-android
in gradle-wrapper.properties change distributionUrl=https://services.gradle.org/distributions/gradle-6.3-all.zip
from 5.x
First of all you have to installed genymotion plugin on android studio. After that please run genymotion emulator.
And please open android studio and android project of created RN app.
The relevant gradle version will be downloaded and synchronized.
And then run command "react-native run-android".
Steps to setup for React Native with GenyMotion on MAC Machine
Installed Android Studio
Installed Genymotion
Pointed Genymotion settings custom SDK to: /Users/myusername/Library/Android/sdk
Added path to adb tool directory in .bash_profile to: PATH="/Users/myusername/Library/Android/sdk/platform-tools:${PATH}"
Restarted terminal for path to take effect
Ran exp path in terminal to copy path to exp
Ran adb in terminal to make sure it could find adb in platform-tools directory
Restarted Genymotion
Created and started virtual device in Genymotion
Started Expo XDE and started project
Ran Open on Android from XDE
App started on virtual device created in Genymotion (step 9)
after these steps,
on Terminal fire : npm run android
This has worked for me !

React-Native running on Android device from AppleOS, no udev directory

The instructions for how to run a react-native project on an android device is located at: https://facebook.github.io/react-native/docs/running-on-device-android.html
After determining your USB device, the instructions state to do the following command:
echo SUBSYSTEM=="usb", ATTR{idVendor}=="22b8", MODE="0666", GROUP="plugdev" |
sudo tee /etc/udev/rules.d/51-android-usb.rules
The problem is that there is not a /etc/udev directory on my Mac. So obviously this fails.
Apparently MacOS doesn't support udev.
So how do I get this to work? If I ignore the udev part and use the command react-native run-android then it wants to run on an emulator. I experimented with --variant and just adding the values from adb devices, but no success.
--edit--
I should note that adb devices works fine, so does lsusb. The phone prompted to trust the computer, so I know that debugging is setup correctly. Just trying to figure out how to tell react-native to launch the app on the device (instead of an emulator).

Titanium Alloy with Android Emulator on Windows 10

I'm having huge problems with Titanium Alloy on Windows 10. I am using the Atom editor to write my apps. Whenever I execute ti build, enter the command up to 10(!!!) times until an Android device can be found.
For the Android emulator I get an error message as follows:
[Error] Failed to install apk on "emulator-5554"
[Error] Error: device not found
I tried the commands ti build -p android, ti build -p android -T emulator and ti build -p android -T emulator -C emulator-5554 --log-level info. I also tried starting the emulator manually from avd.exe. I deleted the AVD and created a new one, too
When a device (USB debugging enabled) is connected, i tried ti build -p android -T device and ti build -p android -T device -C XT1032, where XT1032 is the name of the device. I get an error message as follows:
[ERROR] Unable to find any devices
I didn't try so far if the device will be found after some more tries.
When executing the commands, I tried all 4 combinations:
emulator off, device disconnected
emulator off, device connected
emulator on, device disconnected
emulator on, device connected
I uninstalled Titanium, Android SDK, NodeJS and Java and deleted all folders of them. I removed all registry entries, too. Then I installed everything again, Titanium at last. Same problem.
I am using Java 32 bit (v8.0.1020.14), NodeJS v4.2.6 (also tried v6.3.0, but v4.2.x is recommend), Android SDK (SDK Tools v25.1.7, SDK Platform-tools 24.0.1 and SDK Build-tools 21.1.2. I also tried SDK Build-tools 24.0.1, but 21.x.x is recommend) and Titanium (SDK v6.0.0.v20160719180254, CLIv5.0.9).
I modified my environment variables as follows:
PATH:
C:\android-sdk\tools;C:\android-sdk\platform-tools;C:\android-sdk\ndk-bundle;C:\Program Files (x86)\Java\jdk<version>\bin
JAVA_HOME:
C:\Program Files (x86)\Java\jdk<version>
ANDROID_SDK_HOME:
C:\android-sdk
I had to set ANDROID_SDK_HOME and C:\android-sdk\ndk-bundle, otherwise the NDK and the AVDs wouldn't be found by ti setup check.
Here is a screenshot of ti setup check: link to image
I don't know why https://www.google.com is unreachable. Furthermore, Intel HAXM is installed. I even reinstalled it without success. The previous installation of Titanium could find it...
Thanks for your help!
TLDNR: my Titanium Alloy installation has problems finding devices. It only works from time to time without any obvious pattern
The process terminates after building the APK file. If the emulator is running, it is possible to manually install the APK. Use this command in the Command Line:
<Android SDK folder>\platform-tools\adb.exe -s emulator-5554 install -r -d <project path>\<project folder>\build\android\bin\<project name>.apk
The project name is equal to the project folder name. After installing the APK, the application can be started manually in the emulator.
Nonetheless, there are still a lot of issues when developping on Windows 10... I think this forces me to switch to a MAC.

Nativescript - error on tns run android

I'm trying to run android emulator with the command tns run android. This starts the emulator but it keeps stuck on Android logo and I get the following error:
(...)
BUILD SUCCESSFUL
Total time: 17.013 secs
Project successfully built.
Using C:\(...)\sample-Groceries\platforms\android\build\outputs\apk\sampleGroceries-debug.apk
Starting Android emulator with image Nexus6
Waiting for emulator device initialization..............
Cannot run your app in the native emulator. Increase the timeout of the operation with the --timeout option or try to restart your adb
server with 'adb kill-server' command. Alternatively, run the Android
Virtual Device manager and increase the allocated RAM for the virtual
device.
(...)
Here is my Android Virtual Device configured:
AVD Manager
Note: I can run the application on my phone anyway, but not on my PC.
Finally I found the problem.
In Android Virtual Device Manager, there was an error I didn't see:
AVD Manager error
Here is a solution which I found to be useful.
enter image description here
You just have to manually activate the emulator, which you can do using android studio or command line. Using the command line, you have to run this command
emulator -avd avd_name [ {-option [value]} … ]
for ex:
/Android/sdk/emulator/emulator -avd test
Once the emulator starts you can run this command
tns run android
I started having similar issue after updating to the latest Android Studio and latest emulators. I switched the VM Heap to 64, and it worked for me. May be worth giving that a try.
Open your Android Virtual Device Manager and download the latest
emulator. That will fix the error.
I had the same problem. I fixed that by:
Open emulator manually from Android Studio (double-click on position in AVD Manager list)
Run tns run android
Works for macOS Sierra.

ADB fails to start "cannot bind 'tcp:5037'" after updating to Yosemite MAC

After I upgraded to Yosemite and upgraded to Xcode 7.1 I cannot start the adb server. Both of which I don't see why they would affect adb. When I type adb devices or adb start-server in the terminal I get:
cannot bind 'tcp:5037'
ADB server didn't ACK
* failed to start daemon *
error: cannot connect to daemon
There are no adb processes running that I can see in activity monitor.
I've checked with lsof -i tcp:5037 that there are running processes on port 5037.
I have the latest Android SDK.
I have checked that my .bashrc loads the correct Android SDK and adb.
I've tried to adb kill-server and then adb start-server several times, but when I run start-server I get the error message that I cannot bind tcp:5037.
I've tried deleting .android folder and unplugging/plugging in my android phone, toggling on/off USB-debugging and revoking debugging authorizations.
Android studio cannot start adb anymore as well.
I've tried restarting the computer.
I'm not running Genymotion.
None of the above worked, and I'm about to give up. I've checked every stackoverflow thread about this issue and none of the mentioned fixes have worked so far.
Success.
Oddly enough, adb worked again after I upgraded Yosemite to El Capitan (10.11).

Resources