I have developed an iOS app which now should be deployed into the app store. The problem is, that my client want to do this on his own.
What steps are necessary? And is it possible to deploy the app without Xcode or even from a Windows PC?
Thank you for your help...
Please see below link.
For submission to appstore you need mac ios. if you don't have mac. get a virtual machine and install mac on it if your processor suport virtualization technology. Mostly newly processor supposrt it like core series
Can I distribute (and not develop) my iOS app on the app store using Windows machine
Build your App into an .app file with a "Release" schema:
xcodebuild -target "${PROJECT_NAME}" -sdk "${TARGET_SDK}" -configuration Release
Package your App as an .ipa:
/usr/bin/xcrun -sdk iphoneos PackageApplication -v "${RELEASE_BUILDDIR}/${APPLICATION_NAME}.app" -o "${BUILD_HISTORY_DIR}/${APPLICATION_NAME}.ipa" --sign "${DEVELOPER_NAME}" --embed "${PROVISONING_PROFILE}”
Then, run Application Loader (Download/Install Application Loader if necessary):
open -a /Developer/Applications/Utilities/Application\ Loader.app
Try this Way using Application Loader Application loader for submission
Related
I am attempting to run the iOS simulator from the command line. I have found the location where the iPhone Simulator can be run from. My question is whether or not it can receive parameters to specify which device should be launched and what app it should run.
$ ./Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone Simulator.app/Contents/MacOS/iPhone\ Simulator
Does anyone know if there are tricks to this. Knowing more about this would really help with our Continuous Integration process.
We now use WaxSim to automate our iOS applications during CI Builds
Use the -SimulateApplication argument to run your executable in the simulator (executable inside the .app bundle)
(you could also compile the project from the command-line like this:)
xcodebuild -project Test.xcodeproj -arch i386 -sdk iphonesimulator
Then for example:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app/Contents/MacOS/iPhone\ Simulator -SimulateApplication Test.app/Test
or
./Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone Simulator.app/Contents/MacOS/iPhone\ Simulator -SimulateApplication Test.app/Test
To launch a specific device you can do:
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app/Contents/MacOS/iPhone\ Simulator -SimulateDevice "iPhone Retina (3.5-inch)"
Try this in your shell for Xcode 6
osascript -e 'activate application "iOS Simulator"'
For Xcode 7
osascript -e 'activate application "Simulator"'
If you want to open Simulator with specific app installed then you can use some of the ready utility to launch simulator. This way it is easy to install the app and run on the simulator. This are the command line utilities that can be run from Terminal Window.
iPhoneSim
ios-sim
Other are same as above two.
And main thing is all uses same approach to open simulator. (see the project for more details)
Other way (not recommended by me) use script file to run from command.
You can use xcrun simctl to list available simulators, launch applications, etc. This tool is present in both Xcode 7 and Xcode 8. If you don't give it a command it will print command line help.
xcrun simctl launch <UUID> <bundle id of app> will start the application.
Is it possible to invoke iPhone Simulator and launch app through UIAutomation? If so, is it possible to invoke UIAutomation script through shell script or Java?
Or can I able to do this through applescript? Thanks
Xcode is Applescriptable. Thus you can run a shell script that runs a compiled AppleScript that runs Xcode and tells it to build and run an iOS app with the Simulator selected, which should start the Simulator and launch the app in the Simulator, if there are no build errors, etc.
Yes. We use Java to launch Instruments, run ApplesScript that will load a TraceTemplate for the specific Application\Device\Simulator, and then AppleScript to run (Record) a specified JavaScript.
We have implemented a very robust automation framework for testing iOS apps with entirely "dynamic" test scripting. It does not require jailbreaking the device, and it does not require linking any automation support libraries into the application being tested.
SAFSDEV on SourceForge!
This opensource project has working code which also serves as great examples of the Java, AppleScript, and JavaScript required to do these types of things. It is currently coded to support both iOS 4.3.3 and iOS 5.
Hey it is possible to do that, using below commands
1.Build using the below command
xcodebuild -project myApps.xcodeproj -scheme myApps -configuration Debug -sdk iphonesimulator5.0 clean build
To run UIAtomation scripts
instruments -t /Developer/Platforms/iPhoneOS.platform/Developer/Library/Instruments/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate /Users/sougata/Library/Application\ Support/iPhone\ Simulator/5.0/Applications/22667B7D-B4AF-4134-8C9A-44EEB60304A9/myApps.app/ -e UIASCRIPT Regression.js -e UIARESULTSPATH ~/myreport
I have an iPhone SDK project that is supposed to build a static library for both the simulator and the ARM processor and then combine the two into a universal library.
Heretofore, I was using iPhone SDK 3+ and accomplished this by creating a separate target for each, one simulator and one ARM, and then making a third target that combines them using a shell script. The deployment targets/build settings for each of the constituent targets are set to their respective architectures, etc. Also, iPhone SDK 3+ allowed me to select "Base SDK" from the drop down menu in the upper-left corner of the main XCode window.
Everything worked famously--then I upgraded to SDK 4.
Now, there is no "Base SDK" listing in the drop down menu in the upper-left. Also, the compiler seems to ignore the target deployment settings entirely. Even though one of the targets is set to "iPhone Device" and the other is set to "iPhone Simulator", they still build as whatever is set in the drop down menu.
In case I've not been clear enough, here is the offensive offending aforementioned menu we all know and love:
Once again, in SDK 3 everything worked perfectly. Now in SDK 4, if it's set to "Device" I get two libraries built for ARM. If it's set to simulator, I get two libraries built for the simulator.
Anybody know of a workaround for this bullhonkey?
Thanks much.
UPDATE: the "xcodebuild" command line tool still works, that is to say it will build the correct architecture according to each target's deployment parameters.
Thus, rather than using XCode's GUI to build, I can use a shell script that calls xcodebuild like so:
xcodebuild -target device-target -configuration Debug
xcodebuild -target sim-target -configuration Debug
It'd still be nice to find a real solution, but this will get the job done for now.
Yeah, Apple seems to be frobbing all the XCode controls and options. It's gotten to the point that I don't install Beta SDKs at all or GM/public SDKs if I'm close to finishing an app. I know the upgrade will break something.
Anyway, you should be able to create an External Target or Shell Script Target that builds each and links the libs together. I have a similar shell script for my bag-o-tricks library. In the XCode Project settings, I have set the BaseSDK to the iPhone Device 4.0 SDK. The build script looks roughly like:
xcodebuild -parallelizeTargets -configuration Debug -sdk iphoneos4.0 -target StaticLibs
xcodebuild -parallelizeTargets -configuration Debug -sdk iphonesimulator4.0 -target StaticLibs
xcodebuild -parallelizeTargets -configuration Release -sdk iphoneos4.0 -target StaticLibs
xcodebuild -parallelizeTargets -configuration Release -sdk iphonesimulator4.0 -target StaticLibs
mkdir -p build/Debug-dist build/Release-dist
lipo build/Debug-iphoneos/libfoo.a build/Debug-iphonesimulator/libfoo.a -create -output build/Debug-dist/libfoo.a
lipo build/Release-iphoneos/libfoo.a build/Release-iphonesimulator/libfoo.a -create -output build/Release-dist/libfoo.a
OK, I confess, this is an unrolled version. My actual script has a bunch of for thing in ${LIST_OF_STUFF}; do ... loops to better automated the builds, copy all the include files, and roll up a whole SDK.
I submitted a patch to Core-Plot to automate the creation of an SDK for them. If you use this patch as a reference, remove the GCC_VERSION key/value pair from the SDKSettings.plist or apps building against it will fail.
As far as I understand it, the "Base SDK" in the settings should be the highest possible in the SDK and the "iPhone OS Deployment Target" (also in settings) should be the lowest you need.
So, for example, if you'd want to compile an app for iPhone OS 3.1.2 and above you would have to set the "Base SDK" to 4.0 and "iPhone OS Deployment Target" to 3.1.2 .
On the iPhone sdk 4.0 apple removed every version of iOS lower than 3.2. If you build for iPhone, it automatically builds for 4.0, and if you build for iPad, it will compile as 3.2.
I have a mySample.app file - an iPhone application developed by xcode.
How do I run this (only mySample.app file) application using my xcode?
Please note: this answer is obsolete, the functionality was removed from iOS simulator.
I have just found that you don't need to copy the mobile application bundle to the iPhone Simulator's folder to start it on the simulator, as described in the forum. That way you need to click on the app to get it started, not confortable when you want to do testing and start the app numerous times.
There are undocumented command line parameters for the iOS Simulator, which can be used for such purposes. The one you are looking for is: -SimulateApplication
An example command line starting up YourFavouriteApp:
/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app/Contents/MacOS/iPhone\ Simulator -SimulateApplication path_to_your_app/YourFavouriteApp.app/YourFavouriteApp
This will start up your application without any installation and works with iOS Simulator 4.2 at least. You cannot reach the home menu, though.
There are other unpublished command line parameters, like switching the SDK. Happy hunting for those...
This thread discusses how to install the binary on the simulator. I've done it and it works: http://forums.macrumors.com/showthread.php?t=547557
From the thread:
Look inside your
~/Library/Application Support/iPhone Simulator/User/Applications/
directory and see what happens inside this directory when you install and run apps using XCode, and also when you delete apps using the Simulator.
You can run the Simulator by itself (without starting XCode).
If you start the Simulator, delete an app, quit the Simulator, put back copies of the files that were deleted from the support directory, and restart the Simulator, the app will reappear in the Simulator. Email those files with instructions about how to copy them into the appropriate support directory.
You can install apps in simulator from Xcode 8.2
From Xcode 8.2,You can install an app (*.app) by dragging any previously built app bundle into the simulator window.
Note: You cannot install apps from the App Store in simulation environments.
If you're looking to do this XCode 5+, I found this is the easiest method:
Install ios-sim:
npm install -g ios-sim
Then simply execute:
ios-sim launch ./mySample.app --devicetypeid com.apple.CoreSimulator.SimDeviceType.iPhone-6
In which you can switch up your device type. Simple, fast, and it actually works.
From Xcode v4.3, it is being installed as application.
The simulator is available at
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iOS\
Simulator.app/
Enter the following in the terminal:
$/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app/Contents/MacOS/iPhone\ Simulator -SimulateApplication path/to/your/file/projectname.app/projectname
I see you have a problem. Try building your app as Release and then check out your source codes build folder. It may be called Release-iphonesimulator. Inside here will be the app. Then go to (home folder)/Library/Application Support/iPhone Simulator (if you can't find it, try pressing Command - J and choosing arrange by name). Go to an OS that has apps in it in the iPhone sim, like 4.1. In that folder there should be an Applications folder. Open that, and there should be folders with random lettering. Pick any one, and replace it with the app you have. Make sure to delete anything in the little folders!
If it doesn't work, then I'm dumbfounded.
Select the platform to be iPhone Simulator then click Build and Go. If it builds correctly then it will launch the simulator and run. If it does not build ok then it will indicate errors at the bottom of the window on the right hand side.
If you only have the app file then you would need to manually install that into the simulator. The simulator was not designed to be used this way, but I'm sure it would be possible, even if it was incredibly difficult.
If you have the source code (.proj .m .h etc) files then it should be a simple case of build and go.
This worked for me on iOS 5.0 simulator.
Run the app on the simulator.
Go to the path where you can see something like this:
/Users/arshad/Library/Application\ Support/iPhone\ Simulator/5.0/Applications/34BC3FDC-7398-42D4-9114-D5FEFC737512/…
Copy all the package contents including the app, lib, temp and Documents.
Clear all the applications installed on the simulator so that it is easier to see what is happening.
Run a pre-existing app you have on your simulator.
Look for the same package content for that application as in step 3 and delete all.
Paste the package contents that you have previously copied.
Close the simulator and start it again. The new app icon of the intended app will replace the old one.
The Short Answer
For those who can't wait, the following command installs an iOS app bundle to the specified simulator.
xcrun simctl install 2A3F00EE-F412-4999-8109-ED3D4E70D266 ./YOURAPP.app
The Long Version
The full story is in this Quip doc.
xcrun
Apple has a command-line tool called xcrun that looks for the named command-line tool in the active developer directory and runs it. We will use xcrun simctl in this article.
Active Developer Directory
A user of macOS could install more than one version of Xcode and use the xcode-select command to choose which one to use. Each Xcode bundle that has been installed has a folder called Developer. The following command shows the developer directory that is currently being used.
$ xcode-select -p
/Applications/Xcode.app/Contents/Developer
List Simulator Types
The xcrun simctl list devicetypes command shows all of the simulator types that are installed on the macOS system. Think of simulators as virtual machines (VMs). Each type is like a VM specification.
$ xcrun simctl list devicetypes
== Device Types ==
iPhone 4s (com.apple.CoreSimulator.SimDeviceType.iPhone-4s)
...
iPhone 12 (com.apple.CoreSimulator.SimDeviceType.iPhone-12)
...
Create a Simulator
The following command creates a simulator named yi-iphone12-sim that is of the type com.apple.CoreSimulator.SimDeviceType.iPhone-12, as shown above.
$ xcrun simctl create yi-phone12-sim com.apple.CoreSimulator.SimDeviceType.iPhone-12
No runtime specified, using 'iOS 16.2 (16.2 - 20C52) - com.apple.CoreSimulator.SimRuntime.iOS-16-2'
2A3F00EE-F412-4999-8109-ED3D4E70D266
It prints the ID of the new simulator.
List Created Simulators
The following commands lists simulators.
$ xcrun simctl list devices
== Devices ==
-- iOS 16.2 --
yi-phone12-sim (2A3F00EE-F412-4999-8109-ED3D4E70D266) (Shutdown)
We can see that it lists the simulator yi-iphone12-sim, and its status is Shutdown.
Boot a Simulator
The following command boots the simulator yi-iphone12-sim.
$ xcrun simctl boot 2A3F00EE-F412-4999-8109-ED3D4E70D266
Please note that we can't use the name yi-iphone12-sim. Instead, we'll use the ID.
After the home screen is shown on the simulator window, the xcrun simctl list devices command shows that the simulator is Booted.
$ xcrun simctl list devices
== Devices ==
-- iOS 16.2 --
yi-phone12-sim (2A3F00EE-F412-4999-8109-ED3D4E70D266) (Booted)
Install an App to the Simulator
I checked out this project at https://github.com/sheldonth/ios-cmake/tree/master and built it with CMake. The result is an iOS bundle called ./build.sim64/Release-iphonesimulator/YOURAPP.app.
This app will be installed on the simulator with the following command.
xcrun simctl install 2A3F00EE-F412-4999-8109-ED3D4E70D266 build.sim64/Release-iphonesimulator/YOURAPP.app
I can already build an app with a distribution profile via the command line
xcodebuild -configuration Distribution -sdk iphoneos3.0 clean build
However, I'd like to go one step further and install the app to the connected iPhone and execute it ( as if I'd pressed Build and Run in XCode ).
The final command listed in the build commands window ( cmd+shift+B ) is CodeSign, which as far as I know just signs the code and nothing else. So I'm not sure what command ( if any is available ) I can run from the command line to install and run the app on the iPhone.
I'm running the official SDK, not a jailbroken phone.
If you have a post build script you should be able to install it and run it using a script. If you're jailbroken you should be able to use SCP and then execute it directly.
There may be an AppleScript or automator way of solving the problem as well.
I've written a blog entry on how to install apps on a connected iPad / iPhone without using Xcode or iTunes. This method does NOT require JailBreak - any iOS device will work. Only works on the Mac though.
This method allows you to run a Terminal command to install an iPA file.
http://pervasivecode.blogspot.co.uk/2012/06/install-ios-app-ipa-file-without-xcode.html