Reputation: 46569
My app looks terrible on an ipad because it's running as an iphone-emulated app instead of an ipad app.
What do I need to do in my code to deal with the possibility that it may be running on an ipad?
How do I build the app with react-native so that it will install on an ipad and run as an ipad app?
Is this possible to do without xcode?
I'm running react-native run-ios
with an iPad Air simulator running. Perhaps I need to set up a scheme and call it with --scheme
?
Upvotes: 27
Views: 33574
Reputation: 180
for new version of XCODE 14.3 press the + button and add the device you want (Ipad) here for example then you can run : npx react-native run-ios --simulator="iPad (10th generation)"
Upvotes: 4
Reputation: 560
In Xcode 12, it's in a section called Deployment Info".
Checking the "iPad" checkbox will automatically set the TARGETED_DEVICE_FAMILY
setting to 1,2
.
Upvotes: 8
Reputation: 2658
As of Xcode 9.3.1, you have to go to Build Settings and select Targeted Device Family 1,2
if you want to support both the iPad and iPhone.
Upvotes: 7
Reputation: 161
you can use this command
react-native run-ios --simulator="iPad Pro (9.7-inch)"
Visit https://facebook.github.io/react-native/docs/running-on-simulator-ios.html
Upvotes: 7
Reputation: 3184
I think you have not kept your Devices in Xcode as Universal. Go to Xcode click on the project name. In the target section go to Deployment Info. Set Devices to Universal.
Upvotes: 47