Error while installing app in android emulator in win8 - adb

As I was trying to install the app in my emulator through command prompt, it shows--
"error- more than one device and emulator."
I've 4 emulator but only 1 was online while I was installing the app.
I use this command (without quotes)
"adb install .apk"
Need help!!

close emulator, close adb. open and reconnect, you can use
adb devices
to see connected devices.

Related

can we run react native cli app on physical device without Android studio

In the documentation of react native cli there is processe to run react native cli app directly on physical device but I am confused that do we need Android studio to run my physical device as emulator or I can directly run my physical phone as emulator by connecting through usb debugging and typing the command given there
https://reactnative.dev/docs/running-on-device
You need to connect your phone via USB and turn on debugging mode.
You can check device connectivity via running the ADB command.
adb devices
if you see your device in the console then just simply run your application via
react-native-run-android

react-native not detected my physical device

adb devices detect my physical phone but react-native run-android command open my emulator..
and whenever i put this command npx react-native run-android --deviceId=97e2bc510706 it shows error no emulator or android device connected I WILL GET THIS ERROR
if you have android studio , open your project's android folder in android studio and run in your physical device and in vs code run command npx react-native start and if you are using mobile hotspot then open your app and shake your device or long press minimize button , go to setting and in port add your ip (for example : ,196.168.0.1:8081) after ip put your port number.
hope it will work ...!
Always remember sdk path not contain any space in my case my username of computer is shrivastava ji so there is space in my username so remove space in your username or file name or change the sdk path where path have no space

ADB Connection to Samsung smart tv

I am trying to install third party apk to Samsung android smart tv...
1) I've turn on Developer mode in Apps and put my computer ip address there.
2) I'm runing this commands in terminal (mac os, the latest version of sdk-tools)
adb kill-server && adb start-server && adb connect 192.168.1.237:26101 && adb devices
Getting this:
* daemon not running; starting now at tcp:5037
* daemon started successfully
connected to 192.168.1.237:26101
List of devices attached
192.168.1.237:26101 device
3) And run:
adb install ./my.apk**
And got this:
Performing Push Install
adb: error: connect failed: closed
- waiting for device -
p.s. almost every command failed with error: closed
(i've tried adb shell, adb logcat, and so on...)
What next step to try ? Is port 26101 correct? (I've also tried port 5555, but get Connection refused
Sorry but I haven't seen any Samsung Smart TV running Android. Samsung has their own operating system (Tizen) but, as far I know you can't install apk apps, also you cannot install apps using adb (in Tizen is named SDB), instead of SDB you need to use the Tizen SDK + Tizen Studio to pair your PC, sign your app (.wgt extension) and install it using the SDB

React Native 0.60 connection to development server

(I'm almost a newbie in React Native development) today I have started a new project in React Native 0.60 (react-native init MyApp).
After that I typed : react-native run-android to check if everything worked.
After the bundle process is finished
I can finally get my welcome screen in my connected devices
But, if I try to reload the app from my devices I get this error:
How could I address this error ?
EDIT: Thank you for your answers, anyway, I have tried all solutions you suggest but I still get the same problem. I also noticed that when i run react-native run-android Metro Bundler (open in a new cli window) seems to start but it suddenly disappear. I think the problem could be with the message 'Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0'
react-native run-android not working in new react-native version
0.60
now you can use
react-native start
OR
npm start
both command is work
Please use the following two commands and then can start the react native again.
- adb reverse tcp:8081 tcp:8081
- killall node
Then you can run the following the command.
react-native start
Now you can run your application again.
Have a good day.
You need to connect your phone to the server, follow the below steps:
[For detailed help follow this https://facebook.github.io/react-native/docs/running-on-device]
1. Open the developer menu on phone.
2. Open 'Debug server host & port for device'.
3. Type in your machine's IP address and the port of the local dev server (eg. 10.0.1.1:8081). If you have connected over wifi then this will be your computers ip address. (If you are running in your computer I think instead of ip address it would be 'localhost:8081')
4. Go back to the Dev menu and select reload.
Hope it would help.
You need to run adb reverse in the Android Studio terminal so your device can connect to the server. Open Android Studio and click on the terminal button at the bottom. In the terminal, and with your device connected to your computer, enter the command adb devices. This will list the name of the connected Android device. Copy that name. Then enter this command adb -s <device name> reverse tcp:8081 tcp:8081. When you run that command replace <device name> with the name of your device you copied from the other command.
Here is a link to an explanation in the React Native documentation

Could not get BatchedBridge, make sure your bundle is packaged correctly happened on Android v4.4.2

I compiled react-native on Android v4.4.2 but the problems arised:
I tried to follow this solution, but I did not how to run on Command Prompt Windows 10:
$> cd myproject
$> react-native start > /dev/null 2>&1 &
$> curl "http://localhost:8081/index.android.bundle?platform=android" -o
> "android/app/src/main/assets/index.android.bundle
$> (cd android/ && ./gradlew assembleDebug)
I tried to compile the same way on Android V6.0. Then there was no problem at all.
How to make android V4.4.2 also can be use like Android v6.0 for my first react-native
project development?
That error means your React Native app can't fetch your JS files from your localhost. You'd usually just run react-native start to serve the JS files from your packager, but Android 4.4.x cannot connect to your localhost with the default adb reverse method.
The way I run on Android 4.4.x is to manually set the device to connect to my machine via Wi-Fi (Official guide here!).
Access the React Native dev menu by shaking your device or pressing the hardware menu button (can be done with Ctrl+M or Cmd+M in a simulator, IIRC)
Go to Dev Settings
Under the Debugging section, tap "Debug server host & port for device"
Enter your machine's IP address, as well as the port through which the React Native packager is serving, e.g. "10.0.0.25:8081" (make sure your device and your machine are on the same network!)
Reload through the dev menu again (or by pressing Ctrl+R or Cmd+R in a simulator, I think)
Try running this command
adb reverse tcp:8081 tcp:8081

Resources