Skip to content

Commit

Permalink
Support spaces in iOS app name (#626)
Browse files Browse the repository at this point in the history
* Support spaces in iOS app name

* Fixed the unit test for spaces in paths
  • Loading branch information
lukefanning authored and LeoNatan committed Mar 17, 2018
1 parent 9a7636b commit aba9619
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion detox/src/devices/AppleSimUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 70,7 @@ class AppleSimUtils {
trying: `Installing ${absPath}...`,
successful: `${absPath} installed`
};
await this._execSimctl({ cmd: `install ${udid} ${absPath}`, statusLogs });
await this._execSimctl({ cmd: `install ${udid} "${absPath}"`, statusLogs });
}

async uninstall(udid, bundleId) {
Expand Down
2 changes: 1 addition & 1 deletion detox/src/devices/AppleSimUtils.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 250,7 @@ describe('AppleSimUtils', () => {
await uut.install('udid', 'somePath');
expect(exec.execWithRetriesAndLogs).toHaveBeenCalledTimes(1);
expect(exec.execWithRetriesAndLogs).toHaveBeenCalledWith(
`/usr/bin/xcrun simctl install udid somePath`,
`/usr/bin/xcrun simctl install udid "somePath"`,
undefined,
expect.anything(),
1);
Expand Down
4 changes: 2 additions & 2 deletions detox/src/devices/SimulatorDriver.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 18,7 @@ class SimulatorDriver extends IosDriver {
const detoxFrameworkPath = await environment.getFrameworkPath();

if (!fs.existsSync(detoxFrameworkPath)) {
throw new Error(`${detoxFrameworkPath} could not be found, this means either you changed a version of Xcode or Detox postinstall script was unsuccessful.
throw new Error(`${detoxFrameworkPath} could not be found, this means either you changed a version of Xcode or Detox postinstall script was unsuccessful.
To attempt a fix try running 'detox clean-framework-cache && detox build-framework-cache'`);
}
}
Expand All @@ -31,7 31,7 @@ class SimulatorDriver extends IosDriver {

async getBundleIdFromBinary(appPath) {
try {
const result = await exec(`/usr/libexec/PlistBuddy -c "Print CFBundleIdentifier" ${path.join(appPath, 'Info.plist')}`);
const result = await exec(`/usr/libexec/PlistBuddy -c "Print CFBundleIdentifier" "${path.join(appPath, 'Info.plist')}"`);
const bundleId = _.trim(result.stdout);
if (_.isEmpty(bundleId)) {
throw new Error();
Expand Down

0 comments on commit aba9619

Please sign in to comment.