Skip to content
This repository has been archived by the owner on Feb 25, 2022. It is now read-only.

Ability to pass additional params to run-ios #36

Open
goofiw opened this issue Jan 20, 2021 · 5 comments
Open

Ability to pass additional params to run-ios #36

goofiw opened this issue Jan 20, 2021 · 5 comments
Labels
enhancement New feature or request

Comments

@goofiw
Copy link

goofiw commented Jan 20, 2021

Is it possible to add passing additional commands to run-ios?

i.e., I'd like to specify a real device, see verbose logs, etc.

Out current workaround is:

pod install --project-directory=apps/client/native/ios
node node_modules/react-native/cli.js run-ios --device "Bob's iPhone" --project-path "./apps/client/native/ios" --verbose

It looks like theres a way to pass device, but maybe not verbose:
https://github.com/nrwl/nx-react-native/blob/main/packages/react-native/src/builders/run-ios/run-ios.impl.ts#L22

@hanselabreu
Copy link

This would be nice, I can't seem to shake off the default iPhone 8 simulator.

Here's the command i'm running: nx run-ios app --simulator='iPhone 12 Pro'.

@law-geek
Copy link

law-geek commented Feb 2, 2021

Adding the simulator property to options in the run-ios builder in workspace.json seemed to do the trick for me:
Screen Shot 2021-02-02 at 11 34 57 am

@goofiw
Copy link
Author

goofiw commented Feb 10, 2021

@law-geek that's a great work around for now! Hopefully we can get something that scales across multiple dev environments goin.

But that doesn't seem to run on a physical device

@davisk4rpi
Copy link

davisk4rpi commented Feb 10, 2021

For a physical device:

get the name of your connected devices from the command line with:

xcrun xctrace list devices

the output should be something like:

== Devices ==
My MacBook Pro (XXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXX)
My iPhone (14.3) (XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX)

== Simulators ==
iPhone 11 (14.3) (XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX)
iPhone 12 (14.3) (XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX)

In workspace.json under the target project's "architect"

        "run-ios": {
          "builder": "@nrwl/react-native:run-ios",
          "options": {
            "device": "My iPhone"
          }
        }

There is a --device option you can use from the commandline
yarn nx run-ios app-name --device="My iPhone"

but no matter how I have tried to format or slice "My iPhone" it spits out:

error Could not find a device named: ""My iPhone"". Available devices:
 - My MacBook Pro (XXXXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXX)
 - My iPhone (XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX)

@jaysoo jaysoo added the enhancement New feature or request label Feb 10, 2021
@b3coded
Copy link

b3coded commented May 5, 2021

@davisk4rpi maybe something related to:

react-native-community/cli#1404

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants