not able to change location in Android emulator - react-native

I'm using Android studio Android emulator for app development, I'm working on location module. when I try to change the location of Android emulator by clicking (...) it is not working. Any solution ??

Related

Android Studio Virtual android device blinking

I want to set up android studio's android emulator for React Native and I have a problem with the emulator. I read that it is a problem with resizing. That emulator wants to resize an android window. But I can not find a solution to that.

AVD emulator opens previous expo project instead of current

I am attempting to run my expo project on an Android virtual device.
I start by doing a
expo start
Then I open AVD Device manager and launch a device. Here I am getting an error "unable to locate ADB", but it still starts.
Finally I go to the web browser window that expo start had opened and click "Run on Android device/emulator"
The emulator then opens an older project instead of my existing project. What am I doing wrong? How can I open the existing project instead. That same browser window allows me to launch on my actual phone using the QR code and opens to the correct project.
I ended up clearing expo app cache in the emulator and this addressed the issue.

Expo-react-native :Couldn't adb reverse: device 'adb' not found

I am using react-native-expo for mobile app development.
I use an android emulator for the app, vscode editor for development.
It started showing me this error from few days.
› Opening on Android...
Couldn't adb reverse: device 'adb' not found
› Opening exp://10.0.46.81:19000 on Device adb
Couldn't start project on Android: Error running adb: device 'adb' not found
› Press ? │ show all commands
I tried wiping the emulator, tapping on the build number in the emulator, but nothing worked out.
I've deleted the virtual devices and created new one. It worked for one time and again this process isn't working.
there isn't much about this on the internet.
need help.
Just try this. It is work for me.
make sure you already add android sdk path in setting > appearance & behavior > system settings > android SDK > android SDK location
(Common path is C:\Users(name)\AppData\Local\Android\Sdk)
create new variable name and value in Environment Variables (User Variables)
(ANDROID_HOME C:\Users(name)\AppData\Local\Android\Sdk)
add new Path in Environment Variables (User Variables)
(C:\Users(name)\AppData\Local\Android\Sdk\platform-tools)
It is work for me after I have solved it for 3 hours.
At first, I don't face the problem like this in flutter but in react-native.
The fix for me was to install the SDK Platform for the android version used by the AVD.
In my case, I installed android v9 (Pie) via the AVD Manager when setting up my AVD for the first time, and when I looked into this issue I noticed that the SDK Platform for v9 was not installed as part of that setup.
The exact steps I took are as follows:
Disclaimer: You might not need to follow these steps exactly to resolve the issue
Close all CMD and IDE programs.
Open Android Studio and navigate to AVD Manager
Click the down arrow for the target AVD and click the Edit option
Set the device to Cold boot instead of Quick boot
Open SDK Manager, and download the SDK Platform for android version used by AVD
Go back to AVD Manager, click the Cold boot now option
Open a CMD terminal as administrator, CD to project repo, and run expo start
Launch expo in AVD
DONE
I had the same problem. Emulator started working after this:
Delete caches from Android Studio
Wipe data from your emulator
Cold boot to restart
When I was solving this problem I also ended up doing these:
Check Android studio updates
Reinstalled Android studio
Check SDK updates from SDK tools: SDK Manager -> Android SDK -> SDK tools. You can see if there is a new update available on the right.
Go to Virtual Device Manager -> Select your Device -> Actions -> Click "Drop down" button and select "Cold Boot Now".
This worked for me.
For my case, I went to the avd and simply clicked "wipe data", restarted both my avd and server and it worked
By my side the problem was is In Internet Connection. I just changed the WiFi and everything working fine.

react native ios emulator - how do I test camera function on computer, without using a phone?

I implemented code using a React Native package accessing camera to scan documents. I don't have a physical phone. How do I test the functionality using just my ios emulator on computer?
For iOS it's impossible to test the camera. For Android you can configure the emulator to do that.
Its possible to configure your emulator in Android to test the camera:
fire up Android Studio
open the AVD Manager screen
click on the pencil icon next to your chosen emulator device
show advanced settings
change camera (front and/or back) to "Webcam0"
You will need to cold restart your emulator for the changes to take effect.

How can I install a React Native app without releasing it to any store?

I wanna be able to use my app on my iPhone or my Android phone without the need of releasing it to App Store or Google Play Store.
or just use EXPO tools if you are open to using expo development environment for react native
If your project is based on React-Native-CLI and your development environment is all set-up then just run command 'react-native run-android' in the terminal. It will generate a debug apk file which you can be found in the directory:
android > app > build > outputs > apk > debug > app-debug.apk
You can directly install this debug apk in your android phone by connecting the device in the debugging mode and run the above command!
In Xcode, add your Apple ID to Accounts preferences, described in
Adding Your Apple ID Account in Xcode.
In the project navigator, select the project and your target to
display the project editor.
Click General and choose your name from the Team pop-up menu.
Connect the device to your Mac and choose your device from the Scheme
toolbar menu.
Below the Team pop-up menu, click Fix Issue.
Xcode creates a free provisioning profile for you and the warning text
under the Team pop-up menu disappears.
Click the Run button.
Xcode installs the app on the device before launching the app.
Test iOS app on device without apple developer program or jailbreak
For IOS you must have a developer account firstly. And then, you can send your app to itunesconnect and get the app from testflight. Or You can run your ios app on device by using cable. But you dont run your app in developer mode.
For android you just need get the apk from android studio. But some steps there are. Follow this steps for get the apk.
How can I generate an apk that can run without server with react-native?
You can Side load your react native app in iPhone or iPad using Xcode
Open your_projectname.xcworkspace from ios folder in Xcode
XCode - Choose your destination device simulator or device from
Product -> Destination -> Select the device
Create a Temporary provision profile From project Target -> Signing
& Capabilities (Required only for physical device, for simulator don't
require this)
Build and Run your project
React Native's official site has a guide on how to install your app without releasing it.
The tl;dr is as follows:
For ios:
cd AwesomeProject
react-native run-ios
For android:
cd AwesomeProject
react-native run-android