Skip to content

Commit

Permalink
Windows-specific ideviceinstaller commands
Browse files Browse the repository at this point in the history
  • Loading branch information
baltpeter committed Apr 16, 2023
1 parent f7a8173 commit 4f0837f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ An ID of a known permission on iOS.

#### Defined in

[ios.ts:377](https://github.com/tweaselORG/appstraction/blob/main/src/ios.ts#L377)
[ios.ts:382](https://github.com/tweaselORG/appstraction/blob/main/src/ios.ts#L382)

___

Expand Down Expand Up @@ -286,7 +286,7 @@ The IDs of known permissions on iOS.

#### Defined in

[ios.ts:360](https://github.com/tweaselORG/appstraction/blob/main/src/ios.ts#L360)
[ios.ts:365](https://github.com/tweaselORG/appstraction/blob/main/src/ios.ts#L365)

## Functions

Expand Down
11 changes: 8 additions & 3 deletions src/ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,10 @@ export const iosApi = <RunTarget extends SupportedRunTarget<'ios'>>(
clearStuckModals: asyncUnimplemented('clearStuckModals') as never,

isAppInstalled: async (appId) => {
const { stdout } = await execa('ideviceinstaller', ['-l', '-o', 'list_all']);
const { stdout } =
process.platform === 'win32'
? await execa('ideviceinstaller', ['-l', '-o', 'list_all'])
: await execa('ideviceinstaller', ['list', '-o', 'list_all']);
return (
stdout
.split('\n')
Expand All @@ -176,10 +179,12 @@ export const iosApi = <RunTarget extends SupportedRunTarget<'ios'>>(
// We're using `libimobiledevice` instead of `cfgutil` because the latter doesn't wait for the app to be fully
// installed before exiting.
installApp: async (ipaPath) => {
await execa('ideviceinstaller', ['--install', ipaPath]);
if (process.platform === 'win32') await execa('ideviceinstaller', ['install', ipaPath]);
else await execa('ideviceinstaller', ['--install', ipaPath]);
},
uninstallApp: async (appId) => {
await execa('ideviceinstaller', ['--uninstall', appId]);
if (process.platform === 'win32') await execa('ideviceinstaller', ['uninstall', appId]);
else await execa('ideviceinstaller', ['--uninstall', appId]);
},
async setAppPermissions(appId, _permissions) {
if (!options.capabilities.includes('ssh') || !options.capabilities.includes('frida'))
Expand Down

0 comments on commit 4f0837f

Please sign in to comment.