So, after testing my app on my emulator I tried to run it on my device on my phone. I have enabled the developer option with USB debugging.
whenever I type npm run android
it automatically starts my emulator, even when my actual device is connected to my PC.
It would be really nice if someone point out what could be the issue.
ps. It was working fine before i started the project.
CodePudding user response:
You have to check that the device is properly connected with the PC or not.
Just run a command adb devices
in terminal.
If the device is connected then it will be listed there.
CodePudding user response:
Specify a simulator using the --simulator flag.
These are the available devices for iOS 14.0 onwards:
npx react-native run-ios --simulator="iPhone 8"
npx react-native run-ios --simulator="iPhone 8 Plus"
npx react-native run-ios --simulator="iPhone 11"
npx react-native run-ios --simulator="iPhone 11 Pro"
npx react-native run-ios --simulator="iPhone 11 Pro Max"
npx react-native run-ios --simulator="iPhone SE (2nd generation)"
npx react-native run-ios --simulator="iPhone 12 mini"
npx react-native run-ios --simulator="iPhone 12"
npx react-native run-ios --simulator="iPhone 12 Pro"
npx react-native run-ios --simulator="iPhone 12 Pro Max"
npx react-native run-ios --simulator="iPhone 13 Pro"
npx react-native run-ios --simulator="iPhone 13 Pro Max"
npx react-native run-ios --simulator="iPhone 13 mini"
npx react-native run-ios --simulator="iPhone 13"
npx react-native run-ios --simulator="iPod touch (7th generation)"
npx react-native run-ios --simulator="iPad Pro (9.7-inch)"
npx react-native run-ios --simulator="iPad (9th generation)"
npx react-native run-ios --simulator="iPad Air (4th generation)"
npx react-native run-ios --simulator="iPad Pro (11-inch) (3rd generation)"
npx react-native run-ios --simulator="iPad Pro (12.9-inch) (5th generation)"
npx react-native run-ios --simulator="iPad mini (6th generation)"
List all available iOS devices:
xcrun simctl list devices There is currently no way to set a default. You can run this like that
npx react-native run-android --device="samsung s8"