Compiling and Running the Sample (Copied from the AppToolkit docs)

Locked
Arthur
Site Admin
Posts: 30
Joined: Sun Mar 31, 2019 4:23 am

Compiling and Running the Sample (Copied from the AppToolkit docs)

Post by Arthur » Wed Apr 03, 2019 6:28 pm

This page shows you how to authenticate, connect, and run an iOS app made with the Jibo App Toolkit. For documentation on how to create your own app, see Hello World.

View the sample code
  1. Clone the swift library repo: git clone git@github.com:jiborobot/apptoolkit-swift-library.git
  2. In Xcode, open AppToolkit.xcworkspace from the apptoolkit-swift-library repo you cloned.
  3. Expand AppToolkitSampleApp in the left sidebar.
  4. Explore the code in the sample app.
Add Client ID
You need to add your ClientID to the app in order to run it on your robot.
  1. In the sidebar, open AppToolkitSampleApp/AppToolkitSampleApp/Metadata/Info.plist
  2. Click the JiboSDK expand triangle.
  3. Double-click the Value box for ClientID and replace the entry with your client ID.
  4. Double-click the Value box for ClientSecret and replace the entry with your passcode.
Run the simulator
  1. Make sure AppToolkitSampleApp is in the dropdown next to the Play and Stop buttons on the top-left Xcode toolbar. (It will likely be AppToolkit by default, so check this carefully.)
  2. Click the Play button on the toolbar. This will launch the app in the iPhone simulator on your computer. The simulator might open behind other windows on your screen.

* Note: if you experience any errors, you might need to close the project, open terminal, run the following from the root of the apptoolkit-swift-library project, and then reopen the project:

Code: Select all

pod repo update
pod install
Authenticate
  1. When the simulator opens (this could take a few seconds), click Authenticate.
  2. Type your Jibo App email address and password, then click Sign in.
  3. When asked if you want to allow the app to connect to your robot, click Yes.
Connect
  1. A list of all the robots associated with your account will appear onscreen. It may take a few seconds for them to appear. Click the one you want to connect to. (This can take quite while for the list to appear)
  2. Wait for robotName: followed by your four-word robot name to appear in the xcode console. It may take a few minutes.
  3. Click Connect in the iPhone simulator. The app should connect to Jibo. Jibo's light ring will turn magenta, and a small magenta dot will appear on the bottom-right of his screen. (Note: the magenta light ring and dot may not appear depending on your permission level.)
Run on a robot
  1. After connecting, the iPhone simulator will show a list of commands. Click Say. (If the window with the list of commands doesnt appear, you may have to quit the program and re-run)
  2. Type hello world in the Content: box and click Say. Jibo should say "hello world."
  3. Now type Let me put on my dancing shoes <anim cat='dance' filter='&(music),!(beat-box,house,short)' endNeutral='true'/>., click Say, and watch Jibo dance! Check out the ESML page for more examples and instructions on how to create expressive speech with Jibo.
  4. Try out the other commands in the app. See the Known Issues section below for commands we know might not work as expected.
Disconnect
  1. In the test app, tap the "back" button on the top-left until you get back to the initial screen with 2 blue buttons.
  2. Tap the Disconnect button to disconnect from the robot. Jibo returns to his normal state.
Log out
  1. Tap the Invalidate button to remove access to remotely control the robot that is currently authenticated.
  2. Click the Stop button on the Xcode toolbar to close the iPhone simulator.
  3. For additional security, you can go to the Jibo app and toggle off the Enable remote control switch that you turned on when setting up your robot.
Known Issues
Though we have commands for Get Face Entity and LookAt Entity, they are not implemented yet. Using those commands won’t fail, but they also will not produce any action on Jibo’s part. We will let you know when those are implemented in the near future.
(The simulator is pretty buggy, and can cause the app to not work correctly. I have had to run the app multiple times before getting it to work and get to the list of commands window)

Locked