Skip to content

Warn when skip doctor/skip checkup can't find any attached devices#196

Open
dfabulich wants to merge 4 commits intoskiptools:mainfrom
dfabulich:doctor-adb-devices-warning
Open

Warn when skip doctor/skip checkup can't find any attached devices#196
dfabulich wants to merge 4 commits intoskiptools:mainfrom
dfabulich:doctor-adb-devices-warning

Conversation

@dfabulich
Copy link
Copy Markdown
Contributor

Fixes #186

skip doctor warns if it can't find devices

If skip doctor doesn't detect any attached Android devices, it will log a warning, like this:

[!] No Android devices running. Xcode builds will fail until you attach a device, launch an emulator in Android Studio, or run: skip android emulator launch

Otherwise, it will log how many devices it detected:

[✓] Android devices: 1 connected

skip init can now install to an emulator

skip init has a new argument, --launch-android, which will attempt to launch the app on an emulator. I don't expect regular users will want to use it much, but I needed it for skip checkup

skip checkup will attempt to launch if it detects devices

When skip checkup runs the doctor command, it will return a boolean, saying whether it detected any devices. If it did detect devices, skip checkup will pass launchAndroid: true to initSkipProject. This will install and launch the app on an attached device.

If doctor detected no devices, checkup will pass launchAndroid: false. The conclusion will be successful with 1 warning.

Skip Pull Request Checklist:

  • REQUIRED: I have signed the Contributor Agreement
  • REQUIRED: I have tested my change locally with swift test
  • OPTIONAL: I have tested my change on an iOS simulator or device
  • OPTIONAL: I have tested my change on an Android emulator or device

  • AI was used to generate or assist with generating this PR. Please specify below how you used AI to help you, and what steps you have taken to manually verify the changes.

I mostly used Cursor to generate this code. I reviewed every line and tested it manually:

  • skip doctor with/without a running emulator
  • skip checkup with/without a running emulator
    • … and I verified that the app actually launched on the emulator

@cla-bot cla-bot bot added the cla-signed label Feb 28, 2026
@dfabulich dfabulich mentioned this pull request Mar 9, 2026
Copy link
Copy Markdown
Member

@marcprux marcprux left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This skip doctor command is meant to check if the system prerequisites are satisfied for Skip, not necessarily that it is "ready to go". It is used, e.g., as the first step in CI workflows to make sure that everything is in order.

That being said, I do think that this could be a valuable addition. Could we gate this check behind a "--preflight" flag?

@dfabulich
Copy link
Copy Markdown
Contributor Author

I think instead of an opt-in --preflight argument, we'd want an opt-out --no-check-devices argument that CI could use.

IMO, the core problem is newbies coming to us saying "Hey, uh, I tried Skip, but it's not working," without specifying exactly how it's "not working." So we want to be able to give them a really specific instruction, easy to follow: "Please run skip checkup and make sure that works."

Today, skip checkup doesn't prove that Xcode builds will actually work, because Xcode builds will attempt to deploy to an emulator. It's a typical newbie mistake to forget to launch the emulator, and so the simple default skip checkup should tell them clearly "Here's your problem: you forgot to start your emulator."

We especially don't want newbies to have to separately opt-in to giving us the information we need. (Since they're newbies, they're not going to know about optional CLI arguments.) If they run skip checkup and it's green, we don't want to have to go back and say, "oh, uh, sorry, could you run skip checkup --preflight?"

If anyone should jump through extra hoops, it's CI, which is running code anyway. CI can run skip checkup --no-check-devices. (IMO, it would be fine for CI to run plain old skip checkup and have that succeed with 1 warning that there are no running emulators.)

@dfabulich dfabulich force-pushed the doctor-adb-devices-warning branch from 9873960 to d318e76 Compare March 20, 2026 20:55
@dfabulich dfabulich requested a review from marcprux March 20, 2026 20:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

skip doctor/skip checkup doesn't attempt to connect to the Android emulator

2 participants