settings clear-app-state fails with ENOENT … scandir '(null)' for iOS system apps such as Settings
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 80/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- typescript
- Domain
- mobile
Research direction
Start with clearIosSimulatorAppState in packages/platform-apple/src/core/app-settings.ts and inspect how it handles the simctl get_app_container output before calling readHostDirectory. Check for tests covering clearing iOS simulator app state; the issue does not name a test file. Done means (null) is refused with an app-specific unsupported-operation message instead of causing an ENOENT error.
Written by the indexing model from the issue text.
Description
What happens
On an iOS simulator, clearing the state of a system app fails with an internal error instead of a clear refusal:
agent-device settings clear-app-state clear --app com.apple.Preferences --platform ios --udid <udid>
ENOENT: no such file or directory, scandir '(null)'
Reproduced with agent-device 0.21.22 on an iOS 26.5 simulator (Xcode 27.0). 0.21.23 has the same code.
Cause
clearIosSimulatorAppState in packages/platform-apple/src/core/app-settings.ts rejects only an empty container path:
const containerPath = result.stdout.trim();
if (!containerPath) { throw new AppError('COMMAND_FAILED', …); }
const entries = await readHostDirectory(containerPath);
For an app without a data container, simctl exits 0 and prints the literal text (null):
$ xcrun simctl get_app_container <udid> com.apple.Preferences data
(null)
$ echo $?
0
The check passes, and readHostDirectory('(null)') throws ENOENT.
Suggested fix
Treat (null) like an empty path, and refuse with a message that names the app, for example UNSUPPORTED_OPERATION: com.apple.Preferences has no data container to clear (system apps have none).
- Dominant language
- TypeScript
- Stars
- 4.9k
- Forks
- 328
- Avg merge
- 12h 18m
- Merged PRs (30d)
- 538
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from callstack/agent-device
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
callstack/agent-device#3353 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
callstack/agent-device#1869 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
callstack/agent-device#3392 ·
Maintainers usually reply within 1 day
-
settings permission --app writes a display name as the bundle id instead of resolving itPossibly taken @thymikee claimed this today. Open
Difficulty 3/5 1-2 days Newbie friendliness 22/100
callstack/agent-device#3384 ·
Maintainers usually reply within 1 day
-
iOS: a canceled request releases the session lock while its runner command still runs on the devicePossibly taken @thymikee claimed this today. Open
Difficulty 4/5 3-5 days Newbie friendliness 22/100
callstack/agent-device#3383 ·
Maintainers usually reply within 1 day
All issues in callstack/agent-device
Similar issues
-
area: desktop area: website priority: P2 type: feature
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
appandflow/stim#3411 · 1 comment ·
Maintainers usually reply within 1 day
-
needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
rjsf-team/react-jsonschema-form#5485 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 65/100
lingdojo/kana-dojo#32090 · 1 comment · 5 reactions ·
Maintainers usually reply within 1 day
-
Friction: Org home and org switcher copy still say repositories and connected agents live in the personal accountPossibly taken A pull request linked to this issue is open or already merged. Openfriction
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
kentcdodds/kody#3265 ·
Maintainers usually reply within 1 day