Skip to content

Commit ed07bcd

Browse files
Mykola MokhnachSrinivasanTarget
Mykola Mokhnach
authored andcommitted
Update the documentation on push/pull file helpers (#906)
1 parent f25f3fe commit ed07bcd

File tree

3 files changed

+62
-18
lines changed

3 files changed

+62
-18
lines changed

src/main/java/io/appium/java_client/InteractsWithFiles.java

Lines changed: 30 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,21 @@ public interface InteractsWithFiles extends ExecutesMethod {
2929

3030
/**
3131
* Pull a file from the simulator/device.
32+
* On iOS the server should have ifuse
33+
* libraries installed and configured properly for this feature to work
34+
* on real devices.
35+
* On Android the application under test should be
36+
* built with debuggable flag enabled in order to get access to its container
37+
* on the internal file system.
3238
*
33-
* @param remotePath On Android and iOS, this is either the path to the file
34-
* (relative to the root of the app's file system). On iOS only,
35-
* if path starts with /AppName.app, which will be replaced with
36-
* the application's .app directory
39+
* @see <a href="https://github.com/libimobiledevice/ifuse">iFuse GitHub page6</a>
40+
* @see <a href="https://github.com/osxfuse/osxfuse/wiki/FAQ">osxFuse FAQ</a>
41+
* @see <a href="https://developer.android.com/studio/debug/">'Debug Your App' developer article</a>
42+
*
43+
* @param remotePath If the path starts with <em>@applicationId/</em>/ prefix, then the file
44+
* will be pulled from the root of the corresponding application container.
45+
* Otherwise the root folder is considered as / on Android and
46+
* on iOS it is a media folder root (real devices only).
3747
* @return A byte array of Base64 encoded data.
3848
*/
3949
default byte[] pullFile(String remotePath) {
@@ -44,15 +54,23 @@ default byte[] pullFile(String remotePath) {
4454
}
4555

4656
/**
47-
* Pull a folder from the simulator/device. Does not work on iOS Real
48-
* Devices, but works on simulators
57+
* Pull a folder content from the simulator/device.
58+
* On iOS the server should have ifuse
59+
* libraries installed and configured properly for this feature to work
60+
* on real devices.
61+
* On Android the application under test should be
62+
* built with debuggable flag enabled in order to get access to its container
63+
* on the internal file system.
64+
*
65+
* @see <a href="https://github.com/libimobiledevice/ifuse">iFuse GitHub page6</a>
66+
* @see <a href="https://github.com/osxfuse/osxfuse/wiki/FAQ">osxFuse FAQ</a>
67+
* @see <a href="https://developer.android.com/studio/debug/">'Debug Your App' developer article</a>
4968
*
50-
* @param remotePath On Android and iOS, this is either the path to the file
51-
* (relative to the root of the app's file system). On iOS only,
52-
* if path starts with /AppName.app, which will be replaced with
53-
* the application's .app directory
54-
* @return A byte array of Base64 encoded data, representing a ZIP ARCHIVE
55-
* of the contents of the requested folder.
69+
* @param remotePath If the path starts with <em>@applicationId/</em> prefix, then the folder
70+
* will be pulled from the root of the corresponding application container.
71+
* Otherwise the root folder is considered as / on Android and
72+
* on iOS it is a media folder root (real devices only).
73+
* @return A byte array of Base64 encoded zip archive data.
5674
*/
5775
default byte[] pullFolder(String remotePath) {
5876
Response response = execute(PULL_FOLDER, ImmutableMap.of("path", remotePath));

src/main/java/io/appium/java_client/android/PushesFiles.java

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,18 +32,32 @@ public interface PushesFiles extends InteractsWithFiles, ExecutesMethod {
3232

3333
/**
3434
* Saves base64 encoded data as a file on the remote mobile device.
35+
* The application under test should be
36+
* built with debuggable flag enabled in order to get access to its container
37+
* on the internal file system.
38+
*
39+
* @see <a href="https://developer.android.com/studio/debug/">'Debug Your App' developer article</a>
3540
*
3641
* @param remotePath Path to file to write data to on remote device
42+
* If the path starts with <em>@applicationId/</em> prefix, then the file
43+
* will be pushed to the root of the corresponding application container.
3744
* @param base64Data Base64 encoded byte array of data to write to remote device
3845
*/
3946
default void pushFile(String remotePath, byte[] base64Data) {
4047
CommandExecutionHelper.execute(this, pushFileCommand(remotePath, base64Data));
4148
}
4249

4350
/**
44-
* Saves given file as a file on the remote mobile device.
51+
* Saves the given file to the remote mobile device.
52+
* The application under test should be
53+
* built with debugMode flag enabled in order to get access to its container
54+
* on the internal file system.
4555
*
46-
* @param remotePath Path to file to write data to on remote device
56+
* @see <a href="https://developer.android.com/studio/debug/">'Debug Your App' developer article</a>
57+
*
58+
* @param remotePath Path to file to write data to on remote device.
59+
* If the path starts with <em>@applicationId/</em> prefix, then the file
60+
* will be pushed to the root of the corresponding application container.
4761
* @param file is a file to write to remote device
4862
* @throws IOException when there are problems with a file or current file system
4963
*/

src/main/java/io/appium/java_client/ios/PushesFiles.java

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,14 +31,21 @@ public interface PushesFiles extends ExecutesMethod {
3131

3232
/**
3333
* Saves base64 encoded data as a media file on the remote mobile device.
34-
* This method is only supported on Simulator running Xcode SDK 8.1+.
34+
* The server should have ifuse
35+
* libraries installed and configured properly for this feature to work
36+
* on real devices.
37+
*
38+
* @see <a href="https://github.com/libimobiledevice/ifuse">iFuse GitHub page</a>
39+
* @see <a href="https://github.com/osxfuse/osxfuse/wiki/FAQ">osxFuse FAQ</a>
3540
*
3641
* @param remotePath Path to file to write data to on remote device
37-
* Only the filename part matters there, so the remote end
42+
* Only the filename part matters there on Simulator, so the remote end
3843
* can figure out which type of media data it is and save
3944
* it into a proper folder on the target device. Check
4045
* 'xcrun simctl addmedia' output to get more details on
41-
* supported media types
46+
* supported media types.
47+
* If the path starts with <em>@applicationId/</em> prefix, then the file
48+
* will be pushed to the root of the corresponding application container.
4249
* @param base64Data Base64 encoded byte array of media file data to write to remote device
4350
*/
4451
default void pushFile(String remotePath, byte[] base64Data) {
@@ -47,7 +54,12 @@ default void pushFile(String remotePath, byte[] base64Data) {
4754

4855
/**
4956
* Saves base64 encoded data as a media file on the remote mobile device.
50-
* This method is only supported on Simulator running Xcode SDK 8.1+.
57+
* The server should have ifuse
58+
* libraries installed and configured properly for this feature to work
59+
* on real devices.
60+
*
61+
* @see <a href="https://github.com/libimobiledevice/ifuse">iFuse GitHub page</a>
62+
* @see <a href="https://github.com/osxfuse/osxfuse/wiki/FAQ">osxFuse FAQ</a>
5163
*
5264
* @param remotePath See the documentation on {@link #pushFile(String, byte[])}
5365
* @param file Is an existing local file to be written to the remote device

0 commit comments

Comments
 (0)