cli
cli copied to clipboard
WIP: feat: List available apple devices
Summary:
Hey, so this is a WIP for listing available apple devices in an interactive cli prompt. The intention of this is to be able to let the user select an available simulator vs. having to paste device name/udid strings in.
I wanted to put this up as a WIP first because I don't know which path to take next...
- I could have this be its own helper function, that just lists out the sims (its current state) -- Do we want this as an optional helper for users?
- I could merge it into the
run-ios
flow (initial thoughts: if user doesn't select a sim, one isn't booted or the one they supply isn't available/existing, instead of fallbacks we give this prompt and then carry-on the run-ios command) - Something else? Maybe a combination of 1 & 2 (it's available standalone, and also inside
run-ios
)? π€
Some advice would be really helpful here as my only experience with the CLI has been my own (and teams') usage. I don't feel I have the context to make a judgement call here for a whole community. Maybe it's super obvious/simple, I just don't know π€·
Test Plan:
WIP
How does it look like from the UI perspective? Can you share a screenshot maybe? :)
Yeah, definitely. It looks like this right now:
I was thinking about it a bit more, and it should probably not be its own function, but be added to the run-ios
command. I think in two cases:
- By passing an extra argument/flag like
run-ios --list-simulators
- Replacing the
fallbackSimulators
logic with this interactive approach. (fallbackSimulators
seems kinda jank anyway...I'd thought of having them live together, butfallbackSimulators
seems like a pain to maintain and is a "dumb" approach compared to just asking the user what they want in a simple way vs. assuming)
What do you think?
This looks nice! Any chance it could list connected real devices as well as simulators too?
Thanks for the contribution @esthor ! πͺ
I wanted to put this up as a WIP first because I don't know which path to take next... I could have this be its own helper function, that just lists out the sims (its current state) -- Do we want this as an optional helper for users? I could merge it into the run-ios flow (initial thoughts: if user doesn't select a sim, one isn't booted or the one they supply isn't available/existing, instead of fallbacks we give this prompt and then carry-on the run-ios command) Something else? Maybe a combination of 1 & 2 (it's available standalone, and also inside run-ios)? π€
Maybe sth like what doctor
is doing? List available devices and if user taps "exit" key we will skip selection of device and fall back to default behaviour? WDYT?
Also, can you add (Booted) info for your listing to show which device is booted and can be used?
This looks nice! Any chance it could list connected real devices as well as simulators too?
Yes! Good call. I didn't test this out, but should be doable. I'll put them at the top, and maybe flag them in some way that makes it obvious. I'm imagining that in most cases, if you have a connected physical device, your intention is probably to use that, so I'll put those first.
Thanks for the contribution @esthor ! πͺ
I wanted to put this up as a WIP first because I don't know which path to take next... I could have this be its own helper function, that just lists out the sims (its current state) -- Do we want this as an optional helper for users? I could merge it into the run-ios flow (initial thoughts: if user doesn't select a sim, one isn't booted or the one they supply isn't available/existing, instead of fallbacks we give this prompt and then carry-on the run-ios command) Something else? Maybe a combination of 1 & 2 (it's available standalone, and also inside run-ios)? π€
Maybe sth like what
doctor
is doing? List available devices and if user taps "exit" key we will skip selection of device and fall back to default behaviour? WDYT?Also, can you add (Booted) info for your listing to show which device is booted and can be used?
Oh, that sounds interesting. I will take a look at how the doctor
works, but sounds very good to me.
And yeah, will add a Booted
and a Connected
flag or section or some way to call those out and have them show at the top of the list.
- [ ] Add 'Booted' / 'Available'
- [ ] Add 'Connected Physical Devices'
Hi @esthor . Do you need any assistance with wrapping this PR? π Happy to help and continue on this PR if you are swarmed with other tasks :)
Hey! Going to look at it this week. π
Took the liberty of pushing this PR a bit further - add --list-devices
param option to run-ios
command:

As visible on screenshot we will also now show connected iPhone's as well.
Oh my gosh. You guys are fantastic. Sorry for delaying this so much. Turns out having a new child can throw off my scheduling. π π¨βπΌ Please lmk how I can assist today
Oh my gosh. You guys are fantastic. Sorry for delaying this so much. Turns out having a new child can throw off my scheduling. π π¨βπΌ Please lmk how I can assist today
No worries, there are priorities I guess πΆπ»
You can try to run it locally and see how it goes ;)
Nice! Ran it locally, and it's looks great for both iOS and Android! π