使用 Xcode 命令行从 iPhone 下载应用程序的容器

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/27787212/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 06:27:09  来源:igfitidea点击:

Download container for an app from iPhone using Xcode command line

iosxcode

提问by Subodh Nijsure

I have developed an iOS app, this app saves some of the log, that appears in the applications container. I can download this container using Xcode > Device > Select App > Download Container menu option.

我开发了一个 iOS 应用程序,这个应用程序保存了一些出现在应用程序容器中的日志。我可以使用 Xcode > Device > Select App > Download Container 菜单选项下载这个容器。

Then I can see my log file in directory ..../AppData/Documents/mylog.log

然后我可以在目录中看到我的日志文件 ..../AppData/Documents/mylog.log

Basically process describe here https://developer.apple.com/library/ios/recipes/xcode_help-devices_organizer/articles/manage_containers.html

基本上过程在这里描述https://developer.apple.com/library/ios/recipes/xcode_help-devices_organizer/articles/manage_containers.html

However I want to automate this, is there way to download an applications container using Xcode via command line?

但是我想自动化这个,有没有办法通过命令行使用 Xcode 下载应用程序容器?

回答by user1577263

There is a project called ios-deployon github. https://github.com/phonegap/ios-deploy

github上有个项目叫ios-deployhttps://github.com/phonegap/ios-deploy

// Download your app's Documents, Library and tmp folders
ios-deploy --bundle_id 'bundle.id' --download --to MyDestinationFolder

// List the contents of your app's Documents, Library and tmp folders
ios-deploy --bundle_id 'bundle.id' --list

// Download the Documents directory of the app only
ios-deploy --download=/Documents --bundle_id my.app.id --to ./my_download_location

// 下载应用程序的文档、库和 tmp 文件夹
ios-deploy --bundle_id 'bundle.id' --download --to MyDestinationFolder

// 列出应用程序的 Documents、Library 和 tmp 文件夹的内容
ios-deploy --bundle_id 'bundle.id' --list

//下载的应用程序的文件目录中唯一的
IOS部署-表格下载= /文件--bundle_id my.app.id --to ./my_download_location

Also, if you have a jailbreaked phone, you would have the most flexibility of do anything relative to file operations. For example you could copy files using tools like 'scp', 'rsyn';

此外,如果您的手机越狱,您将拥有最大的灵活性来执行与文件操作相关的任何操作。例如,您可以使用“scp”、“rsyn”等工具复制文件;