A file transfer and clipboard synchronization tool between Windows and iOS devices implemented using Python and Shortcuts.
python==3.10.6
flask==3.0.0
psutil==5.9.6
pyinstaller==6.2.0
windows_toasts==1.1.0
pillow==10.1.0
pyperclip~=1.8.2
pystray==0.19.5
pyinstaller --add-data 'config;config' --add-data 'static;static' -w AirDropPlus.py
-
Network
- Your iPhone and PC must be on the same LAN, or the PC can connect to the iOS hotspot, or vice versa.
- (It doesn't use data when transferring files via a hotspot.)
-
Install Bonjour on PC (optional)
- Bonjour allows you to access Windows using the 'hostname.local' instead of an IP address.
- The latest version of Bonjour may encounter issues accessing 'hostname.local'. Please use an older version instead.
-
Set up AirdropPlus
- Modify the configuration file 'config.ini' to set the file save path and key.
- The packaged configuration file is located at '_internal/config.ini'.
-
Start AirDropPlus.exe
Start 'AirDropPlus.exe', and when prompted with the following pop-up, please click to allow.
-
Get the shortcut on your iPhone.
https://www.icloud.com/shortcuts/d8ba54ce9e674becaf951a076ac1d967
-
Set up the shortcut:
- host:'hostname.local' (or the host IP address instead)
- port:The same port number set in 'config.ini'
- key:The same key set in 'config.ini'
- simplify:Enabling this will disable the function to send the iOS clipboard
-
Set the trigger method of the shortcut:
- Set it up in 'Settings-Accessibility-Touch-BackTap' to trigger with a double-tap on the back of the iPhone.
- The iPhone 15 Pro series can set it to trigger with the side button.
-
Functionality Testing:
-
Send files:
Tap the 'AirDrop Plus' shortcut from the file sharing menu.
-
Send texts:
- Copy the text which you want to send.
- Trigger the shortcut, then tap the 'Send' option.
-
Receive files or texts:
- Trigger the shortcut
- Tap the 'Receive' option to receive file or text from PC's clipboard.
-
- Check if the local area network (LAN) environment is unobstructed. In campus network environments, communication with LAN devices may be prohibited.
- Verify that the port number set in the config.ini file matches the one set in the shortcut.
- Ensure that the hostname set in the shortcut is consistent with the PC's hostname (the hostname should not be in Chinese). You can also try changing hostname.local to IP address.
- Check if the PC's firewall is blocking the port set in the config.ini file. Remove all entries related to AirDropPlus and restart AirDropPlus. After the restart, please allow the pop-up for network requests.
- It's possible that the PC's system version is too old to support interactive notifications. Try changing to basic notifications in the config.ini file.
- Up to now, the input type obtained via the shortcut depends on the language of the iOS device. I have only considered input types in English, Simplified Chinese, and Traditional Chinese. If your iOS device is set to another language, errors may occur.
- You can try adding the type name of 'Text' in your iOS device's language into the brackets, separated by '|'.
Arg Name | Type | Description |
---|---|---|
ShortcutVersion | String | The version of the shortcut. It must match the 'version' in the config.ini file. |
Authorization | String | The key. It must match the first two segments of the 'key' in the config.ini file. For example, if the config.ini file has a version 1.5.1, this should be 1.5. |
Send a file from the mobile device to the PC.
[POST] /file
Request Body: Form
Arg Name | Type | Description |
---|---|---|
file | File | The File to Send |
- Return Type: JSON
- Return Content:
{ "success": true, "msg": "发送成功", "data": null }
Retrieve a file on the PC
[GET] /file/[path]
Arg Name | Type | Description |
---|---|---|
path | String | Base64 encoding of the file path |
- Return Type: File
Send the clipboard to PC
[POST] /clipboard
- Request Body: Form
Arg Name | Type | Description |
---|---|---|
clipboard | String | Mobile Clipboard Content |
- Return Type: JSON
- Return Content:
{ "success": true, "msg": "发送成功", "data": null }
Retrieve the Clipboard Content on PC
[GET] /clipboard
- Return Type: JSON
- Return Content:
- When the Clipboard Contains Text:
{ "success": true, "msg": "", "data": { "type": "text", "data": "clipboard_text" } }
- When the Clipboard Contains File:
{ "success": true, "msg": "", "data": { "type": "file", "data": ["file1_path_base64", "file2_path_base64", "file3_path_base64"] } }
- When the Clipboard Contains Image:
{ "success": true, "msg": "", "data": { "type": "img", "data": "img_base64_code" } }
- When the Clipboard Contains Text:
Test Connection
[GET] /
- Return Type: Text
- Return Content: Hello world!