iParade requires Cordova. Once installed, go to
the /dev
directory of this repository and run the following commands:
cordova platform add ios
cordova platform add android
This will build the applications in the /platforms
directory.
Plugins are managed via shell script dev/hooks/after_platform_add/plugins.sh which is run after each platform is added. You can also manually add or remove plugins via the CLI:
cordova plugin add [plugin name]
cordova plugin rm [plugin name]
Plugins and platforms should not be saved to this repository, but rather rebuilt on the local developer's file system.
The iParade application can be tested using the iOS Simulator and/or the Android Emulator. Check the Cordova CLI documentation for more information.
The iOS simulator can be quirky when it comes to location services. If the
location is not set prior to the application loading, the geolocation error
callback will probably get thrown. To simulate the locations, open the built
iOS project, found at /dev/platforms/ios/iParade.xcodeproj
. Run the
project, and in XCode go to the menu: Debug > Simulate Location > Add GPX File
to Project. GPX location files are located in the locations directory.
Sometimes, the application will not recognize the location on the first try. After loading the GPX files and setting the location, try quitting the iOS Simulator and running it again from XCode.
The Android Emulators are also a little quirky when it comes to location services and GPS positioning. As per the Android Emulator docs, you can set the location from the command line. After downloading the Android SDK and creating a virtual device, start the emulator from the command line with:
cordova emulate --target=YourVirtualDeviceName android
Once the emulator is running, run:
telnet localhost 5554
And then use the geofix command to set the location:
geo fix -73.948793 40.822375
Note that longitude value comes first.
When running the app from XCode, console.log outputs to the XCode debugger pane. But you can also use the Safari Web Inspector tools to inspect the DOM, insert JS breakpoints, and more. Once the Simulator is running, open Safari. Click the Develop menu and select iOS Simulator.
Chrome provides a similar inspector for the Android Emulator. Once the
virtual device is running, open Chrome and proceed to chrome://inspect/#devices.
Click the inspect
link for the emulated to device to access the Chrome
inspector.
A full Android system log can be tailed via the command line with:
adb logcat
After running phonegap build ios
, a few things need to be set from within
XCode, as I haven't yet found a way to manage the plist settings properly from
config.xml.
- In
iParade > Deployment info
, check boxes for Device Orientation to "Landscape Left" and "Landscape Right" for both iPhone and iPad - In
iParade > Resources > iParade-Info.plist
add a row for View controller-based status bar appearance and set the Value to "NO". Add another row for Status bar is initially hidden and set the Value to "YES". This hides the status bar in iOS 7. - Also in
iParade > Resources > iParade-Info.plist
, add a row for UIRequiresFullScreen and set to YES. This gets around a new issue in iOS 9, where submission to the app store fails with ERROR ITMS-90474 and ITME-90475.