jcollum
jcollum

Reputation: 46569

How do I build a react-native app so that it runs as an ipad app on an ipad?

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

Answers (5)

mahmoud2020
mahmoud2020

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)" press the + button and add the device you want

Upvotes: 4

Simon Reggiani
Simon Reggiani

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.

Xcode 12

Upvotes: 8

Sam
Sam

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.

React Native iPhone iPad rendering support

Upvotes: 7

Mohsen Ghafori
Mohsen Ghafori

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

atitpatel
atitpatel

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. enter image description here

Upvotes: 47

Related Questions