Skip to content

Commit a52b25e

Browse files
andreialecugrabbou
andauthored
fix(cli-hermes): avoid copying profile to /sdcard (react-native-community#1397)
* fix(cli-hermes): avoid copying profile to /sdcard * chore: fix aslant Co-authored-by: Mike Grabowski <[email protected]>
1 parent 4f17eae commit a52b25e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

packages/cli-hermes/src/profileHermes/downloadProfile.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,11 @@ export async function downloadProfile(
6666

6767
logger.debug('Internal commands run to pull the file:');
6868

69-
// Copy the file from device's data to sdcard, then pull the file to a temp directory
70-
execSyncWithLog(`adb shell run-as ${packageName} cp cache/${file} /sdcard`);
71-
7269
// If --raw, pull the hermes profile to dstPath
7370
if (raw) {
74-
execSyncWithLog(`adb pull /sdcard/${file} ${dstPath}`);
71+
execSyncWithLog(
72+
`adb shell run-as ${packageName} cat cache/${file} > ${dstPath}/${file}`,
73+
);
7574
logger.success(`Successfully pulled the file to ${dstPath}/${file}`);
7675
}
7776

@@ -80,8 +79,9 @@ export async function downloadProfile(
8079
const osTmpDir = os.tmpdir();
8180
const tempFilePath = path.join(osTmpDir, file);
8281

83-
execSyncWithLog(`adb pull /sdcard/${file} ${tempFilePath}`);
84-
82+
execSyncWithLog(
83+
`adb shell run-as ${packageName} cat cache/${file} > ${tempFilePath}`,
84+
);
8585
// If path to source map is not given
8686
if (!sourcemapPath) {
8787
// Get or generate the source map

0 commit comments

Comments
 (0)