Download container for an app from iPhone using Xcode command line - ios

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.
Then I can see my log file in directory ..../AppData/Documents/mylog.log
Basically process describe here 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?

There is a project called ios-deploy on github. https://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
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';

Related

Cannot access application file in container bundle

I want to access an sqlite database file which I have bundled to my iOS application.
This works fine, because I can see I can read/write from/to the database by the application logic.
If I run the application by the simulator I can find the database here:
file:///Users/<Username>/Library/Developer/CoreSimulator/Devices/<DeviceID>/data/Containers/Bundle/Application/<ApplicationID>/<AppName>/test.db
But if I run the application on a real device it seems difficult to access the data, In Xcode I've tried to export the container in "Devices and simulators", download it, open the package content of the .xcappdata file but I can't find the file "test.db":
Where and How can I access the file?
Xcode will not import the Application part which contains the binary and all the files you bundle with it.
When working with an file which is bundled in your app it is better to copy it into Library or Document directory the first time the application is run. So you never modify the bundle one which should only be a init file and not a working file.
When it is in Document or Library, you can then get it via xCode.

Alternative for hybrid web app without knowledge in app/server

i used to upload my ZIP (with HTML5/CSS web app) in phonegap since 4, 5 years and create cool mobile apps. But since some months it's look like Adobe dismiss the project, no more answer on forum etc.
Is there a good solution, when you don't know everything about shift/cocoa/java and server things, to simply upload your webapp (basically a website in a zip) and get IPA/APK ?
I heard about monaco or voltbuilder. Thanks
Not really. Although I can confirm https://build.phonegap.com works for me. If you have an error related to a malformed xml, you can try to delete the project on the website and re-uplading the zip file onto a new project. That's a bug I have experienced in the past.
Otherwise, you can install Cordova and Phonegap on your pc to build it using npm on the terminal (Linux/MacOs).
$ sudo npm install -g cordova
or for windows (CMD):
C:\> npm install -g cordova
then navigate with the command line using cd to go to a folder
eg. cd myfolder.
You can see the files in your current directory with ls (Linux/MacOs) or lsdir (windows)
Once you are in your project's folder and that you can see with lsdir or ls your config.xml file of your project, then you can run those commands to add the platform you want to build:
cordova platform add ios
cordova platform add android
Finally to build the app, you need to:
cordova build
Note: To build an Ipa, you will need to use a device running MacOs since it requires XCode. I highly recommand you to get familiar with Cmd or the terminal if you are building an app.
I hope I have answered your question well

How to export and run iOS project from Kony Visualizer to Xcode?

I am not used to work with kony platform and I have created simple app but I want to export it and run it as native iOS .xcocdeproj.
Kony Visualizer gives you different ways of building and viewing your app, depending on your needs. In Kony Visualizer Enterprise, you can build your app either from the Product menu, or from a command line. And you can view your built app either by previewing it on a mobile device, or by using device emulators and simulators that you configure. Please refer to this docs link to build for iOS using Kony Visualizer.
Please do this below steps.
once Kar file was build. go to your visualizer installation folder and go to plugins and then you can find com.kony.ios_8.2.28.v201811051627.jar file if you are using 8.2.28 version just for example.
Copy above file and rename it as zip file and unzip it.
once unzip was done inside you can find another zip file please unzip. ( ex: 8.2.28.zip)
you can see folder called VMAppWithKonylib.
now go open command-line tool and go to VMAppWithKonylib location.
now go to gen folder location inside your commandline. gen folder will inside VMAppWithKonylib.
7.now run this command - perl extract.pl konyappiphone.KAR
once extract done now go to VMAppWithKonylib and open project in xcode.
let me know if you are facing any more issues.

XCode: Run script after application unitest to copy files from device

I run an application test from XCode on my device.
The test creates some files on the device.
After the tests has finihsed i would like to copy these file from the device to my machine.
Does anyone know how to achieve that?
I am using XCode 4.6.2
thanks
Christian
Assuming the files are created in the Documents directory, you can use iTunes file sharing to get the files.
Here's a tutorial
EDIT based on comment
Not sure if this fits your use case - you could try integration with the Dropbox API. Your app, once the files are created, can sync the files in a Dropbox folder. You can have the Windows/Mac app installed to have the files synced to your computer as well.

Packaging a BlackBerry (WebWorks) PhoneGap/Cordova application

I'm working with PhoneGap/Cordova and the only options I see is to build to the emulator or to build for debuging to the device.
I want to package the app for further distribution and publishing. Any thoughts?
Thanks!!
First build with
ant blackberry build
Then, you need to get and install signing keys:
https://developer.blackberry.com/html5/documentation/signing_setup_smartphone_apps_1920010_11.html
Then finally, once you are able to code sign you need to use bbwp to sign and package the zip file generated by the build (the zip is in the build directory of the PhoneGap folder). So navigate to your sdk/bin directory and run:
bbwp C:\myapp\HelloWorld.zip -g mypassword -o C:\myapp\signed
This generates two folders in C:\myapp\signed which contain the signed files. You will need different files depending on the distribution method and a summary is here:
https://developer.blackberry.com/html5/documentation/distributing_your_app_1866990_11.html
https://developer.blackberry.com/html5/documentation/signing_landing_page.html
https://developer.blackberry.com/html5/documentation/distributing_your_app_1866990_11.html
You need to get a signing key from RIM in order to publish your apps to the Blackberry App World. My previous experiences was packaging the app with signing key and allow others to install the app with BlackBerry Desktop Manager using the .alx file generated.
cd into the top level directory of your project (the one that contains the www/ folder). Then call this command:
ant TARGET build
Where TARGET can be blackberry, playbook, or qnx (beta right now). This will create a build/ folder which should contain the needed files for further packaging.

Resources